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

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

Issue 2706453003: switch to new ImageGenerator API (Closed)
Patch Set: fix new site in tile_manager_unittest.cc Created 3 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/test/skia_common.cc ('k') | content/renderer/render_thread_impl.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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 2334 matching lines...) Expand 10 before | Expand all | Expand 10 after
2345 TEST_F(CheckerImagingTileManagerTest, 2345 TEST_F(CheckerImagingTileManagerTest,
2346 NoImageDecodeDependencyForCheckeredTiles) { 2346 NoImageDecodeDependencyForCheckeredTiles) {
2347 const gfx::Size layer_bounds(512, 512); 2347 const gfx::Size layer_bounds(512, 512);
2348 SetupDefaultTrees(layer_bounds); 2348 SetupDefaultTrees(layer_bounds);
2349 2349
2350 std::unique_ptr<FakeRecordingSource> recording_source = 2350 std::unique_ptr<FakeRecordingSource> recording_source =
2351 FakeRecordingSource::CreateFilledRecordingSource(layer_bounds); 2351 FakeRecordingSource::CreateFilledRecordingSource(layer_bounds);
2352 recording_source->SetGenerateDiscardableImagesMetadata(true); 2352 recording_source->SetGenerateDiscardableImagesMetadata(true);
2353 2353
2354 sk_sp<SkImage> image = SkImage::MakeFromGenerator( 2354 sk_sp<SkImage> image = SkImage::MakeFromGenerator(
2355 new testing::StrictMock<MockImageGenerator>(gfx::Size(512, 512))); 2355 base::MakeUnique<testing::StrictMock<MockImageGenerator>>(
2356 gfx::Size(512, 512)));
2356 recording_source->add_draw_image(image, gfx::Point(0, 0)); 2357 recording_source->add_draw_image(image, gfx::Point(0, 0));
2357 2358
2358 recording_source->Rerecord(); 2359 recording_source->Rerecord();
2359 scoped_refptr<RasterSource> raster_source = 2360 scoped_refptr<RasterSource> raster_source =
2360 RasterSource::CreateFromRecordingSource(recording_source.get(), false); 2361 RasterSource::CreateFromRecordingSource(recording_source.get(), false);
2361 2362
2362 std::unique_ptr<PictureLayerImpl> layer_impl = PictureLayerImpl::Create( 2363 std::unique_ptr<PictureLayerImpl> layer_impl = PictureLayerImpl::Create(
2363 host_impl()->active_tree(), 1, Layer::LayerMaskType::NOT_MASK); 2364 host_impl()->active_tree(), 1, Layer::LayerMaskType::NOT_MASK);
2364 layer_impl->set_is_drawn_render_surface_layer_list_member(true); 2365 layer_impl->set_is_drawn_render_surface_layer_list_member(true);
2365 PictureLayerTilingSet* tiling_set = layer_impl->picture_layer_tiling_set(); 2366 PictureLayerTilingSet* tiling_set = layer_impl->picture_layer_tiling_set();
(...skipping 12 matching lines...) Expand all
2378 // a part of raster tasks, the test should fail. 2379 // a part of raster tasks, the test should fail.
2379 host_impl()->tile_manager()->PrepareTiles(host_impl()->global_tile_state()); 2380 host_impl()->tile_manager()->PrepareTiles(host_impl()->global_tile_state());
2380 EXPECT_TRUE(host_impl()->tile_manager()->HasScheduledTileTasksForTesting()); 2381 EXPECT_TRUE(host_impl()->tile_manager()->HasScheduledTileTasksForTesting());
2381 static_cast<SynchronousTaskGraphRunner*>(task_graph_runner())->RunUntilIdle(); 2382 static_cast<SynchronousTaskGraphRunner*>(task_graph_runner())->RunUntilIdle();
2382 base::RunLoop().RunUntilIdle(); 2383 base::RunLoop().RunUntilIdle();
2383 EXPECT_FALSE(host_impl()->tile_manager()->HasScheduledTileTasksForTesting()); 2384 EXPECT_FALSE(host_impl()->tile_manager()->HasScheduledTileTasksForTesting());
2384 } 2385 }
2385 2386
2386 } // namespace 2387 } // namespace
2387 } // namespace cc 2388 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/skia_common.cc ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698