OLD | NEW |
1 # CSS Paint API | 1 # CSS Paint API |
2 | 2 |
3 This directory contains the implementation of the CSS Paint API. | 3 This directory contains the implementation of the CSS Paint API. |
4 | 4 |
5 See [CSS Paint API](https://drafts.css-houdini.org/css-paint-api/) for the web e
xposed APIs this | 5 See [CSS Paint API](https://drafts.css-houdini.org/css-paint-api/) for the web e
xposed APIs this |
6 implements. | 6 implements. |
7 | 7 |
8 ## Implementation | 8 ## Implementation |
9 | 9 |
10 ### [CSSPaintDefinition](CSSPaintDefinition.h) | 10 ### [CSSPaintDefinition](CSSPaintDefinition.h) |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 ### Generating a [PaintGeneratedImage](../../platform/graphics/PaintGeneratedIma
ge.h) | 42 ### Generating a [PaintGeneratedImage](../../platform/graphics/PaintGeneratedIma
ge.h) |
43 | 43 |
44 `PaintGeneratedImage` is a `Image` which just paints a single `SkPicture`. | 44 `PaintGeneratedImage` is a `Image` which just paints a single `SkPicture`. |
45 | 45 |
46 A `CSSPaintValue` can generate an image from the method `CSSPaintImageGenerator#
paint`. This method | 46 A `CSSPaintValue` can generate an image from the method `CSSPaintImageGenerator#
paint`. This method |
47 calls through to `CSSPaintDefinition#paint` which actually invokes the javascrip
t paint method. | 47 calls through to `CSSPaintDefinition#paint` which actually invokes the javascrip
t paint method. |
48 This method returns the `PaintGeneratedImage`. | 48 This method returns the `PaintGeneratedImage`. |
49 | 49 |
50 The `SkPicture` is produced from a `RecordingImageBufferSurface`. | 50 The `SkPicture` is produced from a `RecordingImageBufferSurface`. |
51 | 51 |
| 52 ### Style Invalidation |
| 53 |
| 54 The `CSSPaintDefinition` keeps a list of both native and custom properties it wi
ll invalidate on. |
| 55 During style invalidation `ComputedStyle` checks if it has any `CSSPaintValue`s,
and if any of their |
| 56 properties have changed; if so it will invalidate paint for that `ComputedStyle`
. |
| 57 |
| 58 If the `CSSPaintValue` doesn't have a corresponding `CSSPaintDefinition` yet, it
doesn't invalidate |
| 59 paint. |
| 60 |
52 ## Testing | 61 ## Testing |
53 | 62 |
54 Tests live [here](../../../LayoutTests/csspaint/). | 63 Tests live [here](../../../LayoutTests/csspaint/). |
55 | 64 |
OLD | NEW |