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

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

Issue 2840093002: Allow RecordingImageBufferSurface to prevent fallback. (Closed)
Patch Set: imagebuffer-fallback: missedone Created 3 years, 7 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/ScriptState.h" 7 #include "bindings/core/v8/ScriptState.h"
8 #include "bindings/core/v8/V8BindingForCore.h" 8 #include "bindings/core/v8/V8BindingForCore.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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(new RecordingImageBufferSurface( 93 ImageBuffer::Create(WTF::WrapUnique(new RecordingImageBufferSurface(
94 size, has_alpha_ ? kNonOpaque : kOpaque))), 94 size, RecordingImageBufferSurface::kDisallowFallback,
95 has_alpha_ ? kNonOpaque : kOpaque))),
95 has_alpha_, zoom); 96 has_alpha_, zoom);
96 PaintSize* paint_size = PaintSize::Create(specified_size); 97 PaintSize* paint_size = PaintSize::Create(specified_size);
97 StylePropertyMapReadonly* style_map = 98 StylePropertyMapReadonly* style_map =
98 FilteredComputedStylePropertyMap::Create( 99 FilteredComputedStylePropertyMap::Create(
99 CSSComputedStyleDeclaration::Create(layout_object.GetNode()), 100 CSSComputedStyleDeclaration::Create(layout_object.GetNode()),
100 native_invalidation_properties_, custom_invalidation_properties_, 101 native_invalidation_properties_, custom_invalidation_properties_,
101 layout_object.GetNode()); 102 layout_object.GetNode());
102 103
103 v8::Local<v8::Value> argv[] = { 104 v8::Local<v8::Value> argv[] = {
104 ToV8(rendering_context, script_state_->GetContext()->Global(), isolate), 105 ToV8(rendering_context, script_state_->GetContext()->Global(), isolate),
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 v8::Local<v8::Object> paint_instance; 139 v8::Local<v8::Object> paint_instance;
139 if (V8ObjectConstructor::NewInstance(isolate, constructor) 140 if (V8ObjectConstructor::NewInstance(isolate, constructor)
140 .ToLocal(&paint_instance)) { 141 .ToLocal(&paint_instance)) {
141 instance_.Set(isolate, paint_instance); 142 instance_.Set(isolate, paint_instance);
142 } 143 }
143 144
144 did_call_constructor_ = true; 145 did_call_constructor_ = true;
145 } 146 }
146 147
147 } // namespace blink 148 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698