Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.cpp

Issue 1896893004: Hook up style invalidation for CSS Paint API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@css-paint-register
Patch Set: rebase. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "modules/csspaint/CSSPaintDefinition.h" 5 #include "modules/csspaint/CSSPaintDefinition.h"
6 6
7 #include "bindings/core/v8/ScriptState.h" 7 #include "bindings/core/v8/ScriptState.h"
8 #include "bindings/core/v8/V8Binding.h" 8 #include "bindings/core/v8/V8Binding.h"
9 #include "bindings/core/v8/V8BindingMacros.h" 9 #include "bindings/core/v8/V8BindingMacros.h"
10 #include "bindings/core/v8/V8ObjectConstructor.h" 10 #include "bindings/core/v8/V8ObjectConstructor.h"
11 #include "core/dom/ExecutionContext.h" 11 #include "core/dom/ExecutionContext.h"
12 #include "modules/csspaint/Geometry.h" 12 #include "modules/csspaint/Geometry.h"
13 #include "modules/csspaint/PaintRenderingContext2D.h" 13 #include "modules/csspaint/PaintRenderingContext2D.h"
14 #include "platform/graphics/ImageBuffer.h" 14 #include "platform/graphics/ImageBuffer.h"
15 #include "platform/graphics/PaintGeneratedImage.h" 15 #include "platform/graphics/PaintGeneratedImage.h"
16 #include "platform/graphics/RecordingImageBufferSurface.h" 16 #include "platform/graphics/RecordingImageBufferSurface.h"
17 17
18 namespace blink { 18 namespace blink {
19 19
20 CSSPaintDefinition* CSSPaintDefinition::create(ScriptState* scriptState, v8::Loc al<v8::Function> constructor, v8::Local<v8::Function> paint) 20 CSSPaintDefinition* CSSPaintDefinition::create(ScriptState* scriptState, v8::Loc al<v8::Function> constructor, v8::Local<v8::Function> paint, Vector<CSSPropertyI D>& nativeInvalidationProperties, Vector<AtomicString>& customInvalidationProper ties)
21 { 21 {
22 return new CSSPaintDefinition(scriptState, constructor, paint); 22 return new CSSPaintDefinition(scriptState, constructor, paint, nativeInvalid ationProperties, customInvalidationProperties);
23 } 23 }
24 24
25 CSSPaintDefinition::CSSPaintDefinition(ScriptState* scriptState, v8::Local<v8::F unction> constructor, v8::Local<v8::Function> paint) 25 CSSPaintDefinition::CSSPaintDefinition(ScriptState* scriptState, v8::Local<v8::F unction> constructor, v8::Local<v8::Function> paint, Vector<CSSPropertyID>& nati veInvalidationProperties, Vector<AtomicString>& customInvalidationProperties)
26 : m_scriptState(scriptState) 26 : m_scriptState(scriptState)
27 , m_constructor(scriptState->isolate(), constructor) 27 , m_constructor(scriptState->isolate(), constructor)
28 , m_paint(scriptState->isolate(), paint) 28 , m_paint(scriptState->isolate(), paint)
29 { 29 {
30 m_nativeInvalidationProperties.swap(nativeInvalidationProperties);
31 m_customInvalidationProperties.swap(customInvalidationProperties);
30 } 32 }
31 33
32 CSSPaintDefinition::~CSSPaintDefinition() 34 CSSPaintDefinition::~CSSPaintDefinition()
33 { 35 {
34 } 36 }
35 37
36 PassRefPtr<Image> CSSPaintDefinition::paint(const IntSize& size) 38 PassRefPtr<Image> CSSPaintDefinition::paint(const IntSize& size)
37 { 39 {
38 ScriptState::Scope scope(m_scriptState.get()); 40 ScriptState::Scope scope(m_scriptState.get());
39 41
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 87
86 v8::Local<v8::Object> paintInstance; 88 v8::Local<v8::Object> paintInstance;
87 if (V8ObjectConstructor::newInstance(isolate, constructor).ToLocal(&paintIns tance)) { 89 if (V8ObjectConstructor::newInstance(isolate, constructor).ToLocal(&paintIns tance)) {
88 m_instance.set(isolate, paintInstance); 90 m_instance.set(isolate, paintInstance);
89 } 91 }
90 92
91 m_didCallConstructor = true; 93 m_didCallConstructor = true;
92 } 94 }
93 95
94 } // namespace blink 96 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698