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

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

Issue 666273002: cc: Added raster source. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: thread safe Created 6 years, 2 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
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"
11 #include "cc/test/fake_layer_tree_host_impl.h" 11 #include "cc/test/fake_layer_tree_host_impl.h"
12 #include "cc/test/fake_output_surface.h" 12 #include "cc/test/fake_output_surface.h"
13 #include "cc/test/fake_picture_layer_tiling_client.h" 13 #include "cc/test/fake_picture_layer_tiling_client.h"
14 #include "cc/test/fake_picture_pile_impl.h"
14 #include "cc/test/impl_side_painting_settings.h" 15 #include "cc/test/impl_side_painting_settings.h"
15 #include "cc/test/test_shared_bitmap_manager.h" 16 #include "cc/test/test_shared_bitmap_manager.h"
16 #include "cc/trees/layer_tree_impl.h" 17 #include "cc/trees/layer_tree_impl.h"
17 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
18 19
19 namespace cc { 20 namespace cc {
20 namespace { 21 namespace {
21 22
22 class TestablePictureImageLayerImpl : public PictureImageLayerImpl { 23 class TestablePictureImageLayerImpl : public PictureImageLayerImpl {
23 public: 24 public:
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 break; 58 break;
58 case NUM_TREES: 59 case NUM_TREES:
59 NOTREACHED(); 60 NOTREACHED();
60 break; 61 break;
61 } 62 }
62 TestablePictureImageLayerImpl* layer = 63 TestablePictureImageLayerImpl* layer =
63 new TestablePictureImageLayerImpl(tree, id); 64 new TestablePictureImageLayerImpl(tree, id);
64 layer->SetBounds(gfx::Size(100, 200)); 65 layer->SetBounds(gfx::Size(100, 200));
65 layer->SetContentBounds(gfx::Size(100, 200)); 66 layer->SetContentBounds(gfx::Size(100, 200));
66 layer->tilings_.reset(new PictureLayerTilingSet(&tiling_client_)); 67 layer->tilings_.reset(new PictureLayerTilingSet(&tiling_client_));
67 layer->pile_ = tiling_client_.GetPile(); 68 layer->pile_ = FakePicturePileImpl::CreateInfiniteFilledPile();
68 return make_scoped_ptr(layer); 69 return make_scoped_ptr(layer);
69 } 70 }
70 71
71 void SetupDrawPropertiesAndUpdateTiles(TestablePictureImageLayerImpl* layer, 72 void SetupDrawPropertiesAndUpdateTiles(TestablePictureImageLayerImpl* layer,
72 float ideal_contents_scale, 73 float ideal_contents_scale,
73 float device_scale_factor, 74 float device_scale_factor,
74 float page_scale_factor, 75 float page_scale_factor,
75 float maximum_animation_contents_scale, 76 float maximum_animation_contents_scale,
76 bool animating_transform_to_screen) { 77 bool animating_transform_to_screen) {
77 layer->draw_properties().ideal_contents_scale = ideal_contents_scale; 78 layer->draw_properties().ideal_contents_scale = ideal_contents_scale;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 active_layer->DidDraw(nullptr); 153 active_layer->DidDraw(nullptr);
153 154
154 EXPECT_EQ(DrawQuad::TILED_CONTENT, render_pass->quad_list.front()->material); 155 EXPECT_EQ(DrawQuad::TILED_CONTENT, render_pass->quad_list.front()->material);
155 156
156 // 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.
157 EXPECT_EQ(0, data.num_incomplete_tiles); 158 EXPECT_EQ(0, data.num_incomplete_tiles);
158 } 159 }
159 160
160 } // namespace 161 } // namespace
161 } // namespace cc 162 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698