| 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 28 matching lines...) Expand all Loading... |
| 39 const gfx::Rect& paint_rect, | 39 const gfx::Rect& paint_rect, |
| 40 const gfx::Size& tile_size, | 40 const gfx::Size& tile_size, |
| 41 float contents_width_scale, | 41 float contents_width_scale, |
| 42 float contents_height_scale) { | 42 float contents_height_scale) { |
| 43 prepare_count_++; | 43 prepare_count_++; |
| 44 last_update_rect_ = paint_rect; | 44 last_update_rect_ = paint_rect; |
| 45 last_contents_width_scale_ = contents_width_scale; | 45 last_contents_width_scale_ = contents_width_scale; |
| 46 if (!rect_to_invalidate_.IsEmpty()) { | 46 if (!rect_to_invalidate_.IsEmpty()) { |
| 47 layer_->InvalidateContentRect(rect_to_invalidate_); | 47 layer_->InvalidateContentRect(rect_to_invalidate_); |
| 48 rect_to_invalidate_ = gfx::Rect(); | 48 rect_to_invalidate_ = gfx::Rect(); |
| 49 layer_ = NULL; | 49 layer_ = nullptr; |
| 50 } | 50 } |
| 51 } | 51 } |
| 52 | 52 |
| 53 void FakeLayerUpdater::SetRectToInvalidate(const gfx::Rect& rect, | 53 void FakeLayerUpdater::SetRectToInvalidate(const gfx::Rect& rect, |
| 54 FakeTiledLayer* layer) { | 54 FakeTiledLayer* layer) { |
| 55 rect_to_invalidate_ = rect; | 55 rect_to_invalidate_ = rect; |
| 56 layer_ = layer; | 56 layer_ = layer; |
| 57 } | 57 } |
| 58 | 58 |
| 59 scoped_ptr<LayerUpdater::Resource> FakeLayerUpdater::CreateResource( | 59 scoped_ptr<LayerUpdater::Resource> FakeLayerUpdater::CreateResource( |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 float* contents_scale_y, | 157 float* contents_scale_y, |
| 158 gfx::Size* content_bounds) { | 158 gfx::Size* content_bounds) { |
| 159 *contents_scale_x = | 159 *contents_scale_x = |
| 160 static_cast<float>(forced_content_bounds_.width()) / bounds().width(); | 160 static_cast<float>(forced_content_bounds_.width()) / bounds().width(); |
| 161 *contents_scale_y = | 161 *contents_scale_y = |
| 162 static_cast<float>(forced_content_bounds_.height()) / bounds().height(); | 162 static_cast<float>(forced_content_bounds_.height()) / bounds().height(); |
| 163 *content_bounds = forced_content_bounds_; | 163 *content_bounds = forced_content_bounds_; |
| 164 } | 164 } |
| 165 | 165 |
| 166 } // namespace cc | 166 } // namespace cc |
| OLD | NEW |