Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(739)

Side by Side Diff: cc/layers/picture_image_layer_impl_unittest.cc

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/painted_scrollbar_layer_impl_unittest.cc ('k') | cc/layers/picture_layer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "cc/layers/append_quads_data.h" 7 #include "cc/layers/append_quads_data.h"
8 #include "cc/quads/draw_quad.h" 8 #include "cc/quads/draw_quad.h"
9 #include "cc/resources/tile_priority.h" 9 #include "cc/resources/tile_priority.h"
10 #include "cc/test/fake_impl_proxy.h" 10 #include "cc/test/fake_impl_proxy.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 gfx::Rect viewport_rect) { 73 gfx::Rect viewport_rect) {
74 layer->draw_properties().ideal_contents_scale = ideal_contents_scale; 74 layer->draw_properties().ideal_contents_scale = ideal_contents_scale;
75 layer->draw_properties().device_scale_factor = device_scale_factor; 75 layer->draw_properties().device_scale_factor = device_scale_factor;
76 layer->draw_properties().page_scale_factor = page_scale_factor; 76 layer->draw_properties().page_scale_factor = page_scale_factor;
77 layer->draw_properties().maximum_animation_contents_scale = 77 layer->draw_properties().maximum_animation_contents_scale =
78 maximum_animation_contents_scale; 78 maximum_animation_contents_scale;
79 layer->draw_properties().screen_space_transform_is_animating = 79 layer->draw_properties().screen_space_transform_is_animating =
80 animating_transform_to_screen; 80 animating_transform_to_screen;
81 layer->draw_properties().visible_content_rect = viewport_rect; 81 layer->draw_properties().visible_content_rect = viewport_rect;
82 bool resourceless_software_draw = false; 82 bool resourceless_software_draw = false;
83 layer->UpdateTiles(Occlusion(), resourceless_software_draw); 83 layer->UpdateTiles(resourceless_software_draw);
84 } 84 }
85 85
86 protected: 86 protected:
87 FakeImplProxy proxy_; 87 FakeImplProxy proxy_;
88 FakeLayerTreeHostImpl host_impl_; 88 FakeLayerTreeHostImpl host_impl_;
89 TestSharedBitmapManager shared_bitmap_manager_; 89 TestSharedBitmapManager shared_bitmap_manager_;
90 }; 90 };
91 91
92 TEST_F(PictureImageLayerImplTest, CalculateContentsScale) { 92 TEST_F(PictureImageLayerImplTest, CalculateContentsScale) {
93 scoped_ptr<TestablePictureImageLayerImpl> layer(CreateLayer(1, PENDING_TREE)); 93 scoped_ptr<TestablePictureImageLayerImpl> layer(CreateLayer(1, PENDING_TREE));
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 EXPECT_EQ(1.f, active_layer->tilings()->tiling_at(0)->contents_scale()); 142 EXPECT_EQ(1.f, active_layer->tilings()->tiling_at(0)->contents_scale());
143 143
144 // Create resources for the tiles. 144 // Create resources for the tiles.
145 host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting( 145 host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(
146 active_layer->tilings()->tiling_at(0)->AllTilesForTesting()); 146 active_layer->tilings()->tiling_at(0)->AllTilesForTesting());
147 147
148 // Draw. 148 // Draw.
149 scoped_ptr<RenderPass> render_pass = RenderPass::Create(); 149 scoped_ptr<RenderPass> render_pass = RenderPass::Create();
150 AppendQuadsData data; 150 AppendQuadsData data;
151 active_layer->WillDraw(DRAW_MODE_SOFTWARE, nullptr); 151 active_layer->WillDraw(DRAW_MODE_SOFTWARE, nullptr);
152 active_layer->AppendQuads(render_pass.get(), Occlusion(), &data); 152 active_layer->AppendQuads(render_pass.get(), &data);
153 active_layer->DidDraw(nullptr); 153 active_layer->DidDraw(nullptr);
154 154
155 EXPECT_EQ(DrawQuad::TILED_CONTENT, render_pass->quad_list.front()->material); 155 EXPECT_EQ(DrawQuad::TILED_CONTENT, render_pass->quad_list.front()->material);
156 156
157 // Tiles are ready at correct scale, so should not set had_incomplete_tile. 157 // Tiles are ready at correct scale, so should not set had_incomplete_tile.
158 EXPECT_EQ(0, data.num_incomplete_tiles); 158 EXPECT_EQ(0, data.num_incomplete_tiles);
159 } 159 }
160 160
161 } // namespace 161 } // namespace
162 } // namespace cc 162 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/painted_scrollbar_layer_impl_unittest.cc ('k') | cc/layers/picture_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698