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

Side by Side Diff: cc/tiles/picture_layer_tiling_set_unittest.cc

Issue 2337913003: Fork cc::OutputSurface into cc::CompositorFrameSink. (Closed)
Patch Set: cfsfork: android-vulkan Created 4 years, 3 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/test/test_layer_tree_host_base.cc ('k') | cc/tiles/tile_manager_perftest.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 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/tiles/picture_layer_tiling_set.h" 5 #include "cc/tiles/picture_layer_tiling_set.h"
6 6
7 #include <map> 7 #include <map>
8 #include <vector> 8 #include <vector>
9 9
10 #include "cc/resources/resource_provider.h" 10 #include "cc/resources/resource_provider.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 EXPECT_EQ(0u, lower_than_low_res_range.end - lower_than_low_res_range.start); 230 EXPECT_EQ(0u, lower_than_low_res_range.end - lower_than_low_res_range.start);
231 } 231 }
232 232
233 class PictureLayerTilingSetTestWithResources : public testing::Test { 233 class PictureLayerTilingSetTestWithResources : public testing::Test {
234 public: 234 public:
235 void RunTest(int num_tilings, 235 void RunTest(int num_tilings,
236 float min_scale, 236 float min_scale,
237 float scale_increment, 237 float scale_increment,
238 float ideal_contents_scale, 238 float ideal_contents_scale,
239 float expected_scale) { 239 float expected_scale) {
240 FakeOutputSurfaceClient output_surface_client; 240 scoped_refptr<TestContextProvider> context_provider =
241 std::unique_ptr<FakeOutputSurface> output_surface = 241 TestContextProvider::Create();
242 FakeOutputSurface::CreateDelegating3d(); 242 ASSERT_TRUE(context_provider->BindToCurrentThread());
243 CHECK(output_surface->BindToClient(&output_surface_client)); 243 auto shared_bitmap_manager = base::MakeUnique<TestSharedBitmapManager>();
244
245 std::unique_ptr<SharedBitmapManager> shared_bitmap_manager(
246 new TestSharedBitmapManager());
247 std::unique_ptr<ResourceProvider> resource_provider = 244 std::unique_ptr<ResourceProvider> resource_provider =
248 FakeResourceProvider::Create(output_surface.get(), 245 FakeResourceProvider::Create(context_provider.get(),
249 shared_bitmap_manager.get()); 246 shared_bitmap_manager.get());
250 247
251 FakePictureLayerTilingClient client(resource_provider.get()); 248 FakePictureLayerTilingClient client(resource_provider.get());
252 client.SetTileSize(gfx::Size(256, 256)); 249 client.SetTileSize(gfx::Size(256, 256));
253 gfx::Size layer_bounds(1000, 800); 250 gfx::Size layer_bounds(1000, 800);
254 std::unique_ptr<TestablePictureLayerTilingSet> set = 251 std::unique_ptr<TestablePictureLayerTilingSet> set =
255 CreateTilingSet(&client); 252 CreateTilingSet(&client);
256 scoped_refptr<FakeRasterSource> raster_source = 253 scoped_refptr<FakeRasterSource> raster_source =
257 FakeRasterSource::CreateFilled(layer_bounds); 254 FakeRasterSource::CreateFilled(layer_bounds);
258 255
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 979
983 // This will invalidate tilings. 980 // This will invalidate tilings.
984 tiling_set->UpdateRasterSourceDueToLCDChange(raster_source, Region()); 981 tiling_set->UpdateRasterSourceDueToLCDChange(raster_source, Region());
985 982
986 EXPECT_TRUE( 983 EXPECT_TRUE(
987 tiling_set->UpdateTilePriorities(viewport, 1.f, time, Occlusion(), true)); 984 tiling_set->UpdateTilePriorities(viewport, 1.f, time, Occlusion(), true));
988 } 985 }
989 986
990 } // namespace 987 } // namespace
991 } // namespace cc 988 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/test_layer_tree_host_base.cc ('k') | cc/tiles/tile_manager_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698