| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 DCHECK(layoutObject.node()); | 86 DCHECK(layoutObject.node()); |
| 87 | 87 |
| 88 PaintRenderingContext2D* renderingContext = PaintRenderingContext2D::create( | 88 PaintRenderingContext2D* renderingContext = PaintRenderingContext2D::create( |
| 89 ImageBuffer::create(WTF::wrapUnique( | 89 ImageBuffer::create(WTF::wrapUnique( |
| 90 new RecordingImageBufferSurface(size, nullptr /* fallbackFactory */, | 90 new RecordingImageBufferSurface(size, nullptr /* fallbackFactory */, |
| 91 m_hasAlpha ? NonOpaque : Opaque))), | 91 m_hasAlpha ? NonOpaque : Opaque))), |
| 92 m_hasAlpha, zoom); | 92 m_hasAlpha, zoom); |
| 93 PaintSize* paintSize = PaintSize::create(specifiedSize); | 93 PaintSize* paintSize = PaintSize::create(specifiedSize); |
| 94 StylePropertyMap* styleMap = FilteredComputedStylePropertyMap::create( | 94 StylePropertyMap* styleMap = FilteredComputedStylePropertyMap::create( |
| 95 CSSComputedStyleDeclaration::create(layoutObject.node()), | 95 CSSComputedStyleDeclaration::create(layoutObject.node()), |
| 96 m_nativeInvalidationProperties, m_customInvalidationProperties); | 96 m_nativeInvalidationProperties, m_customInvalidationProperties, |
| 97 layoutObject.node()); |
| 97 | 98 |
| 98 v8::Local<v8::Value> argv[] = { | 99 v8::Local<v8::Value> argv[] = { |
| 99 ToV8(renderingContext, m_scriptState->context()->Global(), isolate), | 100 ToV8(renderingContext, m_scriptState->context()->Global(), isolate), |
| 100 ToV8(paintSize, m_scriptState->context()->Global(), isolate), | 101 ToV8(paintSize, m_scriptState->context()->Global(), isolate), |
| 101 ToV8(styleMap, m_scriptState->context()->Global(), isolate)}; | 102 ToV8(styleMap, m_scriptState->context()->Global(), isolate)}; |
| 102 | 103 |
| 103 v8::Local<v8::Function> paint = m_paint.newLocal(isolate); | 104 v8::Local<v8::Function> paint = m_paint.newLocal(isolate); |
| 104 | 105 |
| 105 v8::TryCatch block(isolate); | 106 v8::TryCatch block(isolate); |
| 106 block.SetVerbose(true); | 107 block.SetVerbose(true); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 131 v8::Local<v8::Object> paintInstance; | 132 v8::Local<v8::Object> paintInstance; |
| 132 if (V8ObjectConstructor::newInstance(isolate, constructor) | 133 if (V8ObjectConstructor::newInstance(isolate, constructor) |
| 133 .ToLocal(&paintInstance)) { | 134 .ToLocal(&paintInstance)) { |
| 134 m_instance.set(isolate, paintInstance); | 135 m_instance.set(isolate, paintInstance); |
| 135 } | 136 } |
| 136 | 137 |
| 137 m_didCallConstructor = true; | 138 m_didCallConstructor = true; |
| 138 } | 139 } |
| 139 | 140 |
| 140 } // namespace blink | 141 } // namespace blink |
| OLD | NEW |