| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 2353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2364 }; | 2364 }; |
| 2365 | 2365 |
| 2366 TEST_F(CheckerImagingTileManagerTest, | 2366 TEST_F(CheckerImagingTileManagerTest, |
| 2367 NoImageDecodeDependencyForCheckeredTiles) { | 2367 NoImageDecodeDependencyForCheckeredTiles) { |
| 2368 const gfx::Size layer_bounds(512, 512); | 2368 const gfx::Size layer_bounds(512, 512); |
| 2369 SetupDefaultTrees(layer_bounds); | 2369 SetupDefaultTrees(layer_bounds); |
| 2370 | 2370 |
| 2371 std::unique_ptr<FakeRecordingSource> recording_source = | 2371 std::unique_ptr<FakeRecordingSource> recording_source = |
| 2372 FakeRecordingSource::CreateFilledRecordingSource(layer_bounds); | 2372 FakeRecordingSource::CreateFilledRecordingSource(layer_bounds); |
| 2373 recording_source->set_fill_with_nonsolid_color(true); | 2373 recording_source->set_fill_with_nonsolid_color(true); |
| 2374 recording_source->SetGenerateDiscardableImagesMetadata(true); | |
| 2375 | 2374 |
| 2376 sk_sp<SkImage> image = SkImage::MakeFromGenerator( | 2375 sk_sp<SkImage> image = SkImage::MakeFromGenerator( |
| 2377 base::MakeUnique<testing::StrictMock<MockImageGenerator>>( | 2376 base::MakeUnique<testing::StrictMock<MockImageGenerator>>( |
| 2378 gfx::Size(512, 512))); | 2377 gfx::Size(512, 512))); |
| 2379 recording_source->add_draw_image(image, gfx::Point(0, 0)); | 2378 recording_source->add_draw_image(image, gfx::Point(0, 0)); |
| 2380 | 2379 |
| 2381 recording_source->Rerecord(); | 2380 recording_source->Rerecord(); |
| 2382 scoped_refptr<RasterSource> raster_source = | 2381 scoped_refptr<RasterSource> raster_source = |
| 2383 RasterSource::CreateFromRecordingSource(recording_source.get(), false); | 2382 RasterSource::CreateFromRecordingSource(recording_source.get(), false); |
| 2384 | 2383 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 2406 base::RunLoop().RunUntilIdle(); | 2405 base::RunLoop().RunUntilIdle(); |
| 2407 EXPECT_FALSE(host_impl()->tile_manager()->HasScheduledTileTasksForTesting()); | 2406 EXPECT_FALSE(host_impl()->tile_manager()->HasScheduledTileTasksForTesting()); |
| 2408 } | 2407 } |
| 2409 | 2408 |
| 2410 TEST_F(CheckerImagingTileManagerTest, BuildsImageDecodeQueueAsExpected) { | 2409 TEST_F(CheckerImagingTileManagerTest, BuildsImageDecodeQueueAsExpected) { |
| 2411 const gfx::Size layer_bounds(900, 900); | 2410 const gfx::Size layer_bounds(900, 900); |
| 2412 | 2411 |
| 2413 std::unique_ptr<FakeRecordingSource> recording_source = | 2412 std::unique_ptr<FakeRecordingSource> recording_source = |
| 2414 FakeRecordingSource::CreateFilledRecordingSource(layer_bounds); | 2413 FakeRecordingSource::CreateFilledRecordingSource(layer_bounds); |
| 2415 recording_source->set_fill_with_nonsolid_color(true); | 2414 recording_source->set_fill_with_nonsolid_color(true); |
| 2416 recording_source->SetGenerateDiscardableImagesMetadata(true); | |
| 2417 | 2415 |
| 2418 int dimension = 450; | 2416 int dimension = 450; |
| 2419 sk_sp<SkImage> image1 = | 2417 sk_sp<SkImage> image1 = |
| 2420 CreateDiscardableImage(gfx::Size(dimension, dimension)); | 2418 CreateDiscardableImage(gfx::Size(dimension, dimension)); |
| 2421 sk_sp<SkImage> image2 = | 2419 sk_sp<SkImage> image2 = |
| 2422 CreateDiscardableImage(gfx::Size(dimension, dimension)); | 2420 CreateDiscardableImage(gfx::Size(dimension, dimension)); |
| 2423 sk_sp<SkImage> image3 = | 2421 sk_sp<SkImage> image3 = |
| 2424 CreateDiscardableImage(gfx::Size(dimension, dimension)); | 2422 CreateDiscardableImage(gfx::Size(dimension, dimension)); |
| 2425 recording_source->add_draw_image(image1, gfx::Point(0, 0)); | 2423 recording_source->add_draw_image(image1, gfx::Point(0, 0)); |
| 2426 recording_source->add_draw_image(image2, gfx::Point(600, 0)); | 2424 recording_source->add_draw_image(image2, gfx::Point(600, 0)); |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2579 new_settings, task_runner_provider, task_graph_runner); | 2577 new_settings, task_runner_provider, task_graph_runner); |
| 2580 } | 2578 } |
| 2581 }; | 2579 }; |
| 2582 | 2580 |
| 2583 TEST_F(CheckerImagingTileManagerMemoryTest, AddsAllNowTilesToImageDecodeQueue) { | 2581 TEST_F(CheckerImagingTileManagerMemoryTest, AddsAllNowTilesToImageDecodeQueue) { |
| 2584 const gfx::Size layer_bounds(900, 1400); | 2582 const gfx::Size layer_bounds(900, 1400); |
| 2585 | 2583 |
| 2586 std::unique_ptr<FakeRecordingSource> recording_source = | 2584 std::unique_ptr<FakeRecordingSource> recording_source = |
| 2587 FakeRecordingSource::CreateFilledRecordingSource(layer_bounds); | 2585 FakeRecordingSource::CreateFilledRecordingSource(layer_bounds); |
| 2588 recording_source->set_fill_with_nonsolid_color(true); | 2586 recording_source->set_fill_with_nonsolid_color(true); |
| 2589 recording_source->SetGenerateDiscardableImagesMetadata(true); | |
| 2590 | 2587 |
| 2591 int dimension = 450; | 2588 int dimension = 450; |
| 2592 sk_sp<SkImage> image1 = | 2589 sk_sp<SkImage> image1 = |
| 2593 CreateDiscardableImage(gfx::Size(dimension, dimension)); | 2590 CreateDiscardableImage(gfx::Size(dimension, dimension)); |
| 2594 sk_sp<SkImage> image2 = | 2591 sk_sp<SkImage> image2 = |
| 2595 CreateDiscardableImage(gfx::Size(dimension, dimension)); | 2592 CreateDiscardableImage(gfx::Size(dimension, dimension)); |
| 2596 recording_source->add_draw_image(image1, gfx::Point(0, 515)); | 2593 recording_source->add_draw_image(image1, gfx::Point(0, 515)); |
| 2597 recording_source->add_draw_image(image2, gfx::Point(515, 515)); | 2594 recording_source->add_draw_image(image2, gfx::Point(515, 515)); |
| 2598 | 2595 |
| 2599 recording_source->Rerecord(); | 2596 recording_source->Rerecord(); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2651 EXPECT_TRUE(tile); | 2648 EXPECT_TRUE(tile); |
| 2652 else | 2649 else |
| 2653 EXPECT_FALSE(tile); | 2650 EXPECT_FALSE(tile); |
| 2654 } | 2651 } |
| 2655 } | 2652 } |
| 2656 host_impl()->client()->reset_did_request_impl_side_invalidation(); | 2653 host_impl()->client()->reset_did_request_impl_side_invalidation(); |
| 2657 } | 2654 } |
| 2658 | 2655 |
| 2659 } // namespace | 2656 } // namespace |
| 2660 } // namespace cc | 2657 } // namespace cc |
| OLD | NEW |