| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/layers/picture_image_layer_impl.h" | 5 #include "cc/layers/picture_image_layer_impl.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/threading/thread_task_runner_handle.h" | 8 #include "base/threading/thread_task_runner_handle.h" |
| 9 #include "cc/layers/append_quads_data.h" | 9 #include "cc/layers/append_quads_data.h" |
| 10 #include "cc/quads/draw_quad.h" | 10 #include "cc/quads/draw_quad.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 void SetupDrawPropertiesAndUpdateTiles(TestablePictureImageLayerImpl* layer, | 82 void SetupDrawPropertiesAndUpdateTiles(TestablePictureImageLayerImpl* layer, |
| 83 float ideal_contents_scale, | 83 float ideal_contents_scale, |
| 84 float device_scale_factor, | 84 float device_scale_factor, |
| 85 float page_scale_factor, | 85 float page_scale_factor, |
| 86 float maximum_animation_contents_scale, | 86 float maximum_animation_contents_scale, |
| 87 bool animating_transform_to_screen, | 87 bool animating_transform_to_screen, |
| 88 gfx::Rect viewport_rect) { | 88 gfx::Rect viewport_rect) { |
| 89 gfx::Transform scale_transform; | 89 gfx::Transform scale_transform; |
| 90 scale_transform.Scale(ideal_contents_scale, ideal_contents_scale); | 90 scale_transform.Scale(ideal_contents_scale, ideal_contents_scale); |
| 91 layer->draw_properties().target_space_transform = scale_transform; | 91 layer->draw_properties().screen_space_transform = scale_transform; |
| 92 layer->set_is_drawn_render_surface_layer_list_member(true); | 92 layer->set_is_drawn_render_surface_layer_list_member(true); |
| 93 DCHECK_EQ(layer->GetIdealContentsScale(), ideal_contents_scale); | 93 DCHECK_EQ(layer->GetIdealContentsScale(), ideal_contents_scale); |
| 94 layer->draw_properties().maximum_animation_contents_scale = | 94 layer->draw_properties().maximum_animation_contents_scale = |
| 95 maximum_animation_contents_scale; | 95 maximum_animation_contents_scale; |
| 96 layer->draw_properties().screen_space_transform_is_animating = | 96 layer->draw_properties().screen_space_transform_is_animating = |
| 97 animating_transform_to_screen; | 97 animating_transform_to_screen; |
| 98 layer->draw_properties().visible_layer_rect = viewport_rect; | 98 layer->draw_properties().visible_layer_rect = viewport_rect; |
| 99 layer->UpdateTiles(); | 99 layer->UpdateTiles(); |
| 100 } | 100 } |
| 101 | 101 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 active_layer->DidDraw(nullptr); | 173 active_layer->DidDraw(nullptr); |
| 174 | 174 |
| 175 EXPECT_EQ(DrawQuad::TILED_CONTENT, render_pass->quad_list.front()->material); | 175 EXPECT_EQ(DrawQuad::TILED_CONTENT, render_pass->quad_list.front()->material); |
| 176 | 176 |
| 177 // Tiles are ready at correct scale, so should not set had_incomplete_tile. | 177 // Tiles are ready at correct scale, so should not set had_incomplete_tile. |
| 178 EXPECT_EQ(0, data.num_incomplete_tiles); | 178 EXPECT_EQ(0, data.num_incomplete_tiles); |
| 179 } | 179 } |
| 180 | 180 |
| 181 } // namespace | 181 } // namespace |
| 182 } // namespace cc | 182 } // namespace cc |
| OLD | NEW |