aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/canvasrenderingcontext2d.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* script: Make most of 2D canvas and WebGL run over IPC.Patrick Walton2015-07-251-61/+109
| | | | | | To actually make the multiprocess communication work, we'll need to reroute the task creation to the pipeline or the compositor. But this works as a first step.
* Add servo Image type. Remove rust-png dependency from script, gfx, layout.Glenn Watson2015-07-071-6/+6
|
* Refactor #[jstraceable] to #[derive(JSTraceable)]David Winslow2015-07-011-4/+2
| | | | fixes #6524
* Create pattern from HTMLCanvasElement or CanvasRenderingContext2D.Hyowon Kim2015-06-241-31/+77
|
* Auto merge of #6413 - hyowon:invalid_shadow_attrs, r=Ms2gerbors-servo2015-06-201-2/+15
|\ | | | | | | | | | | | | | | | | | | | | | | Check invalid values for the shadow attributes. I left out checking invalid values when setting the shadows attributes. r? @nox @pcwalton cc @yichoi <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6413) <!-- Reviewable:end -->
| * Check invalid values for the shadow attributes.Hyowon Kim2015-06-181-2/+15
| |
* | Upgrade to SM 39Michael Wu2015-06-191-48/+36
| |
* | Use euclid from crates.ioecoal952015-06-191-4/+4
|/
* rust-geom API changesCorey Farwell2015-06-131-39/+61
| | | | https://github.com/servo/rust-geom/pull/81
* Implementation of pattern fill style for canvas.Hyowon Kim2015-06-131-3/+45
|
* Remove gfx_traits from the dependencies of [script].Mátyás Mustoha2015-06-121-11/+3
|
* Add attributes for canvas shadows.Hyowon Kim2015-06-121-0/+64
|
* Replace fill_color and stroke_color with fill_style and stroke_style in ↵Hyowon Kim2015-06-061-19/+52
| | | | | | | CanvasContextState. The fillStyle and strokeStyle attributes can be either strings(color), CanvasGradients, or CanvasPatterns.
* Serialize colors for fill and stroke styles in canvas.Hyowon Kim2015-06-031-9/+21
|
* Auto merge of #6183 - ecoal95:webglcontextattributes, r=noxbors-servo2015-06-011-1/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r? @jdm I couldn't add the `getContextAttributes` method since `CodegenRust` doesn't know how to return a dictionary value, I'll take a look at it ASAP. I think the helper functions can return directly the renderer, since they're used just for that, but I wanted to hear your opinions about this. By the way I'm interested in adding more serious tests for WebGL, and I think the [khronos conformance suit](https://github.com/KhronosGroup/WebGL/tree/master/conformance-suites/1.0.3) should be the best option. Should I try to integrate it in wpt, or making a `tests/webgl` directory (or similar) inside the servo tree? (Maybe this question should be for @Ms2ger) <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6183) <!-- Reviewable:end -->
| * Add WebGLContextAttributes supportecoal952015-06-011-1/+5
| | | | | | | | | | | | | | This commit also: * Allows to return non-rootable dictionaries from Codegen. * Merges the two context types in an enum type.
* | Correct the calculation of rects for drawimage.Hyowon Kim2015-06-011-4/+4
|/
* Reduce max line length from 150 to 120 charactersCorey Farwell2015-05-241-11/+26
| | | | Part of https://github.com/servo/servo/issues/6041
* Auto merge of #5586 - pcwalton:no-broken-background-image-redux, r=glennwbors-servo2015-05-201-7/+5
|\ | | | | | | | | | | | | | | r? @jdm <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5586) <!-- Reviewable:end -->
| * net: Don't load the placeholder image for background images, only forPatrick Walton2015-05-201-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | image fragments. This also changes the way the placeholder is handled in the image cache task to decode it up front instead of each time an image fails to load, both because it was more convenient to implement that way and because it saves CPU cycles to do so. This matches the behavior of Gecko and WebKit. It improves the look of our cached copy of Wikipedia.
* | Layerize canvasecoal952015-05-201-4/+4
|/ | | | | | | Note that this keeps using readback right now, `NativeSurface` painting will be implemented soon. Also see https://github.com/servo/servo/issues/6142
* Auto merge of #5949 - mmatyas:canvas_dirty, r=jdmbors-servo2015-05-071-3/+19
|\ | | | | | | | | | | | | | | With this patch, it is now possible to create nice animations using the canvas. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5949) <!-- Reviewable:end -->
| * Mark the canvas as dirty on certain drawing calls.Mátyás Mustoha2015-05-061-3/+19
| |
* | Canvas: implement transformation matrix reset.Mátyás Mustoha2015-05-061-0/+6
| |
* | Auto merge of #5945 - mmatyas:canvas_mxrotate, r=jdmbors-servo2015-05-061-0/+14
|\ \ | |/ |/| | | | | | | <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5945) <!-- Reviewable:end -->
| * Canvas: implement transformation matrix rotation.Mátyás Mustoha2015-05-061-0/+14
| |