| 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) |
| 11 : LayerUpdater::Resource(texture.Pass()), layer_(layer) { | 11 : LayerUpdater::Resource(texture.Pass()), layer_(layer) { |
| 12 bitmap_.setConfig(SkBitmap::kARGB_8888_Config, 10, 10); | 12 bitmap_.allocN32Pixels(10, 10); |
| 13 bitmap_.allocPixels(); | |
| 14 } | 13 } |
| 15 | 14 |
| 16 FakeLayerUpdater::Resource::~Resource() {} | 15 FakeLayerUpdater::Resource::~Resource() {} |
| 17 | 16 |
| 18 void FakeLayerUpdater::Resource::Update(ResourceUpdateQueue* queue, | 17 void FakeLayerUpdater::Resource::Update(ResourceUpdateQueue* queue, |
| 19 const gfx::Rect& source_rect, | 18 const gfx::Rect& source_rect, |
| 20 const gfx::Vector2d& dest_offset, | 19 const gfx::Vector2d& dest_offset, |
| 21 bool partial_update) { | 20 bool partial_update) { |
| 22 const gfx::Rect kRect(0, 0, 10, 10); | 21 const gfx::Rect kRect(0, 0, 10, 10); |
| 23 ResourceUpdate upload = ResourceUpdate::Create( | 22 ResourceUpdate upload = ResourceUpdate::Create( |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 float* contents_scale_y, | 161 float* contents_scale_y, |
| 163 gfx::Size* content_bounds) { | 162 gfx::Size* content_bounds) { |
| 164 *contents_scale_x = | 163 *contents_scale_x = |
| 165 static_cast<float>(forced_content_bounds_.width()) / bounds().width(); | 164 static_cast<float>(forced_content_bounds_.width()) / bounds().width(); |
| 166 *contents_scale_y = | 165 *contents_scale_y = |
| 167 static_cast<float>(forced_content_bounds_.height()) / bounds().height(); | 166 static_cast<float>(forced_content_bounds_.height()) / bounds().height(); |
| 168 *content_bounds = forced_content_bounds_; | 167 *content_bounds = forced_content_bounds_; |
| 169 } | 168 } |
| 170 | 169 |
| 171 } // namespace cc | 170 } // namespace cc |
| OLD | NEW |