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 CSSPaintDefinition_h | 5 #ifndef CSSPaintDefinition_h |
6 #define CSSPaintDefinition_h | 6 #define CSSPaintDefinition_h |
7 | 7 |
8 #include "bindings/core/v8/ScopedPersistent.h" | 8 #include "bindings/core/v8/ScopedPersistent.h" |
9 #include "core/CSSPropertyNames.h" | 9 #include "core/CSSPropertyNames.h" |
10 #include "platform/geometry/IntSize.h" | 10 #include "platform/geometry/IntSize.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 public: | 23 public: |
24 static CSSPaintDefinition* create(ScriptState*, v8::Local<v8::Function> cons
tructor, v8::Local<v8::Function> paint, Vector<CSSPropertyID>&, Vector<AtomicStr
ing>& customInvalidationProperties, bool hasAlpha); | 24 static CSSPaintDefinition* create(ScriptState*, v8::Local<v8::Function> cons
tructor, v8::Local<v8::Function> paint, Vector<CSSPropertyID>&, Vector<AtomicStr
ing>& customInvalidationProperties, bool hasAlpha); |
25 virtual ~CSSPaintDefinition(); | 25 virtual ~CSSPaintDefinition(); |
26 | 26 |
27 // Invokes the javascript 'paint' callback on an instance of the javascript | 27 // Invokes the javascript 'paint' callback on an instance of the javascript |
28 // class. The size given will be the size of the PaintRenderingContext2D | 28 // class. The size given will be the size of the PaintRenderingContext2D |
29 // given to the callback. | 29 // given to the callback. |
30 // | 30 // |
31 // This may return a nullptr (representing an invalid image) if javascript | 31 // This may return a nullptr (representing an invalid image) if javascript |
32 // throws an error. | 32 // throws an error. |
33 PassRefPtr<Image> paint(const LayoutObject&, const IntSize&); | 33 PassRefPtr<Image> paint(const LayoutObject&, const IntSize&, float zoom); |
34 const Vector<CSSPropertyID>& nativeInvalidationProperties() const { return m
_nativeInvalidationProperties; } | 34 const Vector<CSSPropertyID>& nativeInvalidationProperties() const { return m
_nativeInvalidationProperties; } |
35 const Vector<AtomicString>& customInvalidationProperties() const { return m_
customInvalidationProperties; } | 35 const Vector<AtomicString>& customInvalidationProperties() const { return m_
customInvalidationProperties; } |
36 bool hasAlpha() const { return m_hasAlpha; } | 36 bool hasAlpha() const { return m_hasAlpha; } |
37 | 37 |
38 ScriptState* getScriptState() const { return m_scriptState.get(); } | 38 ScriptState* getScriptState() const { return m_scriptState.get(); } |
39 | 39 |
40 v8::Local<v8::Function> paintFunctionForTesting(v8::Isolate* isolate) { retu
rn m_paint.newLocal(isolate); } | 40 v8::Local<v8::Function> paintFunctionForTesting(v8::Isolate* isolate) { retu
rn m_paint.newLocal(isolate); } |
41 | 41 |
42 DEFINE_INLINE_TRACE() { }; | 42 DEFINE_INLINE_TRACE() { }; |
43 | 43 |
(...skipping 16 matching lines...) Expand all Loading... |
60 bool m_didCallConstructor; | 60 bool m_didCallConstructor; |
61 | 61 |
62 Vector<CSSPropertyID> m_nativeInvalidationProperties; | 62 Vector<CSSPropertyID> m_nativeInvalidationProperties; |
63 Vector<AtomicString> m_customInvalidationProperties; | 63 Vector<AtomicString> m_customInvalidationProperties; |
64 bool m_hasAlpha; | 64 bool m_hasAlpha; |
65 }; | 65 }; |
66 | 66 |
67 } // namespace blink | 67 } // namespace blink |
68 | 68 |
69 #endif // CSSPaintDefinition_h | 69 #endif // CSSPaintDefinition_h |
OLD | NEW |