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

Side by Side Diff: cc/layers/picture_layer_impl_unittest.cc

Issue 684653004: Plumb can_use_lcd_text, contents_opaque directly to ContentLayerClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
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 "cc/layers/picture_layer_impl.h" 5 #include "cc/layers/picture_layer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 4482 matching lines...) Expand 10 before | Expand all | Expand 10 after
4493 FakeRenderingStatsInstrumentation stats_instrumentation; 4493 FakeRenderingStatsInstrumentation stats_instrumentation;
4494 4494
4495 client.set_fill_with_nonsolid_color(!test_for_solid); 4495 client.set_fill_with_nonsolid_color(!test_for_solid);
4496 4496
4497 Region invalidation(layer_rect); 4497 Region invalidation(layer_rect);
4498 pile->UpdateAndExpandInvalidation(&client, 4498 pile->UpdateAndExpandInvalidation(&client,
4499 &invalidation, 4499 &invalidation,
4500 SK_ColorWHITE, 4500 SK_ColorWHITE,
4501 false, 4501 false,
4502 false, 4502 false,
4503 false,
4503 layer_bounds, 4504 layer_bounds,
4504 layer_rect, 4505 layer_rect,
4505 frame_number++, 4506 frame_number++,
4506 Picture::RECORD_NORMALLY, 4507 Picture::RECORD_NORMALLY,
4507 &stats_instrumentation); 4508 &stats_instrumentation);
4508 4509
4509 scoped_refptr<PicturePileImpl> pending_pile = 4510 scoped_refptr<PicturePileImpl> pending_pile =
4510 PicturePileImpl::CreateFromOther(pile); 4511 PicturePileImpl::CreateFromOther(pile);
4511 4512
4512 SetupPendingTree(pending_pile); 4513 SetupPendingTree(pending_pile);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
4568 FakeRenderingStatsInstrumentation stats_instrumentation; 4569 FakeRenderingStatsInstrumentation stats_instrumentation;
4569 4570
4570 client.set_fill_with_nonsolid_color(true); 4571 client.set_fill_with_nonsolid_color(true);
4571 4572
4572 Region invalidation1(layer_rect); 4573 Region invalidation1(layer_rect);
4573 pile->UpdateAndExpandInvalidation(&client, 4574 pile->UpdateAndExpandInvalidation(&client,
4574 &invalidation1, 4575 &invalidation1,
4575 SK_ColorWHITE, 4576 SK_ColorWHITE,
4576 false, 4577 false,
4577 false, 4578 false,
4579 false,
4578 layer_bounds, 4580 layer_bounds,
4579 layer_rect, 4581 layer_rect,
4580 frame_number++, 4582 frame_number++,
4581 Picture::RECORD_NORMALLY, 4583 Picture::RECORD_NORMALLY,
4582 &stats_instrumentation); 4584 &stats_instrumentation);
4583 4585
4584 scoped_refptr<PicturePileImpl> pending_pile1 = 4586 scoped_refptr<PicturePileImpl> pending_pile1 =
4585 PicturePileImpl::CreateFromOther(pile); 4587 PicturePileImpl::CreateFromOther(pile);
4586 4588
4587 SetupPendingTree(pending_pile1); 4589 SetupPendingTree(pending_pile1);
4588 ActivateTree(); 4590 ActivateTree();
4589 host_impl_.active_tree()->UpdateDrawProperties(); 4591 host_impl_.active_tree()->UpdateDrawProperties();
4590 4592
4591 // We've started with a solid layer that contains some tilings. 4593 // We've started with a solid layer that contains some tilings.
4592 ASSERT_TRUE(active_layer_->tilings()); 4594 ASSERT_TRUE(active_layer_->tilings());
4593 EXPECT_NE(0u, active_layer_->tilings()->num_tilings()); 4595 EXPECT_NE(0u, active_layer_->tilings()->num_tilings());
4594 4596
4595 client.set_fill_with_nonsolid_color(false); 4597 client.set_fill_with_nonsolid_color(false);
4596 4598
4597 Region invalidation2(layer_rect); 4599 Region invalidation2(layer_rect);
4598 pile->UpdateAndExpandInvalidation(&client, 4600 pile->UpdateAndExpandInvalidation(&client,
4599 &invalidation2, 4601 &invalidation2,
4600 SK_ColorWHITE, 4602 SK_ColorWHITE,
4601 false, 4603 false,
4602 false, 4604 false,
4605 false,
4603 layer_bounds, 4606 layer_bounds,
4604 layer_rect, 4607 layer_rect,
4605 frame_number++, 4608 frame_number++,
4606 Picture::RECORD_NORMALLY, 4609 Picture::RECORD_NORMALLY,
4607 &stats_instrumentation); 4610 &stats_instrumentation);
4608 4611
4609 scoped_refptr<PicturePileImpl> pending_pile2 = 4612 scoped_refptr<PicturePileImpl> pending_pile2 =
4610 PicturePileImpl::CreateFromOther(pile); 4613 PicturePileImpl::CreateFromOther(pile);
4611 4614
4612 SetupPendingTree(pending_pile2); 4615 SetupPendingTree(pending_pile2);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
4736 result = layer->CalculateTileSize(gfx::Size(447, 400)); 4739 result = layer->CalculateTileSize(gfx::Size(447, 400));
4737 EXPECT_EQ(result.width(), 448); 4740 EXPECT_EQ(result.width(), 448);
4738 EXPECT_EQ(result.height(), 448); 4741 EXPECT_EQ(result.height(), 448);
4739 result = layer->CalculateTileSize(gfx::Size(500, 499)); 4742 result = layer->CalculateTileSize(gfx::Size(500, 499));
4740 EXPECT_EQ(result.width(), 512); 4743 EXPECT_EQ(result.width(), 512);
4741 EXPECT_EQ(result.height(), 500 + 2); 4744 EXPECT_EQ(result.height(), 500 + 2);
4742 } 4745 }
4743 4746
4744 } // namespace 4747 } // namespace
4745 } // namespace cc 4748 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698