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

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: fix component build. Created 4 years, 8 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 "core/frame/ConsoleTypes.h" 12 #include "core/frame/ConsoleTypes.h"
13 #include "core/inspector/ConsoleMessage.h" 13 #include "core/inspector/ConsoleMessage.h"
14 #include "modules/csspaint/Geometry.h" 14 #include "modules/csspaint/Geometry.h"
15 #include "modules/csspaint/PaintRenderingContext2D.h" 15 #include "modules/csspaint/PaintRenderingContext2D.h"
16 #include "platform/ScriptForbiddenScope.h" 16 #include "platform/ScriptForbiddenScope.h"
17 #include "platform/graphics/ImageBuffer.h" 17 #include "platform/graphics/ImageBuffer.h"
18 #include "platform/graphics/PaintGeneratedImage.h" 18 #include "platform/graphics/PaintGeneratedImage.h"
19 #include "platform/graphics/RecordingImageBufferSurface.h" 19 #include "platform/graphics/RecordingImageBufferSurface.h"
20 #include "platform/graphics/UnacceleratedImageBufferSurface.h" 20 #include "platform/graphics/UnacceleratedImageBufferSurface.h"
21 21
22 namespace blink { 22 namespace blink {
23 23
24 CSSPaintDefinition* CSSPaintDefinition::create(ScriptState* scriptState, v8::Loc al<v8::Function> constructor, v8::Local<v8::Function> paint) 24 CSSPaintDefinition* CSSPaintDefinition::create(ScriptState* scriptState, v8::Loc al<v8::Function> constructor, v8::Local<v8::Function> paint, Vector<CSSPropertyI D>& nativeInvalidationProperties, Vector<AtomicString>& customInvalidationProper ties)
25 { 25 {
26 return new CSSPaintDefinition(scriptState, constructor, paint); 26 return new CSSPaintDefinition(scriptState, constructor, paint, nativeInvalid ationProperties, customInvalidationProperties);
27 } 27 }
28 28
29 CSSPaintDefinition::CSSPaintDefinition(ScriptState* scriptState, v8::Local<v8::F unction> constructor, v8::Local<v8::Function> paint) 29 CSSPaintDefinition::CSSPaintDefinition(ScriptState* scriptState, v8::Local<v8::F unction> constructor, v8::Local<v8::Function> paint, Vector<CSSPropertyID>& nati veInvalidationProperties, Vector<AtomicString>& customInvalidationProperties)
30 : m_scriptState(scriptState) 30 : m_scriptState(scriptState)
31 , m_constructor(scriptState->isolate(), constructor) 31 , m_constructor(scriptState->isolate(), constructor)
32 , m_paint(scriptState->isolate(), paint) 32 , m_paint(scriptState->isolate(), paint)
33 { 33 {
34 m_nativeInvalidationProperties.swap(nativeInvalidationProperties);
35 m_customInvalidationProperties.swap(customInvalidationProperties);
34 } 36 }
35 37
36 CSSPaintDefinition::~CSSPaintDefinition() 38 CSSPaintDefinition::~CSSPaintDefinition()
37 { 39 {
38 } 40 }
39 41
40 PassRefPtr<Image> CSSPaintDefinition::paint(const IntSize& size) 42 PassRefPtr<Image> CSSPaintDefinition::paint(const IntSize& size)
41 { 43 {
42 ScriptState::Scope scope(m_scriptState.get()); 44 ScriptState::Scope scope(m_scriptState.get());
43 45
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 91
90 v8::Local<v8::Object> paintInstance; 92 v8::Local<v8::Object> paintInstance;
91 if (V8ObjectConstructor::newInstance(isolate, constructor).ToLocal(&paintIns tance)) { 93 if (V8ObjectConstructor::newInstance(isolate, constructor).ToLocal(&paintIns tance)) {
92 m_instance.set(isolate, paintInstance); 94 m_instance.set(isolate, paintInstance);
93 } 95 }
94 96
95 m_didCallConstructor = true; 97 m_didCallConstructor = true;
96 } 98 }
97 99
98 } // namespace blink 100 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698