| 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 blink::WebLayer; | 28 using blink::WebLayer; |
| 28 using blink::WebFloatPoint; | 29 using blink::WebFloatPoint; |
| 29 using blink::WebVector; | 30 using blink::WebVector; |
| 30 using blink::WebRect; | 31 using blink::WebRect; |
| 31 using blink::WebSize; | 32 using blink::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(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 |
| 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 void WebLayerImpl::setClipParent(blink::WebLayer* parent) { | 408 void WebLayerImpl::setClipParent(blink::WebLayer* parent) { |
| 392 cc::Layer* clip_parent = NULL; | 409 cc::Layer* clip_parent = NULL; |
| 393 if (parent) | 410 if (parent) |
| 394 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); | 411 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); |
| 395 layer_->SetClipParent(clip_parent); | 412 layer_->SetClipParent(clip_parent); |
| 396 } | 413 } |
| 397 | 414 |
| 398 Layer* WebLayerImpl::layer() const { return layer_.get(); } | 415 Layer* WebLayerImpl::layer() const { return layer_.get(); } |
| 399 | 416 |
| 400 } // namespace webkit | 417 } // namespace webkit |
| OLD | NEW |