aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/canvasrenderingcontext2d.rs
Commit message (Collapse)AuthorAgeFilesLines
* Implement IsPointInPathDavid Zbarsky2015-12-051-1/+14
|
* Reset canvas state when changing bitmap dimensionsDavid Zbarsky2015-11-301-1/+9
|
* Update Canvas webIDL to specDavid Zbarsky2015-11-281-5/+5
|
* Tidy.Simon Sapin2015-11-231-1/+1
|
* Parse currentColor as Canvas2D colorDavid Zbarsky2015-11-211-2/+24
|
* Auto merge of #8530 - KiChjang:split-constellation-msg, r=jdmbors-servo2015-11-191-1/+1
|\ | | | | | | | | | | | | | | | | | | Split ConstellationMsg into ScriptMsg and CompositorMsg Fixes #8356. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8530) <!-- Reviewable:end -->
| * Split ConstellationMsg into ScriptMsg and CompositorMsgKeith Yeung2015-11-161-1/+1
| |
* | Rustfmt some of script.Ms2ger2015-11-181-105/+220
|/
* Replaced DOMString constructor by conversion functions.Alan Jeffrey2015-11-121-18/+17
| | | | | | Replaced DOMString(...) by DOMString::from(...). Replaced ....0 by String::from(...). Removed any uses of .to_owner() in DOMString::from("...").
* Make DOMString a newtype around String, rather than a typedef.Ms2ger2015-11-041-9/+9
| | | | | | | | | | This should make it somewhat easier to experiment with alternative representations in the future. To reduce churn, this commit leaves the String field public, though. Also, this will allow us to use the default String type to represent the IDL USVString type, which explicitly forbids unpaired surrogates, ans as such is a better match to the Rust String type.
* Get rid of a bunch of explicit derefsDavid Zbarsky2015-11-031-9/+6
|
* merge from masterrohan.prinja2015-11-031-13/+12
|\
| * Remove JSTraceable implementation from RefCell.Eli Friedman2015-11-021-5/+5
| | | | | | | | | | The implementation wasn't really right, and we would rather just use DOMRefCell anyway.
| * Removed JS::root Fixes #8251nxnfufunezn2015-10-311-8/+7
| |
* | more refactoringrohan.prinja2015-10-301-1/+1
| |
* | move Castable into dom::bindings::inheritancerohan.prinja2015-10-301-1/+1
|/
* Make unrooted_must_root a bit more aggressive.Eli Friedman2015-10-231-0/+1
| | | | | | | | | Basically, instead of trying to check for specific kinds of statements, just check the types of all local variables. Also included are some commented-out proposals for some slightly more aggressive lints which might be useful (but trigger a little too frequently at the moment).
* Auto merge of #8086 - froydnj:premultiply-tables, r=jdmbors-servo2015-10-211-6/+5
|\ | | | | | | | | | | | | | | | | | | add (un)premultiply tables for canvas {Get,Put}ImageData operations Pretty straightforward use of lookup tables to replace a bunch of expensive float operations. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8086) <!-- Reviewable:end -->
| * add un-premultiply table for GetImageDataNathan Froyd2015-10-201-6/+5
| | | | | | | | Fixes #6969.
* | Auto merge of #8115 - nerith:canvas, r=jdmbors-servo2015-10-211-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't require the CanvasFillOrStrokeStyle enum to be public CanvasFillOrStrokeStyle is only used in a single file, so it does not need to be a public enum. Fixes #8105. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8115) <!-- Reviewable:end -->
| * | Don't require the CanvasFillOrStrokeStyle enum to be publicBrandon Fairchild2015-10-211-1/+1
| |/ | | | | | | | | | | | | CanvasFillOrStrokeStyle is only used in a single file, so it does not need to be a public enum. Fixes #8105.
* | Clean up the cast callsAnthony Ramine2015-10-211-3/+1
| |
* | Introduce trait CastableAnthony Ramine2015-10-211-3/+3
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This trait is used to hold onto the downcast and upcast functions of all castable IDL interfaces. A castable IDL interface is one which either derives from or is derived by other interfaces. The deriving relation is represented by implementations of marker trait DerivedFrom<T: Castable> generated in InheritTypes. /^[ ]*use dom::bindings::codegen::InheritTypes::.*(Base|Cast|Derived)/ { /::[a-zA-Z]+(Base|Cast|Derived);/d s/([{ ])[a-zA-Z]+(Base|Cast|Derived), /\1/g s/([{ ])[a-zA-Z]+(Base|Cast|Derived), /\1/g s/, [a-zA-Z]+(Base|Cast|Derived)([},])/\2/g s/, [a-zA-Z]+(Base|Cast|Derived)([},])/\2/g /\{([a-zA-Z]+(Base|Cast|Derived))?\};$/d s/\{([a-zA-Z_]+)\};$/\1;/ } s/([a-zA-Z]+)Cast::from_ref\(\&?\**([a-zA-Z_]+)(\.r\(\))?\)/\2.upcast::<\1>()/g s/([a-zA-Z]+)Cast::from_ref\(\&?\**([a-zA-Z_]+)(\.[a-zA-Z_]+\(\))?\)/\2\3.upcast::<\1>()/g s/\(([a-zA-Z]+)Cast::from_ref\)/\(Castable::upcast::<\1>\)/g s/([a-zA-Z]+)Cast::from_root/Root::upcast::<\1>/g s/([a-zA-Z]+)Cast::from_layout_js\(\&([a-zA-Z_.]+)\)/\2.upcast::<\1>()/g s/([a-zA-Z]+)Cast::to_ref\(\&?\**([a-zA-Z_]+)(\.r\(\))?\)/\2.downcast::<\1>()/g s/([a-zA-Z]+)Cast::to_ref\(\&?\**([a-zA-Z_]+)(\.[a-zA-Z_]+\(\))?\)/\2\3.downcast::<\1>()/g s/\(([a-zA-Z]+)Cast::to_ref\)/\(Castable::downcast::<\1>\)/g s/([a-zA-Z]+)Cast::to_root/Root::downcast::<\1>/g s/([a-zA-Z]+)Cast::to_layout_js\(&?([a-zA-Z_.]+(\(\))?)\)/\2.downcast::<\1>()/g s/\.is_document\(\)/.is::<Document>()/g s/\.is_htmlanchorelement\(\)/.is::<HTMLAnchorElement>()/g s/\.is_htmlappletelement\(\)/.is::<HTMLAppletElement>()/g s/\.is_htmlareaelement\(\)/.is::<HTMLAreaElement>()/g s/\.is_htmlbodyelement\(\)/.is::<HTMLBodyElement>()/g s/\.is_htmlembedelement\(\)/.is::<HTMLEmbedElement>()/g s/\.is_htmlfieldsetelement\(\)/.is::<HTMLFieldSetElement>()/g s/\.is_htmlformelement\(\)/.is::<HTMLFormElement>()/g s/\.is_htmlframesetelement\(\)/.is::<HTMLFrameSetElement>()/g s/\.is_htmlhtmlelement\(\)/.is::<HTMLHtmlElement>()/g s/\.is_htmlimageelement\(\)/.is::<HTMLImageElement>()/g s/\.is_htmllegendelement\(\)/.is::<HTMLLegendElement>()/g s/\.is_htmloptgroupelement\(\)/.is::<HTMLOptGroupElement>()/g s/\.is_htmloptionelement\(\)/.is::<HTMLOptionElement>()/g s/\.is_htmlscriptelement\(\)/.is::<HTMLScriptElement>()/g s/\.is_htmltabledatacellelement\(\)/.is::<HTMLTableDataCellElement>()/g s/\.is_htmltableheadercellelement\(\)/.is::<HTMLTableHeaderCellElement>()/g s/\.is_htmltablerowelement\(\)/.is::<HTMLTableRowElement>()/g s/\.is_htmltablesectionelement\(\)/.is::<HTMLTableSectionElement>()/g s/\.is_htmltitleelement\(\)/.is::<HTMLTitleElement>()/g
* Stop implementing Copy for JS<T>.Eli Friedman2015-10-151-2/+2
| | | | | A copy of a JS<T> doesn't have the rooting properties of the original, so it makes no sense for it to implement Copy.
* Link to the HTML multipage spec, not the single-page one.Eli Friedman2015-10-131-2/+2
|
* Refactor Error enum usage to consistently be qualifiedAnthony Urena2015-10-061-16/+15
|
* webgl: texImage2D with a canvas argumentEmilio Cobos Álvarez2015-09-251-37/+14
|
* sorted the extern crate, mod & use declarationsRavi Shankar2015-09-241-6/+5
|
* Fix reported test-tidy errors for unmerged import blocksBrandon Fairchild2015-09-191-14/+9
| | | | This merges import blocks that were reported by tidy as unmerged.
* Make use of FromStr and Default traits in lib canvasThiago Pontes2015-09-031-4/+5
| | | | fixup! Make use of FromStr and Default traits in lib canvas
* Fix reported test-tidy errorsBrandon Fairchild2015-09-011-1/+1
| | | | | This fixes lines that were reported to have missing space after a comma.
* Merge adjacent identical `impl` sectionsCorey Farwell2015-08-281-3/+0
| | | | | Prior to #7416 and #7401, many of these `impl` sections were not identical
* Make the traits for the IDL interfaces take &selfAnthony Ramine2015-08-271-62/+62
|
* Remove helper traitsAnthony Ramine2015-08-271-11/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that JSRef<T> is gone, there is no need to have helper traits. On components/script/*.rs: # Remove imports. /^ *use dom::[a-z]+::\{.*Helpers/ { s/\{(Raw[^L]|[^L][^a])[a-zA-Z]+Helpers, /\{/ s/, (Raw[^L]|[^L][^a])[a-zA-Z]+Helpers([,}])/\2/g s/\{([a-zA-Z]+)\}/\1/ /\{\}/d s/::self;$/;/ } /^ *use dom::[a-z]+::\{?(Raw[^L]|[^L][^a])[a-zA-Z]+Helpers\}?;$/d On components/script/dom/*.rs: # Ignore layout things. /^(pub )?(impl|trait).*Layout.* \{/,/^}$/ { P; D; } # Delete helpers traits. /^(pub )?trait ([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? \{$/,/^\}$/D # Patch private helpers. /^impl.*Private.*Helpers/,/^\}$/ { s/^impl<'a> Private([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? for &'a ([^ ]+) \{$/impl \3 {/ /^ *(unsafe )?fn .*\(self.*[<&]'a/ { s/&'a /\&/g s/<'a, /</g } /^ *(unsafe )?fn /s/\(self([,)])/\(\&self\1/ } # Patch public helpers. /^impl.*Helpers/,/^\}$/ { s/^impl(<'a>)? ([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? for (&'a )?([^ ]+) \{$/impl \5 {/ /^ *(unsafe )?fn .*\(self.*[<&]'a/ { s/&'a /\&/g s/<'a, /</g } /^ *(unsafe )?fn .*\(&?self[,)]/s/(unsafe )?fn/pub &/ /^ *pub (unsafe )?fn /s/\(self([,)])/\(\&self\1/ } The few error cases were then fixed by hand.
* make dom_struct derive HeapSizeOf,João Oliveira2015-08-271-1/+0
| | | | closes #7357
* webgl: Implement multiple calls and improve error detectionecoal952015-08-251-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit implements WebGL's: * cullFace * frontFace * enable * disable * depthMask * colorMask * clearDepth * clearStencil * depthFunc * depthRange * hint * lineWidth * pixelStorei * polygonOffset * texParameteri * texParameterf * texImage2D (partially) It inlines a lot of OpenGL calls to keep the file `components/canvas/webgl_paint_task.rs` as small as possible while keeping readability. It also improves error detection on previous calls, and sets node damage on the canvas in the drawing calls. It adds a `TexImage2D` reftest, even though it's not enabled because: * WebGL paints the image when it loads (asynchronously), so the reftest doesn't wait for it and it finishes early * If we change the source for the base64 src of the image it works as expected in non-headless mode, but the test harness locks
* sort all usesJohann Tuffe2015-08-201-4/+4
|
* Fix existing syntactics nits.Josh Matthews2015-08-161-3/+5
|
* Measure heap memory usage for more types. Fixes #6951Bogdan Cuza2015-08-131-2/+4
|
* Auto merge of #7092 - dzbarsky:putimagedata, r=jdmbors-servo2015-08-091-6/+7
|\ | | | | | | | | | | | | | | | | | | Clean up and fix PutImageData <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7092) <!-- Reviewable:end -->
| * Switch PutImageData to using CopySurfaceDavid Zbarsky2015-08-081-4/+5
| |
| * Pass a Rect instead of an Option<Rect> to PutImageDataDavid Zbarsky2015-08-081-2/+2
| |
* | Fix getImageData with sizes < 1 pixelDavid Zbarsky2015-08-081-9/+23
|/
* GetImageData should return un-premultiplied alpha valuesDavid Zbarsky2015-08-061-1/+12
|
* Refactor DrawImage implementations to avoid code duplicationDavid Zbarsky2015-08-061-140/+53
|
* Auto merge of #6974 - dzbarsky:tiny-create, r=jdmbors-servo2015-08-051-1/+4
|\ | | | | | | | | | | | | | | | | | | Fix createImageData with sizes < 1 pixel <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6974) <!-- Reviewable:end -->
| * Fix createImageData with sizes < 1 pixelDavid Zbarsky2015-08-041-1/+4
| |
* | Make createRadialGradient throw for negative radiiDavid Zbarsky2015-08-041-4/+8
|/
* Clean up some methods in CanvasRendeingContext2DDavid Zbarsky2015-08-031-85/+26
|
* script: Make the `ImageCacheTask` use IPC.Patrick Walton2015-07-261-3/+2
| | | | | This necessitated getting rid of the boxed trait object that was being be passed between the script task and the image cache task.