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

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

Issue 2941533002: Break StyleImage dependency on LayoutObject (Closed)
Patch Set: Rebase w/HEAD Created 3 years, 6 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/V8BindingForCore.h" 7 #include "bindings/core/v8/V8BindingForCore.h"
8 #include "core/css/CSSComputedStyleDeclaration.h" 8 #include "core/css/CSSComputedStyleDeclaration.h"
9 #include "core/css/cssom/FilteredComputedStylePropertyMap.h" 9 #include "core/css/cssom/FilteredComputedStylePropertyMap.h"
10 #include "core/dom/ExecutionContext.h" 10 #include "core/dom/ExecutionContext.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 did_call_constructor_(false), 61 did_call_constructor_(false),
62 has_alpha_(has_alpha) { 62 has_alpha_(has_alpha) {
63 native_invalidation_properties_.swap(native_invalidation_properties); 63 native_invalidation_properties_.swap(native_invalidation_properties);
64 custom_invalidation_properties_.swap(custom_invalidation_properties); 64 custom_invalidation_properties_.swap(custom_invalidation_properties);
65 input_argument_types_.swap(input_argument_types); 65 input_argument_types_.swap(input_argument_types);
66 } 66 }
67 67
68 CSSPaintDefinition::~CSSPaintDefinition() {} 68 CSSPaintDefinition::~CSSPaintDefinition() {}
69 69
70 PassRefPtr<Image> CSSPaintDefinition::Paint( 70 PassRefPtr<Image> CSSPaintDefinition::Paint(
71 const LayoutObject& layout_object, 71 const ImageResourceObserver& client,
72 const IntSize& size, 72 const IntSize& size,
73 const CSSStyleValueVector* paint_arguments) { 73 const CSSStyleValueVector* paint_arguments) {
74 DCHECK(paint_arguments); 74 DCHECK(paint_arguments);
75 75
76 // TODO: Break dependency on LayoutObject.
ikilpatrick 2017/06/13 18:41:01 todo: add node.
77 const LayoutObject& layout_object = static_cast<const LayoutObject&>(client);
78
76 float zoom = layout_object.StyleRef().EffectiveZoom(); 79 float zoom = layout_object.StyleRef().EffectiveZoom();
77 const IntSize specified_size = GetSpecifiedSize(size, zoom); 80 const IntSize specified_size = GetSpecifiedSize(size, zoom);
78 81
79 ScriptState::Scope scope(script_state_.Get()); 82 ScriptState::Scope scope(script_state_.Get());
80 83
81 MaybeCreatePaintInstance(); 84 MaybeCreatePaintInstance();
82 85
83 v8::Isolate* isolate = script_state_->GetIsolate(); 86 v8::Isolate* isolate = script_state_->GetIsolate();
84 v8::Local<v8::Object> instance = instance_.NewLocal(isolate); 87 v8::Local<v8::Object> instance = instance_.NewLocal(isolate);
85 88
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 did_call_constructor_ = true; 149 did_call_constructor_ = true;
147 } 150 }
148 151
149 DEFINE_TRACE_WRAPPERS(CSSPaintDefinition) { 152 DEFINE_TRACE_WRAPPERS(CSSPaintDefinition) {
150 visitor->TraceWrappers(constructor_.Cast<v8::Value>()); 153 visitor->TraceWrappers(constructor_.Cast<v8::Value>());
151 visitor->TraceWrappers(paint_.Cast<v8::Value>()); 154 visitor->TraceWrappers(paint_.Cast<v8::Value>());
152 visitor->TraceWrappers(instance_.Cast<v8::Value>()); 155 visitor->TraceWrappers(instance_.Cast<v8::Value>());
153 } 156 }
154 157
155 } // namespace blink 158 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698