| 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/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" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| 86 // invalid image. | 86 // invalid image. |
| 87 if (IsUndefinedOrNull(instance)) | 87 if (IsUndefinedOrNull(instance)) |
| 88 return nullptr; | 88 return nullptr; |
| 89 | 89 |
| 90 DCHECK(layout_object.GetNode()); | 90 DCHECK(layout_object.GetNode()); |
| 91 | 91 |
| 92 PaintRenderingContext2D* rendering_context = PaintRenderingContext2D::Create( | 92 PaintRenderingContext2D* rendering_context = PaintRenderingContext2D::Create( |
| 93 ImageBuffer::Create(WTF::WrapUnique( | 93 ImageBuffer::Create(WTF::WrapUnique(new RecordingImageBufferSurface( |
| 94 new RecordingImageBufferSurface(size, nullptr /* fallbackFactory */, | 94 size, has_alpha_ ? kNonOpaque : kOpaque))), |
| 95 has_alpha_ ? kNonOpaque : kOpaque))), | |
| 96 has_alpha_, zoom); | 95 has_alpha_, zoom); |
| 97 PaintSize* paint_size = PaintSize::Create(specified_size); | 96 PaintSize* paint_size = PaintSize::Create(specified_size); |
| 98 StylePropertyMapReadonly* style_map = | 97 StylePropertyMapReadonly* style_map = |
| 99 FilteredComputedStylePropertyMap::Create( | 98 FilteredComputedStylePropertyMap::Create( |
| 100 CSSComputedStyleDeclaration::Create(layout_object.GetNode()), | 99 CSSComputedStyleDeclaration::Create(layout_object.GetNode()), |
| 101 native_invalidation_properties_, custom_invalidation_properties_, | 100 native_invalidation_properties_, custom_invalidation_properties_, |
| 102 layout_object.GetNode()); | 101 layout_object.GetNode()); |
| 103 | 102 |
| 104 v8::Local<v8::Value> argv[] = { | 103 v8::Local<v8::Value> argv[] = { |
| 105 ToV8(rendering_context, script_state_->GetContext()->Global(), isolate), | 104 ToV8(rendering_context, script_state_->GetContext()->Global(), isolate), |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 v8::Local<v8::Object> paint_instance; | 138 v8::Local<v8::Object> paint_instance; |
| 140 if (V8ObjectConstructor::NewInstance(isolate, constructor) | 139 if (V8ObjectConstructor::NewInstance(isolate, constructor) |
| 141 .ToLocal(&paint_instance)) { | 140 .ToLocal(&paint_instance)) { |
| 142 instance_.Set(isolate, paint_instance); | 141 instance_.Set(isolate, paint_instance); |
| 143 } | 142 } |
| 144 | 143 |
| 145 did_call_constructor_ = true; | 144 did_call_constructor_ = true; |
| 146 } | 145 } |
| 147 | 146 |
| 148 } // namespace blink | 147 } // namespace blink |
| OLD | NEW |