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 12312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12323 TEST_F(LayerTreeHostImplTest, CheckerImagingTileInvalidation) { | 12323 TEST_F(LayerTreeHostImplTest, CheckerImagingTileInvalidation) { |
12324 LayerTreeSettings settings = DefaultSettings(); | 12324 LayerTreeSettings settings = DefaultSettings(); |
12325 settings.enable_checker_imaging = true; | 12325 settings.enable_checker_imaging = true; |
12326 settings.default_tile_size = gfx::Size(256, 256); | 12326 settings.default_tile_size = gfx::Size(256, 256); |
12327 settings.max_untiled_layer_size = gfx::Size(256, 256); | 12327 settings.max_untiled_layer_size = gfx::Size(256, 256); |
12328 CreateHostImpl(settings, CreateCompositorFrameSink()); | 12328 CreateHostImpl(settings, CreateCompositorFrameSink()); |
12329 gfx::Size layer_size = gfx::Size(750, 750); | 12329 gfx::Size layer_size = gfx::Size(750, 750); |
12330 | 12330 |
12331 std::unique_ptr<FakeRecordingSource> recording_source = | 12331 std::unique_ptr<FakeRecordingSource> recording_source = |
12332 FakeRecordingSource::CreateFilledRecordingSource(layer_size); | 12332 FakeRecordingSource::CreateFilledRecordingSource(layer_size); |
12333 sk_sp<SkImage> checkerable_image = | 12333 PaintImage checkerable_image = PaintImage( |
12334 CreateDiscardableImage(gfx::Size(500, 500)); | 12334 PaintImage::GetNextId(), CreateDiscardableImage(gfx::Size(500, 500))); |
12335 recording_source->add_draw_image(checkerable_image, gfx::Point(0, 0)); | 12335 recording_source->add_draw_image(checkerable_image, gfx::Point(0, 0)); |
12336 | 12336 |
12337 SkColor non_solid_color = SkColorSetARGB(128, 45, 56, 67); | 12337 SkColor non_solid_color = SkColorSetARGB(128, 45, 56, 67); |
12338 PaintFlags non_solid_flags; | 12338 PaintFlags non_solid_flags; |
12339 non_solid_flags.setColor(non_solid_color); | 12339 non_solid_flags.setColor(non_solid_color); |
12340 recording_source->add_draw_rect_with_flags(gfx::Rect(510, 0, 200, 600), | 12340 recording_source->add_draw_rect_with_flags(gfx::Rect(510, 0, 200, 600), |
12341 non_solid_flags); | 12341 non_solid_flags); |
12342 recording_source->add_draw_rect_with_flags(gfx::Rect(0, 510, 200, 400), | 12342 recording_source->add_draw_rect_with_flags(gfx::Rect(0, 510, 200, 400), |
12343 non_solid_flags); | 12343 non_solid_flags); |
12344 recording_source->Rerecord(); | 12344 recording_source->Rerecord(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12384 host_impl_->InvalidateContentOnImplSide(); | 12384 host_impl_->InvalidateContentOnImplSide(); |
12385 pending_tree = host_impl_->pending_tree(); | 12385 pending_tree = host_impl_->pending_tree(); |
12386 root = static_cast<FakePictureLayerImpl*>(*pending_tree->begin()); | 12386 root = static_cast<FakePictureLayerImpl*>(*pending_tree->begin()); |
12387 for (auto* tile : root->tilings()->tiling_at(0)->AllTilesForTesting()) { | 12387 for (auto* tile : root->tilings()->tiling_at(0)->AllTilesForTesting()) { |
12388 if (tile->tiling_i_index() < 2 && tile->tiling_j_index() < 2) | 12388 if (tile->tiling_i_index() < 2 && tile->tiling_j_index() < 2) |
12389 EXPECT_TRUE(tile->HasRasterTask()); | 12389 EXPECT_TRUE(tile->HasRasterTask()); |
12390 else | 12390 else |
12391 EXPECT_FALSE(tile->HasRasterTask()); | 12391 EXPECT_FALSE(tile->HasRasterTask()); |
12392 } | 12392 } |
12393 Region expected_invalidation( | 12393 Region expected_invalidation( |
12394 raster_source->GetRectForImage(checkerable_image->uniqueID())); | 12394 raster_source->GetRectForImage(checkerable_image.stable_id())); |
12395 EXPECT_EQ(expected_invalidation, *(root->GetPendingInvalidation())); | 12395 EXPECT_EQ(expected_invalidation, *(root->GetPendingInvalidation())); |
12396 } | 12396 } |
12397 | 12397 |
12398 } // namespace | 12398 } // namespace |
12399 } // namespace cc | 12399 } // namespace cc |
OLD | NEW |