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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 1349913002: Cache gpu suitability in DisplayItemList, remove SetUnsuitable...ForTesting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months 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 side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_host_unittest.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 4e3850febc071865acdb902fafcf1f71c9e845d9..a85549332208dceec35b8302cbf20e5e01efb134 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -4453,7 +4453,7 @@ class LayerTreeHostTestGpuRasterizationEnabled : public LayerTreeHostTest {
EXPECT_TRUE(layer_tree_host()->has_gpu_rasterization_trigger());
// Content-based veto is relevant as well.
- recording_source->SetUnsuitableForGpuRasterizationForTesting();
+ recording_source->SetUnsuitableForGpuRasterization();
EXPECT_FALSE(recording_source->IsSuitableForGpuRasterization());
EXPECT_FALSE(layer->IsSuitableForGpuRasterization());
// Veto will take effect when layers are updated.
@@ -4492,8 +4492,12 @@ class LayerTreeHostTestGpuRasterizationForced : public LayerTreeHostTest {
void SetupTree() override {
LayerTreeHostTest::SetupTree();
+ scoped_ptr<FakeDisplayListRecordingSource> recording_source(
+ new FakeDisplayListRecordingSource(gfx::Size(100, 100)));
scoped_refptr<FakePictureLayer> layer =
- FakePictureLayer::Create(layer_settings(), &layer_client_);
+ FakePictureLayer::CreateWithRecordingSource(
+ layer_settings(), &layer_client_, recording_source.Pass());
+
layer->SetBounds(gfx::Size(10, 10));
layer->SetIsDrawable(true);
layer_tree_host()->root_layer()->AddChild(layer);
@@ -4502,7 +4506,9 @@ class LayerTreeHostTestGpuRasterizationForced : public LayerTreeHostTest {
void BeginTest() override {
Layer* root = layer_tree_host()->root_layer();
PictureLayer* layer = static_cast<PictureLayer*>(root->child_at(0));
- RecordingSource* recording_source = layer->GetRecordingSourceForTesting();
+ FakeDisplayListRecordingSource* recording_source =
danakj 2015/09/16 23:04:49 ditto, store the fake source* on the class and do
pdr. 2015/09/17 20:52:45 Hmm, this one doesn't seem worth it in terms of co
danakj 2015/09/17 21:11:32 OK. I just don't like casts if we can avoid it.
+ static_cast<FakeDisplayListRecordingSource*>(
+ layer->GetRecordingSourceForTesting());
// Verify default values.
EXPECT_TRUE(root->IsSuitableForGpuRasterization());
@@ -4515,7 +4521,7 @@ class LayerTreeHostTestGpuRasterizationForced : public LayerTreeHostTest {
EXPECT_TRUE(layer_tree_host()->has_gpu_rasterization_trigger());
// Content-based veto is irrelevant as well.
- recording_source->SetUnsuitableForGpuRasterizationForTesting();
+ recording_source->SetUnsuitableForGpuRasterization();
EXPECT_FALSE(recording_source->IsSuitableForGpuRasterization());
EXPECT_FALSE(layer->IsSuitableForGpuRasterization());
// Veto will take effect when layers are updated.
« cc/test/fake_display_list_recording_source.h ('K') | « cc/test/fake_display_list_recording_source.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698