| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 if (isUndefinedOrNull(instance)) | 70 if (isUndefinedOrNull(instance)) |
| 71 return nullptr; | 71 return nullptr; |
| 72 | 72 |
| 73 DCHECK(layoutObject.node()); | 73 DCHECK(layoutObject.node()); |
| 74 | 74 |
| 75 PaintRenderingContext2D* renderingContext = PaintRenderingContext2D::create( | 75 PaintRenderingContext2D* renderingContext = PaintRenderingContext2D::create( |
| 76 ImageBuffer::create(wrapUnique(new RecordingImageBufferSurface(size, nul
lptr /* fallbackFactory */, m_hasAlpha ? NonOpaque : Opaque))), m_hasAlpha, zoo
m); | 76 ImageBuffer::create(wrapUnique(new RecordingImageBufferSurface(size, nul
lptr /* fallbackFactory */, m_hasAlpha ? NonOpaque : Opaque))), m_hasAlpha, zoo
m); |
| 77 PaintSize* paintSize = PaintSize::create(specifiedSize); | 77 PaintSize* paintSize = PaintSize::create(specifiedSize); |
| 78 StylePropertyMap* styleMap = FilteredComputedStylePropertyMap::create( | 78 StylePropertyMap* styleMap = FilteredComputedStylePropertyMap::create( |
| 79 CSSComputedStyleDeclaration::create(layoutObject.node()), | 79 CSSComputedStyleDeclaration::create(layoutObject.node()), |
| 80 m_nativeInvalidationProperties, m_customInvalidationProperties); | 80 m_nativeInvalidationProperties, m_customInvalidationProperties, layoutOb
ject.node()); |
| 81 | 81 |
| 82 v8::Local<v8::Value> argv[] = { | 82 v8::Local<v8::Value> argv[] = { |
| 83 toV8(renderingContext, m_scriptState->context()->Global(), isolate), | 83 toV8(renderingContext, m_scriptState->context()->Global(), isolate), |
| 84 toV8(paintSize, m_scriptState->context()->Global(), isolate), | 84 toV8(paintSize, m_scriptState->context()->Global(), isolate), |
| 85 toV8(styleMap, m_scriptState->context()->Global(), isolate) | 85 toV8(styleMap, m_scriptState->context()->Global(), isolate) |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 v8::Local<v8::Function> paint = m_paint.newLocal(isolate); | 88 v8::Local<v8::Function> paint = m_paint.newLocal(isolate); |
| 89 | 89 |
| 90 v8::TryCatch block(isolate); | 90 v8::TryCatch block(isolate); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 114 | 114 |
| 115 v8::Local<v8::Object> paintInstance; | 115 v8::Local<v8::Object> paintInstance; |
| 116 if (V8ObjectConstructor::newInstance(isolate, constructor).ToLocal(&paintIns
tance)) { | 116 if (V8ObjectConstructor::newInstance(isolate, constructor).ToLocal(&paintIns
tance)) { |
| 117 m_instance.set(isolate, paintInstance); | 117 m_instance.set(isolate, paintInstance); |
| 118 } | 118 } |
| 119 | 119 |
| 120 m_didCallConstructor = true; | 120 m_didCallConstructor = true; |
| 121 } | 121 } |
| 122 | 122 |
| 123 } // namespace blink | 123 } // namespace blink |
| OLD | NEW |