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/tiled_layer_test_common.h" | 5 #include "cc/test/tiled_layer_test_common.h" |
6 | 6 |
7 namespace cc { | 7 namespace cc { |
8 | 8 |
9 FakeLayerUpdater::Resource::Resource(FakeLayerUpdater* layer, | 9 FakeLayerUpdater::Resource::Resource(FakeLayerUpdater* layer, |
10 scoped_ptr<PrioritizedResource> texture) | 10 scoped_ptr<PrioritizedResource> texture) |
(...skipping 18 matching lines...) Expand all Loading... |
29 layer_->Update(); | 29 layer_->Update(); |
30 } | 30 } |
31 | 31 |
32 FakeLayerUpdater::FakeLayerUpdater() : prepare_count_(0), update_count_(0) {} | 32 FakeLayerUpdater::FakeLayerUpdater() : prepare_count_(0), update_count_(0) {} |
33 | 33 |
34 FakeLayerUpdater::~FakeLayerUpdater() {} | 34 FakeLayerUpdater::~FakeLayerUpdater() {} |
35 | 35 |
36 void FakeLayerUpdater::PrepareToUpdate(const gfx::Rect& content_rect, | 36 void FakeLayerUpdater::PrepareToUpdate(const gfx::Rect& content_rect, |
37 const gfx::Size& tile_size, | 37 const gfx::Size& tile_size, |
38 float contents_width_scale, | 38 float contents_width_scale, |
39 float contents_height_scale, | 39 float contents_height_scale) { |
40 gfx::Rect* resulting_opaque_rect) { | |
41 prepare_count_++; | 40 prepare_count_++; |
42 last_update_rect_ = content_rect; | 41 last_update_rect_ = content_rect; |
43 if (!rect_to_invalidate_.IsEmpty()) { | 42 if (!rect_to_invalidate_.IsEmpty()) { |
44 layer_->InvalidateContentRect(rect_to_invalidate_); | 43 layer_->InvalidateContentRect(rect_to_invalidate_); |
45 rect_to_invalidate_ = gfx::Rect(); | 44 rect_to_invalidate_ = gfx::Rect(); |
46 layer_ = NULL; | 45 layer_ = NULL; |
47 } | 46 } |
48 *resulting_opaque_rect = opaque_paint_rect_; | |
49 } | 47 } |
50 | 48 |
51 void FakeLayerUpdater::SetRectToInvalidate(const gfx::Rect& rect, | 49 void FakeLayerUpdater::SetRectToInvalidate(const gfx::Rect& rect, |
52 FakeTiledLayer* layer) { | 50 FakeTiledLayer* layer) { |
53 rect_to_invalidate_ = rect; | 51 rect_to_invalidate_ = rect; |
54 layer_ = layer; | 52 layer_ = layer; |
55 } | 53 } |
56 | 54 |
57 scoped_ptr<LayerUpdater::Resource> FakeLayerUpdater::CreateResource( | 55 scoped_ptr<LayerUpdater::Resource> FakeLayerUpdater::CreateResource( |
58 PrioritizedResourceManager* manager) { | 56 PrioritizedResourceManager* manager) { |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 float* contents_scale_y, | 153 float* contents_scale_y, |
156 gfx::Size* content_bounds) { | 154 gfx::Size* content_bounds) { |
157 *contents_scale_x = | 155 *contents_scale_x = |
158 static_cast<float>(forced_content_bounds_.width()) / bounds().width(); | 156 static_cast<float>(forced_content_bounds_.width()) / bounds().width(); |
159 *contents_scale_y = | 157 *contents_scale_y = |
160 static_cast<float>(forced_content_bounds_.height()) / bounds().height(); | 158 static_cast<float>(forced_content_bounds_.height()) / bounds().height(); |
161 *content_bounds = forced_content_bounds_; | 159 *content_bounds = forced_content_bounds_; |
162 } | 160 } |
163 | 161 |
164 } // namespace cc | 162 } // namespace cc |
OLD | NEW |