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); | 24 static CSSPaintDefinition* create(ScriptState*, v8::Local<v8::Function> cons
tructor, v8::Local<v8::Function> paint, Vector<CSSPropertyID>&, Vector<AtomicStr
ing>& customInvalidationProperties); |
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 | 36 |
37 ScriptState* getScriptState() const { return m_scriptState.get(); } | 37 ScriptState* getScriptState() const { return m_scriptState.get(); } |
38 | 38 |
39 v8::Local<v8::Function> paintFunctionForTesting(v8::Isolate* isolate) { retu
rn m_paint.newLocal(isolate); } | 39 v8::Local<v8::Function> paintFunctionForTesting(v8::Isolate* isolate) { retu
rn m_paint.newLocal(isolate); } |
40 | 40 |
41 DEFINE_INLINE_TRACE() { }; | 41 DEFINE_INLINE_TRACE() { }; |
42 | 42 |
43 private: | 43 private: |
(...skipping 14 matching lines...) Expand all Loading... |
58 | 58 |
59 bool m_didCallConstructor; | 59 bool m_didCallConstructor; |
60 | 60 |
61 Vector<CSSPropertyID> m_nativeInvalidationProperties; | 61 Vector<CSSPropertyID> m_nativeInvalidationProperties; |
62 Vector<AtomicString> m_customInvalidationProperties; | 62 Vector<AtomicString> m_customInvalidationProperties; |
63 }; | 63 }; |
64 | 64 |
65 } // namespace blink | 65 } // namespace blink |
66 | 66 |
67 #endif // CSSPaintDefinition_h | 67 #endif // CSSPaintDefinition_h |
OLD | NEW |