OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 12299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12310 TEST_F(LayerTreeHostImplTest, CheckerImagingTileInvalidation) { | 12310 TEST_F(LayerTreeHostImplTest, CheckerImagingTileInvalidation) { |
12311 LayerTreeSettings settings = DefaultSettings(); | 12311 LayerTreeSettings settings = DefaultSettings(); |
12312 settings.enable_checker_imaging = true; | 12312 settings.enable_checker_imaging = true; |
12313 settings.default_tile_size = gfx::Size(256, 256); | 12313 settings.default_tile_size = gfx::Size(256, 256); |
12314 settings.max_untiled_layer_size = gfx::Size(256, 256); | 12314 settings.max_untiled_layer_size = gfx::Size(256, 256); |
12315 CreateHostImpl(settings, CreateCompositorFrameSink()); | 12315 CreateHostImpl(settings, CreateCompositorFrameSink()); |
12316 gfx::Size layer_size = gfx::Size(750, 750); | 12316 gfx::Size layer_size = gfx::Size(750, 750); |
12317 | 12317 |
12318 std::unique_ptr<FakeRecordingSource> recording_source = | 12318 std::unique_ptr<FakeRecordingSource> recording_source = |
12319 FakeRecordingSource::CreateFilledRecordingSource(layer_size); | 12319 FakeRecordingSource::CreateFilledRecordingSource(layer_size); |
12320 recording_source->SetGenerateDiscardableImagesMetadata(true); | |
12321 sk_sp<SkImage> checkerable_image = | 12320 sk_sp<SkImage> checkerable_image = |
12322 CreateDiscardableImage(gfx::Size(500, 500)); | 12321 CreateDiscardableImage(gfx::Size(500, 500)); |
12323 recording_source->add_draw_image(checkerable_image, gfx::Point(0, 0)); | 12322 recording_source->add_draw_image(checkerable_image, gfx::Point(0, 0)); |
12324 | 12323 |
12325 SkColor non_solid_color = SkColorSetARGB(128, 45, 56, 67); | 12324 SkColor non_solid_color = SkColorSetARGB(128, 45, 56, 67); |
12326 PaintFlags non_solid_flags; | 12325 PaintFlags non_solid_flags; |
12327 non_solid_flags.setColor(non_solid_color); | 12326 non_solid_flags.setColor(non_solid_color); |
12328 recording_source->add_draw_rect_with_flags(gfx::Rect(510, 0, 200, 600), | 12327 recording_source->add_draw_rect_with_flags(gfx::Rect(510, 0, 200, 600), |
12329 non_solid_flags); | 12328 non_solid_flags); |
12330 recording_source->add_draw_rect_with_flags(gfx::Rect(0, 510, 200, 400), | 12329 recording_source->add_draw_rect_with_flags(gfx::Rect(0, 510, 200, 400), |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12378 else | 12377 else |
12379 EXPECT_FALSE(tile->HasRasterTask()); | 12378 EXPECT_FALSE(tile->HasRasterTask()); |
12380 } | 12379 } |
12381 Region expected_invalidation( | 12380 Region expected_invalidation( |
12382 raster_source->GetRectForImage(checkerable_image->uniqueID())); | 12381 raster_source->GetRectForImage(checkerable_image->uniqueID())); |
12383 EXPECT_EQ(expected_invalidation, *(root->GetPendingInvalidation())); | 12382 EXPECT_EQ(expected_invalidation, *(root->GetPendingInvalidation())); |
12384 } | 12383 } |
12385 | 12384 |
12386 } // namespace | 12385 } // namespace |
12387 } // namespace cc | 12386 } // namespace cc |
OLD | NEW |