| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "cc/blink/web_layer_impl_fixed_bounds.h" | 5 #include "cc/blink/web_layer_impl_fixed_bounds.h" |
| 6 | 6 |
| 7 #include "cc/layers/layer.h" | 7 #include "cc/layers/layer.h" |
| 8 #include "third_party/WebKit/public/platform/WebFloatPoint.h" | 8 #include "third_party/WebKit/public/platform/WebFloatPoint.h" |
| 9 #include "third_party/WebKit/public/platform/WebSize.h" | 9 #include "third_party/WebKit/public/platform/WebSize.h" |
| 10 #include "third_party/skia/include/utils/SkMatrix44.h" | 10 #include "third_party/skia/include/utils/SkMatrix44.h" |
| 11 | 11 |
| 12 using cc::Layer; | 12 using cc::Layer; |
| 13 | 13 |
| 14 namespace cc_blink { | 14 namespace cc_blink { |
| 15 | 15 |
| 16 WebLayerImplFixedBounds::WebLayerImplFixedBounds() { | 16 WebLayerImplFixedBounds::WebLayerImplFixedBounds() { |
| 17 } | 17 } |
| 18 | 18 |
| 19 WebLayerImplFixedBounds::WebLayerImplFixedBounds(scoped_refptr<Layer> layer) | 19 WebLayerImplFixedBounds::WebLayerImplFixedBounds(scoped_refptr<Layer> layer) |
| 20 : WebLayerImpl(layer) { | 20 : WebLayerImpl(layer) { |
| 21 } | 21 } |
| 22 | 22 |
| 23 WebLayerImplFixedBounds::~WebLayerImplFixedBounds() { | 23 WebLayerImplFixedBounds::~WebLayerImplFixedBounds() { |
| 24 } | 24 } |
| 25 | 25 |
| 26 void WebLayerImplFixedBounds::invalidateRect(const blink::WebFloatRect& rect) { | |
| 27 // Partial invalidations seldom occur for such layers. | |
| 28 // Simply invalidate the whole layer to avoid transformation of coordinates. | |
| 29 invalidate(); | |
| 30 } | |
| 31 | |
| 32 void WebLayerImplFixedBounds::invalidateRect(const blink::WebRect& rect) { | 26 void WebLayerImplFixedBounds::invalidateRect(const blink::WebRect& rect) { |
| 33 // Partial invalidations seldom occur for such layers. | 27 // Partial invalidations seldom occur for such layers. |
| 34 // Simply invalidate the whole layer to avoid transformation of coordinates. | 28 // Simply invalidate the whole layer to avoid transformation of coordinates. |
| 35 invalidate(); | 29 invalidate(); |
| 36 } | 30 } |
| 37 | 31 |
| 38 void WebLayerImplFixedBounds::setTransformOrigin( | 32 void WebLayerImplFixedBounds::setTransformOrigin( |
| 39 const blink::WebFloatPoint3D& transform_origin) { | 33 const blink::WebFloatPoint3D& transform_origin) { |
| 40 if (transform_origin != this->transformOrigin()) { | 34 if (transform_origin != this->transformOrigin()) { |
| 41 layer_->SetTransformOrigin(transform_origin); | 35 layer_->SetTransformOrigin(transform_origin); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 gfx::Transform transform_with_bounds_scale(original_transform_); | 91 gfx::Transform transform_with_bounds_scale(original_transform_); |
| 98 float bounds_scale_x = | 92 float bounds_scale_x = |
| 99 static_cast<float>(original_bounds_.width()) / fixed_bounds_.width(); | 93 static_cast<float>(original_bounds_.width()) / fixed_bounds_.width(); |
| 100 float bounds_scale_y = | 94 float bounds_scale_y = |
| 101 static_cast<float>(original_bounds_.height()) / fixed_bounds_.height(); | 95 static_cast<float>(original_bounds_.height()) / fixed_bounds_.height(); |
| 102 transform_with_bounds_scale.Scale(bounds_scale_x, bounds_scale_y); | 96 transform_with_bounds_scale.Scale(bounds_scale_x, bounds_scale_y); |
| 103 layer_->SetTransform(transform_with_bounds_scale); | 97 layer_->SetTransform(transform_with_bounds_scale); |
| 104 } | 98 } |
| 105 | 99 |
| 106 } // namespace cc_blink | 100 } // namespace cc_blink |
| OLD | NEW |