| 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/test/fake_content_layer.h" | 5 #include "cc/test/fake_content_layer.h" |
| 6 | 6 |
| 7 #include "cc/resources/content_layer_updater.h" | 7 #include "cc/resources/content_layer_updater.h" |
| 8 #include "cc/resources/prioritized_resource.h" | 8 #include "cc/resources/prioritized_resource.h" |
| 9 #include "cc/test/fake_content_layer_impl.h" | 9 #include "cc/test/fake_content_layer_impl.h" |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 output_surface_created_count_(0), | 25 output_surface_created_count_(0), |
| 26 always_update_resources_(false) { | 26 always_update_resources_(false) { |
| 27 SetBounds(gfx::Size(1, 1)); | 27 SetBounds(gfx::Size(1, 1)); |
| 28 SetIsDrawable(true); | 28 SetIsDrawable(true); |
| 29 } | 29 } |
| 30 | 30 |
| 31 FakeContentLayer::~FakeContentLayer() {} | 31 FakeContentLayer::~FakeContentLayer() {} |
| 32 | 32 |
| 33 scoped_ptr<LayerImpl> FakeContentLayer::CreateLayerImpl( | 33 scoped_ptr<LayerImpl> FakeContentLayer::CreateLayerImpl( |
| 34 LayerTreeImpl* tree_impl) { | 34 LayerTreeImpl* tree_impl) { |
| 35 return FakeContentLayerImpl::Create(tree_impl, layer_id_).PassAs<LayerImpl>(); | 35 return FakeContentLayerImpl::Create(tree_impl, layer_id_); |
| 36 } | 36 } |
| 37 | 37 |
| 38 bool FakeContentLayer::Update(ResourceUpdateQueue* queue, | 38 bool FakeContentLayer::Update(ResourceUpdateQueue* queue, |
| 39 const OcclusionTracker<Layer>* occlusion) { | 39 const OcclusionTracker<Layer>* occlusion) { |
| 40 bool updated = ContentLayer::Update(queue, occlusion); | 40 bool updated = ContentLayer::Update(queue, occlusion); |
| 41 update_count_++; | 41 update_count_++; |
| 42 return updated || always_update_resources_; | 42 return updated || always_update_resources_; |
| 43 } | 43 } |
| 44 | 44 |
| 45 gfx::Rect FakeContentLayer::LastPaintRect() const { | 45 gfx::Rect FakeContentLayer::LastPaintRect() const { |
| 46 return (static_cast<FakeContentLayerUpdater*>(Updater()))->paint_rect(); | 46 return (static_cast<FakeContentLayerUpdater*>(Updater()))->paint_rect(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void FakeContentLayer::PushPropertiesTo(LayerImpl* layer) { | 49 void FakeContentLayer::PushPropertiesTo(LayerImpl* layer) { |
| 50 ContentLayer::PushPropertiesTo(layer); | 50 ContentLayer::PushPropertiesTo(layer); |
| 51 push_properties_count_++; | 51 push_properties_count_++; |
| 52 } | 52 } |
| 53 | 53 |
| 54 void FakeContentLayer::OnOutputSurfaceCreated() { | 54 void FakeContentLayer::OnOutputSurfaceCreated() { |
| 55 ContentLayer::OnOutputSurfaceCreated(); | 55 ContentLayer::OnOutputSurfaceCreated(); |
| 56 output_surface_created_count_++; | 56 output_surface_created_count_++; |
| 57 } | 57 } |
| 58 | 58 |
| 59 bool FakeContentLayer::HaveBackingAt(int i, int j) { | 59 bool FakeContentLayer::HaveBackingAt(int i, int j) { |
| 60 const PrioritizedResource* resource = ResourceAtForTesting(i, j); | 60 const PrioritizedResource* resource = ResourceAtForTesting(i, j); |
| 61 return resource && resource->have_backing_texture(); | 61 return resource && resource->have_backing_texture(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 } // namespace cc | 64 } // namespace cc |
| OLD | NEW |