| 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/debug/trace_event_impl.h" | 8 #include "base/debug/trace_event_impl.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 void WebLayerImpl::replaceChild(WebLayer* reference, WebLayer* new_layer) { | 90 void WebLayerImpl::replaceChild(WebLayer* reference, WebLayer* new_layer) { |
| 91 layer_->ReplaceChild(static_cast<WebLayerImpl*>(reference)->layer(), | 91 layer_->ReplaceChild(static_cast<WebLayerImpl*>(reference)->layer(), |
| 92 static_cast<WebLayerImpl*>(new_layer)->layer()); | 92 static_cast<WebLayerImpl*>(new_layer)->layer()); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void WebLayerImpl::removeFromParent() { layer_->RemoveFromParent(); } | 95 void WebLayerImpl::removeFromParent() { layer_->RemoveFromParent(); } |
| 96 | 96 |
| 97 void WebLayerImpl::removeAllChildren() { layer_->RemoveAllChildren(); } | 97 void WebLayerImpl::removeAllChildren() { layer_->RemoveAllChildren(); } |
| 98 | 98 |
| 99 void WebLayerImpl::setAnchorPoint(const WebFloatPoint& anchor_point) { | |
| 100 layer_->SetAnchorPoint(anchor_point); | |
| 101 } | |
| 102 | |
| 103 WebFloatPoint WebLayerImpl::anchorPoint() const { | |
| 104 return layer_->anchor_point(); | |
| 105 } | |
| 106 | |
| 107 void WebLayerImpl::setAnchorPointZ(float anchor_point_z) { | |
| 108 layer_->SetAnchorPointZ(anchor_point_z); | |
| 109 } | |
| 110 | |
| 111 float WebLayerImpl::anchorPointZ() const { return layer_->anchor_point_z(); } | |
| 112 | |
| 113 void WebLayerImpl::setBounds(const WebSize& size) { layer_->SetBounds(size); } | 99 void WebLayerImpl::setBounds(const WebSize& size) { layer_->SetBounds(size); } |
| 114 | 100 |
| 115 WebSize WebLayerImpl::bounds() const { return layer_->bounds(); } | 101 WebSize WebLayerImpl::bounds() const { return layer_->bounds(); } |
| 116 | 102 |
| 117 void WebLayerImpl::setMasksToBounds(bool masks_to_bounds) { | 103 void WebLayerImpl::setMasksToBounds(bool masks_to_bounds) { |
| 118 layer_->SetMasksToBounds(masks_to_bounds); | 104 layer_->SetMasksToBounds(masks_to_bounds); |
| 119 } | 105 } |
| 120 | 106 |
| 121 bool WebLayerImpl::masksToBounds() const { return layer_->masks_to_bounds(); } | 107 bool WebLayerImpl::masksToBounds() const { return layer_->masks_to_bounds(); } |
| 122 | 108 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 } | 145 } |
| 160 | 146 |
| 161 WebFloatPoint WebLayerImpl::position() const { return layer_->position(); } | 147 WebFloatPoint WebLayerImpl::position() const { return layer_->position(); } |
| 162 | 148 |
| 163 void WebLayerImpl::setTransform(const SkMatrix44& matrix) { | 149 void WebLayerImpl::setTransform(const SkMatrix44& matrix) { |
| 164 gfx::Transform transform; | 150 gfx::Transform transform; |
| 165 transform.matrix() = matrix; | 151 transform.matrix() = matrix; |
| 166 layer_->SetTransform(transform); | 152 layer_->SetTransform(transform); |
| 167 } | 153 } |
| 168 | 154 |
| 155 void WebLayerImpl::setTransformOrigin(const blink::WebFloatPoint3D& point) { |
| 156 gfx::Point3F gfx_point = point; |
| 157 layer_->SetTransformOrigin(gfx_point); |
| 158 } |
| 159 |
| 160 blink::WebFloatPoint3D WebLayerImpl::transformOrigin() const { |
| 161 return layer_->transform_origin(); |
| 162 } |
| 163 |
| 164 void WebLayerImpl::setAnchorPoint(const blink::WebFloatPoint&) {} |
| 165 |
| 166 blink::WebFloatPoint WebLayerImpl::anchorPoint() const { |
| 167 return blink::WebFloatPoint(); |
| 168 } |
| 169 |
| 170 void WebLayerImpl::setAnchorPointZ(float) {} |
| 171 |
| 172 float WebLayerImpl::anchorPointZ() const { |
| 173 return 0.f; |
| 174 }; |
| 175 |
| 169 SkMatrix44 WebLayerImpl::transform() const { | 176 SkMatrix44 WebLayerImpl::transform() const { |
| 170 return layer_->transform().matrix(); | 177 return layer_->transform().matrix(); |
| 171 } | 178 } |
| 172 | 179 |
| 173 void WebLayerImpl::setDrawsContent(bool draws_content) { | 180 void WebLayerImpl::setDrawsContent(bool draws_content) { |
| 174 layer_->SetIsDrawable(draws_content); | 181 layer_->SetIsDrawable(draws_content); |
| 175 } | 182 } |
| 176 | 183 |
| 177 bool WebLayerImpl::drawsContent() const { return layer_->DrawsContent(); } | 184 bool WebLayerImpl::drawsContent() const { return layer_->DrawsContent(); } |
| 178 | 185 |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 void WebLayerImpl::setClipParent(blink::WebLayer* parent) { | 449 void WebLayerImpl::setClipParent(blink::WebLayer* parent) { |
| 443 cc::Layer* clip_parent = NULL; | 450 cc::Layer* clip_parent = NULL; |
| 444 if (parent) | 451 if (parent) |
| 445 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); | 452 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); |
| 446 layer_->SetClipParent(clip_parent); | 453 layer_->SetClipParent(clip_parent); |
| 447 } | 454 } |
| 448 | 455 |
| 449 Layer* WebLayerImpl::layer() const { return layer_.get(); } | 456 Layer* WebLayerImpl::layer() const { return layer_.get(); } |
| 450 | 457 |
| 451 } // namespace webkit | 458 } // namespace webkit |
| OLD | NEW |