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

Unified Diff: cc/layers/picture_layer_unittest.cc

Issue 1361663003: Revert of 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
« no previous file with comments | « no previous file | cc/playback/display_item_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_unittest.cc
diff --git a/cc/layers/picture_layer_unittest.cc b/cc/layers/picture_layer_unittest.cc
index bef73ee1f46c4ac0536f16132cd4fe25b4e1595e..fe2bcb2b98d1fd6a0d7f3c30331148ec19429948 100644
--- a/cc/layers/picture_layer_unittest.cc
+++ b/cc/layers/picture_layer_unittest.cc
@@ -8,7 +8,6 @@
#include "cc/layers/content_layer_client.h"
#include "cc/layers/picture_layer_impl.h"
#include "cc/playback/display_item_list_settings.h"
-#include "cc/test/fake_display_list_recording_source.h"
#include "cc/test/fake_layer_tree_host.h"
#include "cc/test/fake_picture_layer.h"
#include "cc/test/fake_picture_layer_impl.h"
@@ -79,36 +78,22 @@
}
TEST(PictureLayerTest, SuitableForGpuRasterization) {
- scoped_ptr<FakeDisplayListRecordingSource> recording_source_owned(
- new FakeDisplayListRecordingSource(gfx::Size(100, 100)));
- FakeDisplayListRecordingSource* recording_source =
- recording_source_owned.get();
-
MockContentLayerClient client;
- scoped_refptr<FakePictureLayer> layer =
- FakePictureLayer::CreateWithRecordingSource(
- LayerSettings(), &client, recording_source_owned.Pass());
-
+ scoped_refptr<PictureLayer> layer =
+ PictureLayer::Create(LayerSettings(), &client);
FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D);
TestTaskGraphRunner task_graph_runner;
scoped_ptr<FakeLayerTreeHost> host =
FakeLayerTreeHost::Create(&host_client, &task_graph_runner);
host->SetRootLayer(layer);
-
- // Update layers to initialize the recording source.
- gfx::Size layer_bounds(200, 200);
- gfx::Rect layer_rect(layer_bounds);
- Region invalidation(layer_rect);
- recording_source->UpdateAndExpandInvalidation(
- &client, &invalidation, layer_bounds, layer_rect, 1,
- RecordingSource::RECORD_NORMALLY);
+ RecordingSource* recording_source = layer->GetRecordingSourceForTesting();
// Layer is suitable for gpu rasterization by default.
EXPECT_TRUE(recording_source->IsSuitableForGpuRasterization());
EXPECT_TRUE(layer->IsSuitableForGpuRasterization());
// Veto gpu rasterization.
- recording_source->SetUnsuitableForGpuRasterization();
+ recording_source->SetUnsuitableForGpuRasterizationForTesting();
EXPECT_FALSE(recording_source->IsSuitableForGpuRasterization());
EXPECT_FALSE(layer->IsSuitableForGpuRasterization());
}
« no previous file with comments | « no previous file | cc/playback/display_item_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698