| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/trees/occlusion_tracker.h" | 5 #include "cc/trees/occlusion_tracker.h" |
| 6 | 6 |
| 7 #include "cc/animation/layer_animation_controller.h" | 7 #include "cc/animation/layer_animation_controller.h" |
| 8 #include "cc/base/math_util.h" | 8 #include "cc/base/math_util.h" |
| 9 #include "cc/layers/layer.h" | 9 #include "cc/layers/layer.h" |
| 10 #include "cc/layers/layer_impl.h" | 10 #include "cc/layers/layer_impl.h" |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 | 280 |
| 281 const gfx::Transform identity_matrix; | 281 const gfx::Transform identity_matrix; |
| 282 | 282 |
| 283 private: | 283 private: |
| 284 void SetRootLayerOnMainThread(Layer* root) { | 284 void SetRootLayerOnMainThread(Layer* root) { |
| 285 host_->SetRootLayer(scoped_refptr<Layer>(root)); | 285 host_->SetRootLayer(scoped_refptr<Layer>(root)); |
| 286 } | 286 } |
| 287 | 287 |
| 288 void SetRootLayerOnMainThread(LayerImpl* root) {} | 288 void SetRootLayerOnMainThread(LayerImpl* root) {} |
| 289 | 289 |
| 290 void SetBaseProperties(LayerImpl* layer, | 290 void SetProperties(LayerImpl* layer, |
| 291 const gfx::Transform& transform, | 291 const gfx::Transform& transform, |
| 292 const gfx::PointF& position, | 292 const gfx::PointF& position, |
| 293 const gfx::Size& bounds) { | 293 const gfx::Size& bounds) { |
| 294 layer->SetTransform(transform); | 294 layer->SetTransform(transform); |
| 295 layer->SetPosition(position); | 295 layer->SetPosition(position); |
| 296 layer->SetBounds(bounds); | 296 layer->SetBounds(bounds); |
| 297 } | 297 } |
| 298 | 298 |
| 299 void SetProperties(LayerImpl* layer, | |
| 300 const gfx::Transform& transform, | |
| 301 const gfx::PointF& position, | |
| 302 const gfx::Size& bounds) { | |
| 303 SetBaseProperties(layer, transform, position, bounds); | |
| 304 | |
| 305 layer->SetContentBounds(layer->bounds()); | |
| 306 } | |
| 307 | |
| 308 void SetReplica(LayerImpl* owning_layer, scoped_ptr<LayerImpl> layer) { | 299 void SetReplica(LayerImpl* owning_layer, scoped_ptr<LayerImpl> layer) { |
| 309 owning_layer->SetReplicaLayer(layer.Pass()); | 300 owning_layer->SetReplicaLayer(layer.Pass()); |
| 310 } | 301 } |
| 311 | 302 |
| 312 void SetMask(LayerImpl* owning_layer, scoped_ptr<LayerImpl> layer) { | 303 void SetMask(LayerImpl* owning_layer, scoped_ptr<LayerImpl> layer) { |
| 313 owning_layer->SetMaskLayer(layer.Pass()); | 304 owning_layer->SetMaskLayer(layer.Pass()); |
| 314 } | 305 } |
| 315 | 306 |
| 316 bool opaque_layers_; | 307 bool opaque_layers_; |
| 317 FakeLayerTreeHostClient client_; | 308 FakeLayerTreeHostClient client_; |
| (...skipping 2201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2519 EXPECT_EQ(gfx::Rect(), | 2510 EXPECT_EQ(gfx::Rect(), |
| 2520 occlusion.UnoccludedSurfaceContentRect( | 2511 occlusion.UnoccludedSurfaceContentRect( |
| 2521 surface, gfx::Rect(80, 70, 50, 50))); | 2512 surface, gfx::Rect(80, 70, 50, 50))); |
| 2522 } | 2513 } |
| 2523 }; | 2514 }; |
| 2524 | 2515 |
| 2525 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) | 2516 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) |
| 2526 | 2517 |
| 2527 } // namespace | 2518 } // namespace |
| 2528 } // namespace cc | 2519 } // namespace cc |
| OLD | NEW |