| Index: cc/layers/picture_layer_impl_unittest.cc
|
| diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc
|
| index 26f3be56a23caebd6f0d03a887f10974c5c2ea59..f00b2e45b82f7270d7e412a9f6a338beef887a97 100644
|
| --- a/cc/layers/picture_layer_impl_unittest.cc
|
| +++ b/cc/layers/picture_layer_impl_unittest.cc
|
| @@ -128,8 +128,7 @@ class PictureLayerImplTest : public testing::Test {
|
| active_layer_ = static_cast<FakePictureLayerImpl*>(
|
| host_impl_.active_tree()->LayerById(id_));
|
|
|
| - bool update_lcd_text = false;
|
| - host_impl_.active_tree()->UpdateDrawProperties(update_lcd_text);
|
| + host_impl_.active_tree()->UpdateDrawProperties();
|
| }
|
|
|
| void SetupDefaultTreesWithFixedTileSize(const gfx::Size& layer_bounds,
|
| @@ -224,8 +223,7 @@ class PictureLayerImplTest : public testing::Test {
|
| host_impl_.pending_tree()->LayerById(id_));
|
|
|
| // Add tilings/tiles for the layer.
|
| - bool update_lcd_text = false;
|
| - host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text);
|
| + host_impl_.pending_tree()->UpdateDrawProperties();
|
| }
|
|
|
| void SetupDrawPropertiesAndUpdateTiles(FakePictureLayerImpl* layer,
|
| @@ -433,8 +431,7 @@ TEST_F(PictureLayerImplTest, ExternalViewportRectForPrioritizingTiles) {
|
| viewport_rect_for_tile_priority,
|
| transform_for_tile_priority,
|
| resourceless_software_draw);
|
| - bool update_lcd_text = false;
|
| - host_impl_.active_tree()->UpdateDrawProperties(update_lcd_text);
|
| + host_impl_.active_tree()->UpdateDrawProperties();
|
|
|
| gfx::Rect viewport_rect_for_tile_priority_in_view_space =
|
| viewport_rect_for_tile_priority;
|
| @@ -468,7 +465,7 @@ TEST_F(PictureLayerImplTest, ExternalViewportRectForPrioritizingTiles) {
|
| viewport_rect_for_tile_priority,
|
| transform_for_tile_priority,
|
| resourceless_software_draw);
|
| - host_impl_.active_tree()->UpdateDrawProperties(update_lcd_text);
|
| + host_impl_.active_tree()->UpdateDrawProperties();
|
|
|
| gfx::Transform screen_to_view(gfx::Transform::kSkipInitialization);
|
| bool success = transform_for_tile_priority.GetInverse(&screen_to_view);
|
| @@ -606,8 +603,7 @@ TEST_F(PictureLayerImplTest, ViewportRectForTilePriorityIsCached) {
|
| host_impl_.SetExternalDrawConstraints(
|
| transform, viewport, viewport, viewport_rect_for_tile_priority,
|
| transform_for_tile_priority, resourceless_software_draw);
|
| - bool update_lcd_text = false;
|
| - host_impl_.active_tree()->UpdateDrawProperties(update_lcd_text);
|
| + host_impl_.active_tree()->UpdateDrawProperties();
|
|
|
| EXPECT_EQ(viewport_rect_for_tile_priority,
|
| active_layer_->viewport_rect_for_tile_priority_in_content_space());
|
| @@ -625,7 +621,7 @@ TEST_F(PictureLayerImplTest, ViewportRectForTilePriorityIsCached) {
|
| // should remain to be the previously cached value.
|
| EXPECT_EQ(viewport_rect_for_tile_priority,
|
| active_layer_->viewport_rect_for_tile_priority_in_content_space());
|
| - host_impl_.active_tree()->UpdateDrawProperties(update_lcd_text);
|
| + host_impl_.active_tree()->UpdateDrawProperties();
|
|
|
| // Now the UpdateDrawProperties is called. The viewport rect for tile
|
| // priority should be the latest value.
|
| @@ -1316,8 +1312,7 @@ TEST_F(PictureLayerImplTest, HugeMasksGetScaledDown) {
|
| time_ticks += base::TimeDelta::FromMilliseconds(1);
|
| host_impl_.SetCurrentBeginFrameArgs(
|
| CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks));
|
| - bool update_lcd_text = false;
|
| - host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text);
|
| + host_impl_.pending_tree()->UpdateDrawProperties();
|
|
|
| FakePictureLayerImpl* pending_mask =
|
| static_cast<FakePictureLayerImpl*>(pending_layer_->mask_layer());
|
| @@ -1367,7 +1362,7 @@ TEST_F(PictureLayerImplTest, HugeMasksGetScaledDown) {
|
| time_ticks += base::TimeDelta::FromMilliseconds(1);
|
| host_impl_.SetCurrentBeginFrameArgs(
|
| CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks));
|
| - host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text);
|
| + host_impl_.pending_tree()->UpdateDrawProperties();
|
|
|
| // The mask tiling gets scaled down.
|
| EXPECT_LT(pending_mask->HighResTiling()->contents_scale(), 1.f);
|
| @@ -1423,7 +1418,7 @@ TEST_F(PictureLayerImplTest, HugeMasksGetScaledDown) {
|
| time_ticks += base::TimeDelta::FromMilliseconds(1);
|
| host_impl_.SetCurrentBeginFrameArgs(
|
| CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks));
|
| - host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text);
|
| + host_impl_.pending_tree()->UpdateDrawProperties();
|
|
|
| EXPECT_EQ(0u, pending_mask->num_tilings());
|
| }
|
| @@ -1455,8 +1450,7 @@ TEST_F(PictureLayerImplTest, ScaledMaskLayer) {
|
| time_ticks += base::TimeDelta::FromMilliseconds(1);
|
| host_impl_.SetCurrentBeginFrameArgs(
|
| CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks));
|
| - bool update_lcd_text = false;
|
| - host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text);
|
| + host_impl_.pending_tree()->UpdateDrawProperties();
|
|
|
| FakePictureLayerImpl* pending_mask =
|
| static_cast<FakePictureLayerImpl*>(pending_layer_->mask_layer());
|
| @@ -1777,8 +1771,7 @@ TEST_F(NoLowResPictureLayerImplTest,
|
| time_ticks += base::TimeDelta::FromMilliseconds(1);
|
| host_impl_.SetCurrentBeginFrameArgs(
|
| CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks));
|
| - bool update_lcd_text = false;
|
| - host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text);
|
| + host_impl_.pending_tree()->UpdateDrawProperties();
|
|
|
| // Set visible content rect that is different from
|
| // external_viewport_for_tile_priority.
|
| @@ -1818,7 +1811,7 @@ TEST_F(NoLowResPictureLayerImplTest,
|
|
|
| // Activate and draw active layer.
|
| host_impl_.ActivateSyncTree();
|
| - host_impl_.active_tree()->UpdateDrawProperties(update_lcd_text);
|
| + host_impl_.active_tree()->UpdateDrawProperties();
|
| active_layer_->draw_properties().visible_content_rect = visible_content_rect;
|
|
|
| scoped_ptr<RenderPass> render_pass = RenderPass::Create();
|
| @@ -2422,8 +2415,7 @@ TEST_F(PictureLayerImplTest, SyncTilingAfterGpuRasterizationToggles) {
|
| time_ticks += base::TimeDelta::FromMilliseconds(1);
|
| host_impl_.SetCurrentBeginFrameArgs(
|
| CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks));
|
| - bool update_lcd_text = false;
|
| - host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text);
|
| + host_impl_.pending_tree()->UpdateDrawProperties();
|
| EXPECT_TRUE(pending_layer_->tilings()->FindTilingWithScale(1.f));
|
|
|
| ActivateTree();
|
| @@ -2604,8 +2596,8 @@ class DeferredInitPictureLayerImplTest : public PictureLayerImplTest {
|
| // However, this is also a regression test for PictureLayerImpl in that
|
| // not having this update will cause a crash.
|
| TEST_F(DeferredInitPictureLayerImplTest, PreventUpdateTilesDuringLostContext) {
|
| - host_impl_.pending_tree()->UpdateDrawProperties(true);
|
| - host_impl_.active_tree()->UpdateDrawProperties(false);
|
| + host_impl_.pending_tree()->UpdateDrawProperties();
|
| + host_impl_.active_tree()->UpdateDrawProperties();
|
| EXPECT_FALSE(host_impl_.pending_tree()->needs_update_draw_properties());
|
| EXPECT_FALSE(host_impl_.active_tree()->needs_update_draw_properties());
|
|
|
| @@ -2617,7 +2609,7 @@ TEST_F(DeferredInitPictureLayerImplTest, PreventUpdateTilesDuringLostContext) {
|
| // These will crash PictureLayerImpl if this is not true.
|
| ASSERT_TRUE(host_impl_.pending_tree()->needs_update_draw_properties());
|
| ASSERT_TRUE(host_impl_.active_tree()->needs_update_draw_properties());
|
| - host_impl_.active_tree()->UpdateDrawProperties(false);
|
| + host_impl_.active_tree()->UpdateDrawProperties();
|
| }
|
|
|
| TEST_F(PictureLayerImplTest, HighResTilingDuringAnimationForCpuRasterization) {
|
| @@ -3863,8 +3855,7 @@ TEST_F(PictureLayerImplTestWithDelegatingRenderer,
|
| SetupPendingTree(pending_pile);
|
| pending_layer_->SetBounds(layer_bounds);
|
| ActivateTree();
|
| - bool update_lcd_text = false;
|
| - host_impl_.active_tree()->UpdateDrawProperties(update_lcd_text);
|
| + host_impl_.active_tree()->UpdateDrawProperties();
|
| std::vector<Tile*> tiles =
|
| active_layer_->HighResTiling()->AllTilesForTesting();
|
| host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(tiles);
|
| @@ -3914,7 +3905,7 @@ class OcclusionTrackingPictureLayerImplTest : public PictureLayerImplTest {
|
| WhichTree tree,
|
| size_t expected_occluded_tile_count) {
|
| WhichTree twin_tree = tree == ACTIVE_TREE ? PENDING_TREE : ACTIVE_TREE;
|
| - for (int priority_count = 0; priority_count <= LAST_TREE_PRIORITY;
|
| + for (int priority_count = 0; priority_count < NUM_TREE_PRIORITIES;
|
| ++priority_count) {
|
| TreePriority tree_priority = static_cast<TreePriority>(priority_count);
|
| size_t occluded_tile_count = 0u;
|
| @@ -4015,6 +4006,9 @@ class OcclusionTrackingPictureLayerImplTest : public PictureLayerImplTest {
|
| // eviction queue.
|
| EXPECT_EQ(ACTIVE_TREE, tree);
|
| break;
|
| + case NUM_TREE_PRIORITIES:
|
| + NOTREACHED();
|
| + break;
|
| }
|
| }
|
| queue->Pop();
|
| @@ -4074,8 +4068,7 @@ TEST_F(OcclusionTrackingPictureLayerImplTest,
|
| time_ticks += base::TimeDelta::FromMilliseconds(200);
|
| host_impl_.SetCurrentBeginFrameArgs(
|
| CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks));
|
| - bool update_lcd_text = false;
|
| - host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text);
|
| + host_impl_.pending_tree()->UpdateDrawProperties();
|
|
|
| unoccluded_tile_count = 0;
|
| queue.reset(new TilingSetRasterQueueAll(
|
| @@ -4099,7 +4092,7 @@ TEST_F(OcclusionTrackingPictureLayerImplTest,
|
| time_ticks += base::TimeDelta::FromMilliseconds(200);
|
| host_impl_.SetCurrentBeginFrameArgs(
|
| CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks));
|
| - host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text);
|
| + host_impl_.pending_tree()->UpdateDrawProperties();
|
|
|
| unoccluded_tile_count = 0;
|
| queue.reset(new TilingSetRasterQueueAll(
|
| @@ -4173,8 +4166,7 @@ TEST_F(OcclusionTrackingPictureLayerImplTest,
|
| time_ticks += base::TimeDelta::FromMilliseconds(200);
|
| host_impl_.SetCurrentBeginFrameArgs(
|
| CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks));
|
| - bool update_lcd_text = false;
|
| - host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text);
|
| + host_impl_.pending_tree()->UpdateDrawProperties();
|
|
|
| for (size_t i = 0; i < pending_layer_->num_tilings(); ++i) {
|
| PictureLayerTiling* tiling = pending_layer_->tilings()->tiling_at(i);
|
| @@ -4214,7 +4206,7 @@ TEST_F(OcclusionTrackingPictureLayerImplTest,
|
| time_ticks += base::TimeDelta::FromMilliseconds(200);
|
| host_impl_.SetCurrentBeginFrameArgs(
|
| CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks));
|
| - host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text);
|
| + host_impl_.pending_tree()->UpdateDrawProperties();
|
|
|
| for (size_t i = 0; i < pending_layer_->num_tilings(); ++i) {
|
| PictureLayerTiling* tiling = pending_layer_->tilings()->tiling_at(i);
|
| @@ -4288,8 +4280,7 @@ TEST_F(OcclusionTrackingPictureLayerImplTest, OcclusionForDifferentScales) {
|
| host_impl_.SetCurrentBeginFrameArgs(
|
| CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks));
|
| // UpdateDrawProperties with the occluding layer.
|
| - bool update_lcd_text = false;
|
| - host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text);
|
| + host_impl_.pending_tree()->UpdateDrawProperties();
|
|
|
| EXPECT_EQ(5u, pending_layer_->num_tilings());
|
|
|
| @@ -4488,8 +4479,7 @@ TEST_F(OcclusionTrackingPictureLayerImplTest,
|
| host_impl_.SetCurrentBeginFrameArgs(
|
| CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks));
|
| // UpdateDrawProperties with the occluding layer.
|
| - bool update_lcd_text = false;
|
| - host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text);
|
| + host_impl_.pending_tree()->UpdateDrawProperties();
|
|
|
| // The expected number of occluded tiles on each of the 2 tilings for each of
|
| // the 3 tree priorities.
|
| @@ -4680,11 +4670,11 @@ void PictureLayerImplTest::TestQuadsForSolidColor(bool test_for_solid) {
|
|
|
| Region invalidation(layer_rect);
|
| recording_source->UpdateAndExpandInvalidation(
|
| - &client, &invalidation, layer_bounds, layer_rect, frame_number++,
|
| + &client, &invalidation, false, layer_bounds, layer_rect, frame_number++,
|
| RecordingSource::RECORD_NORMALLY);
|
|
|
| scoped_refptr<RasterSource> pending_raster_source =
|
| - recording_source->CreateRasterSource(true);
|
| + recording_source->CreateRasterSource();
|
|
|
| SetupPendingTreeWithFixedTileSize(pending_raster_source, tile_size, Region());
|
| ActivateTree();
|
| @@ -4743,16 +4733,15 @@ TEST_F(PictureLayerImplTest, NonSolidToSolidNoTilings) {
|
|
|
| Region invalidation1(layer_rect);
|
| recording_source->UpdateAndExpandInvalidation(
|
| - &client, &invalidation1, layer_bounds, layer_rect, frame_number++,
|
| + &client, &invalidation1, false, layer_bounds, layer_rect, frame_number++,
|
| RecordingSource::RECORD_NORMALLY);
|
|
|
| scoped_refptr<RasterSource> raster_source1 =
|
| - recording_source->CreateRasterSource(true);
|
| + recording_source->CreateRasterSource();
|
|
|
| SetupPendingTree(raster_source1);
|
| ActivateTree();
|
| - bool update_lcd_text = false;
|
| - host_impl_.active_tree()->UpdateDrawProperties(update_lcd_text);
|
| + host_impl_.active_tree()->UpdateDrawProperties();
|
|
|
| // We've started with a solid layer that contains some tilings.
|
| ASSERT_TRUE(active_layer_->tilings());
|
| @@ -4762,11 +4751,11 @@ TEST_F(PictureLayerImplTest, NonSolidToSolidNoTilings) {
|
|
|
| Region invalidation2(layer_rect);
|
| recording_source->UpdateAndExpandInvalidation(
|
| - &client, &invalidation2, layer_bounds, layer_rect, frame_number++,
|
| + &client, &invalidation2, false, layer_bounds, layer_rect, frame_number++,
|
| RecordingSource::RECORD_NORMALLY);
|
|
|
| scoped_refptr<RasterSource> raster_source2 =
|
| - recording_source->CreateRasterSource(true);
|
| + recording_source->CreateRasterSource();
|
|
|
| SetupPendingTree(raster_source2);
|
| ActivateTree();
|
|
|