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

Side by Side Diff: webkit/renderer/compositor_bindings/web_layer_impl.cc

Issue 105333002: Revert of Renderer-compositor bindings for mix-blend-mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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
« no previous file with comments | « webkit/renderer/compositor_bindings/web_layer_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "webkit/renderer/compositor_bindings/web_layer_impl.h" 5 #include "webkit/renderer/compositor_bindings/web_layer_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "cc/animation/animation.h" 9 #include "cc/animation/animation.h"
10 #include "cc/base/region.h" 10 #include "cc/base/region.h"
11 #include "cc/layers/layer.h" 11 #include "cc/layers/layer.h"
12 #include "cc/layers/layer_position_constraint.h" 12 #include "cc/layers/layer_position_constraint.h"
13 #include "third_party/WebKit/public/platform/WebCompositingReasons.h" 13 #include "third_party/WebKit/public/platform/WebCompositingReasons.h"
14 #include "third_party/WebKit/public/platform/WebFloatPoint.h" 14 #include "third_party/WebKit/public/platform/WebFloatPoint.h"
15 #include "third_party/WebKit/public/platform/WebFloatRect.h" 15 #include "third_party/WebKit/public/platform/WebFloatRect.h"
16 #include "third_party/WebKit/public/platform/WebLayerClient.h" 16 #include "third_party/WebKit/public/platform/WebLayerClient.h"
17 #include "third_party/WebKit/public/platform/WebLayerPositionConstraint.h" 17 #include "third_party/WebKit/public/platform/WebLayerPositionConstraint.h"
18 #include "third_party/WebKit/public/platform/WebLayerScrollClient.h" 18 #include "third_party/WebKit/public/platform/WebLayerScrollClient.h"
19 #include "third_party/WebKit/public/platform/WebSize.h" 19 #include "third_party/WebKit/public/platform/WebSize.h"
20 #include "third_party/skia/include/utils/SkMatrix44.h" 20 #include "third_party/skia/include/utils/SkMatrix44.h"
21 #include "webkit/renderer/compositor_bindings/web_animation_impl.h" 21 #include "webkit/renderer/compositor_bindings/web_animation_impl.h"
22 #include "webkit/renderer/compositor_bindings/web_blend_mode.h"
23 #include "webkit/renderer/compositor_bindings/web_filter_operations_impl.h" 22 #include "webkit/renderer/compositor_bindings/web_filter_operations_impl.h"
24 #include "webkit/renderer/compositor_bindings/web_to_cc_animation_delegate_adapt er.h" 23 #include "webkit/renderer/compositor_bindings/web_to_cc_animation_delegate_adapt er.h"
25 24
26 using cc::Animation; 25 using cc::Animation;
27 using cc::Layer; 26 using cc::Layer;
28 using blink::WebLayer; 27 using blink::WebLayer;
29 using blink::WebFloatPoint; 28 using blink::WebFloatPoint;
30 using blink::WebVector; 29 using blink::WebVector;
31 using blink::WebRect; 30 using blink::WebRect;
32 using blink::WebSize; 31 using blink::WebSize;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 106
108 void WebLayerImpl::setReplicaLayer(WebLayer* replica_layer) { 107 void WebLayerImpl::setReplicaLayer(WebLayer* replica_layer) {
109 layer_->SetReplicaLayer( 108 layer_->SetReplicaLayer(
110 replica_layer ? static_cast<WebLayerImpl*>(replica_layer)->layer() : 0); 109 replica_layer ? static_cast<WebLayerImpl*>(replica_layer)->layer() : 0);
111 } 110 }
112 111
113 void WebLayerImpl::setOpacity(float opacity) { layer_->SetOpacity(opacity); } 112 void WebLayerImpl::setOpacity(float opacity) { layer_->SetOpacity(opacity); }
114 113
115 float WebLayerImpl::opacity() const { return layer_->opacity(); } 114 float WebLayerImpl::opacity() const { return layer_->opacity(); }
116 115
117 void WebLayerImpl::setBlendMode(blink::WebBlendMode blend_mode) {
118 layer_->SetBlendMode(BlendModeToSkia(blend_mode));
119 }
120
121 blink::WebBlendMode WebLayerImpl::blendMode() const {
122 return BlendModeFromSkia(layer_->blend_mode());
123 }
124
125 void WebLayerImpl::setIsRootForIsolatedGroup(bool isolate) {
126 layer_->SetIsRootForIsolatedGroup(isolate);
127 }
128
129 bool WebLayerImpl::isRootForIsolatedGroup() {
130 return layer_->is_root_for_isolated_group();
131 }
132
133 void WebLayerImpl::setOpaque(bool opaque) { layer_->SetContentsOpaque(opaque); } 116 void WebLayerImpl::setOpaque(bool opaque) { layer_->SetContentsOpaque(opaque); }
134 117
135 bool WebLayerImpl::opaque() const { return layer_->contents_opaque(); } 118 bool WebLayerImpl::opaque() const { return layer_->contents_opaque(); }
136 119
137 void WebLayerImpl::setPosition(const WebFloatPoint& position) { 120 void WebLayerImpl::setPosition(const WebFloatPoint& position) {
138 layer_->SetPosition(position); 121 layer_->SetPosition(position);
139 } 122 }
140 123
141 WebFloatPoint WebLayerImpl::position() const { return layer_->position(); } 124 WebFloatPoint WebLayerImpl::position() const { return layer_->position(); }
142 125
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 void WebLayerImpl::setClipParent(blink::WebLayer* parent) { 391 void WebLayerImpl::setClipParent(blink::WebLayer* parent) {
409 cc::Layer* clip_parent = NULL; 392 cc::Layer* clip_parent = NULL;
410 if (parent) 393 if (parent)
411 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); 394 clip_parent = static_cast<WebLayerImpl*>(parent)->layer();
412 layer_->SetClipParent(clip_parent); 395 layer_->SetClipParent(clip_parent);
413 } 396 }
414 397
415 Layer* WebLayerImpl::layer() const { return layer_.get(); } 398 Layer* WebLayerImpl::layer() const { return layer_.get(); }
416 399
417 } // namespace webkit 400 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/renderer/compositor_bindings/web_layer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698