OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CSSPaintImageGenerator_h | 5 #ifndef CSSPaintImageGenerator_h |
6 #define CSSPaintImageGenerator_h | 6 #define CSSPaintImageGenerator_h |
7 | 7 |
8 #include "core/CSSPropertyNames.h" | 8 #include "core/CSSPropertyNames.h" |
9 #include "core/CoreExport.h" | 9 #include "core/CoreExport.h" |
10 #include "platform/geometry/IntSize.h" | 10 #include "platform/geometry/IntSize.h" |
11 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
| 15 class CSSVariableData; |
15 class Document; | 16 class Document; |
16 class Image; | 17 class Image; |
17 class LayoutObject; | 18 class LayoutObject; |
18 | 19 |
19 // Produces a PaintGeneratedImage from a CSS Paint API callback. | 20 // Produces a PaintGeneratedImage from a CSS Paint API callback. |
20 // https://drafts.css-houdini.org/css-paint-api/ | 21 // https://drafts.css-houdini.org/css-paint-api/ |
21 class CORE_EXPORT CSSPaintImageGenerator | 22 class CORE_EXPORT CSSPaintImageGenerator |
22 : public GarbageCollectedFinalized<CSSPaintImageGenerator> { | 23 : public GarbageCollectedFinalized<CSSPaintImageGenerator> { |
23 public: | 24 public: |
24 // This observer is used if the paint worklet doesn't have a javascript | 25 // This observer is used if the paint worklet doesn't have a javascript |
(...skipping 15 matching lines...) Expand all Loading... |
40 typedef CSSPaintImageGenerator* (*CSSPaintImageGeneratorCreateFunction)( | 41 typedef CSSPaintImageGenerator* (*CSSPaintImageGeneratorCreateFunction)( |
41 const String&, | 42 const String&, |
42 Document&, | 43 Document&, |
43 Observer*); | 44 Observer*); |
44 static void init(CSSPaintImageGeneratorCreateFunction); | 45 static void init(CSSPaintImageGeneratorCreateFunction); |
45 | 46 |
46 // Invokes the CSS Paint API 'paint' callback. May return a nullptr | 47 // Invokes the CSS Paint API 'paint' callback. May return a nullptr |
47 // representing an invalid image if an error occurred. | 48 // representing an invalid image if an error occurred. |
48 virtual PassRefPtr<Image> paint(const LayoutObject&, | 49 virtual PassRefPtr<Image> paint(const LayoutObject&, |
49 const IntSize&, | 50 const IntSize&, |
50 float zoom) = 0; | 51 float zoom, |
| 52 const Vector<RefPtr<CSSVariableData>>&) = 0; |
51 | 53 |
52 virtual const Vector<CSSPropertyID>& nativeInvalidationProperties() const = 0; | 54 virtual const Vector<CSSPropertyID>& nativeInvalidationProperties() const = 0; |
53 virtual const Vector<AtomicString>& customInvalidationProperties() const = 0; | 55 virtual const Vector<AtomicString>& customInvalidationProperties() const = 0; |
54 virtual bool hasAlpha() const = 0; | 56 virtual bool hasAlpha() const = 0; |
55 | 57 |
56 DEFINE_INLINE_VIRTUAL_TRACE() {} | 58 DEFINE_INLINE_VIRTUAL_TRACE() {} |
57 }; | 59 }; |
58 | 60 |
59 } // namespace blink | 61 } // namespace blink |
60 | 62 |
61 #endif // CSSPaintImageGenerator_h | 63 #endif // CSSPaintImageGenerator_h |
OLD | NEW |