OLD | NEW |
---|---|
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" | |
22 #include "webkit/renderer/compositor_bindings/web_filter_operations_impl.h" | 23 #include "webkit/renderer/compositor_bindings/web_filter_operations_impl.h" |
23 #include "webkit/renderer/compositor_bindings/web_to_cc_animation_delegate_adapt er.h" | 24 #include "webkit/renderer/compositor_bindings/web_to_cc_animation_delegate_adapt er.h" |
24 | 25 |
25 using cc::Animation; | 26 using cc::Animation; |
26 using cc::Layer; | 27 using cc::Layer; |
27 using WebKit::WebLayer; | 28 using WebKit::WebLayer; |
28 using WebKit::WebFloatPoint; | 29 using WebKit::WebFloatPoint; |
29 using WebKit::WebVector; | 30 using WebKit::WebVector; |
30 using WebKit::WebRect; | 31 using WebKit::WebRect; |
31 using WebKit::WebSize; | 32 using WebKit::WebSize; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
106 | 107 |
107 void WebLayerImpl::setReplicaLayer(WebLayer* replica_layer) { | 108 void WebLayerImpl::setReplicaLayer(WebLayer* replica_layer) { |
108 layer_->SetReplicaLayer( | 109 layer_->SetReplicaLayer( |
109 replica_layer ? static_cast<WebLayerImpl*>(replica_layer)->layer() : 0); | 110 replica_layer ? static_cast<WebLayerImpl*>(replica_layer)->layer() : 0); |
110 } | 111 } |
111 | 112 |
112 void WebLayerImpl::setOpacity(float opacity) { layer_->SetOpacity(opacity); } | 113 void WebLayerImpl::setOpacity(float opacity) { layer_->SetOpacity(opacity); } |
113 | 114 |
114 float WebLayerImpl::opacity() const { return layer_->opacity(); } | 115 float WebLayerImpl::opacity() const { return layer_->opacity(); } |
115 | 116 |
117 void WebLayerImpl::setBlendMode(WebKit::WebBlendMode blendMode) { | |
enne (OOO)
2013/10/11 18:14:35
blend_mode
rosca
2013/10/16 14:54:47
Done.
| |
118 layer_->SetBlendMode(BlendModeToSkia(blendMode)); | |
119 } | |
120 | |
121 WebKit::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 | |
116 void WebLayerImpl::setOpaque(bool opaque) { layer_->SetContentsOpaque(opaque); } | 133 void WebLayerImpl::setOpaque(bool opaque) { layer_->SetContentsOpaque(opaque); } |
117 | 134 |
118 bool WebLayerImpl::opaque() const { return layer_->contents_opaque(); } | 135 bool WebLayerImpl::opaque() const { return layer_->contents_opaque(); } |
119 | 136 |
120 void WebLayerImpl::setPosition(const WebFloatPoint& position) { | 137 void WebLayerImpl::setPosition(const WebFloatPoint& position) { |
121 layer_->SetPosition(position); | 138 layer_->SetPosition(position); |
122 } | 139 } |
123 | 140 |
124 WebFloatPoint WebLayerImpl::position() const { return layer_->position(); } | 141 WebFloatPoint WebLayerImpl::position() const { return layer_->position(); } |
125 | 142 |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
395 void WebLayerImpl::setClipParent(WebKit::WebLayer* parent) { | 412 void WebLayerImpl::setClipParent(WebKit::WebLayer* parent) { |
396 cc::Layer* clip_parent = NULL; | 413 cc::Layer* clip_parent = NULL; |
397 if (parent) | 414 if (parent) |
398 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); | 415 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); |
399 layer_->SetClipParent(clip_parent); | 416 layer_->SetClipParent(clip_parent); |
400 } | 417 } |
401 | 418 |
402 Layer* WebLayerImpl::layer() const { return layer_.get(); } | 419 Layer* WebLayerImpl::layer() const { return layer_.get(); } |
403 | 420 |
404 } // namespace webkit | 421 } // namespace webkit |
OLD | NEW |