| 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 #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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 native_invalidation_properties_.swap(native_invalidation_properties); | 62 native_invalidation_properties_.swap(native_invalidation_properties); |
| 63 custom_invalidation_properties_.swap(custom_invalidation_properties); | 63 custom_invalidation_properties_.swap(custom_invalidation_properties); |
| 64 input_argument_types_.swap(input_argument_types); | 64 input_argument_types_.swap(input_argument_types); |
| 65 } | 65 } |
| 66 | 66 |
| 67 CSSPaintDefinition::~CSSPaintDefinition() {} | 67 CSSPaintDefinition::~CSSPaintDefinition() {} |
| 68 | 68 |
| 69 PassRefPtr<Image> CSSPaintDefinition::Paint( | 69 PassRefPtr<Image> CSSPaintDefinition::Paint( |
| 70 const LayoutObject& layout_object, | 70 const LayoutObject& layout_object, |
| 71 const IntSize& size, | 71 const IntSize& size, |
| 72 float zoom, | |
| 73 const CSSStyleValueVector* paint_arguments) { | 72 const CSSStyleValueVector* paint_arguments) { |
| 74 DCHECK(paint_arguments); | 73 DCHECK(paint_arguments); |
| 75 | 74 |
| 75 float zoom = layout_object.StyleRef().EffectiveZoom(); |
| 76 const IntSize specified_size = GetSpecifiedSize(size, zoom); | 76 const IntSize specified_size = GetSpecifiedSize(size, zoom); |
| 77 | 77 |
| 78 ScriptState::Scope scope(script_state_.Get()); | 78 ScriptState::Scope scope(script_state_.Get()); |
| 79 | 79 |
| 80 MaybeCreatePaintInstance(); | 80 MaybeCreatePaintInstance(); |
| 81 | 81 |
| 82 v8::Isolate* isolate = script_state_->GetIsolate(); | 82 v8::Isolate* isolate = script_state_->GetIsolate(); |
| 83 v8::Local<v8::Object> instance = instance_.NewLocal(isolate); | 83 v8::Local<v8::Object> instance = instance_.NewLocal(isolate); |
| 84 | 84 |
| 85 // We may have failed to create an instance class, in which case produce an | 85 // We may have failed to create an instance class, in which case produce an |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 v8::Local<v8::Object> paint_instance; | 139 v8::Local<v8::Object> paint_instance; |
| 140 if (V8ObjectConstructor::NewInstance(isolate, constructor) | 140 if (V8ObjectConstructor::NewInstance(isolate, constructor) |
| 141 .ToLocal(&paint_instance)) { | 141 .ToLocal(&paint_instance)) { |
| 142 instance_.Set(isolate, paint_instance); | 142 instance_.Set(isolate, paint_instance); |
| 143 } | 143 } |
| 144 | 144 |
| 145 did_call_constructor_ = true; | 145 did_call_constructor_ = true; |
| 146 } | 146 } |
| 147 | 147 |
| 148 } // namespace blink | 148 } // namespace blink |
| OLD | NEW |