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

Unified Diff: cc/layers/picture_image_layer_unittest.cc

Issue 1835523002: cc: Add LayerTreeSetting to disable cached picture raster. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use LayerTreeSettings for cached picture raster. Created 4 years, 9 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 | « cc/layers/picture_image_layer.cc ('k') | cc/proto/layer_tree_settings.proto » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_image_layer_unittest.cc
diff --git a/cc/layers/picture_image_layer_unittest.cc b/cc/layers/picture_image_layer_unittest.cc
index a20073122b66a0b577f05c36a2dfa375a20466e4..fb5c482b827b73f3f47658c8f129a4b3da166d06 100644
--- a/cc/layers/picture_image_layer_unittest.cc
+++ b/cc/layers/picture_image_layer_unittest.cc
@@ -5,7 +5,9 @@
#include "cc/layers/picture_image_layer.h"
#include "cc/playback/display_item.h"
+#include "cc/test/fake_layer_tree_host.h"
#include "cc/test/skia_common.h"
+#include "cc/test/test_task_graph_runner.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkColor.h"
@@ -17,6 +19,11 @@ namespace {
TEST(PictureImageLayerTest, PaintContentsToDisplayList) {
scoped_refptr<PictureImageLayer> layer = PictureImageLayer::Create();
+ FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DIRECT_3D);
+ TestTaskGraphRunner task_graph_runner;
+ scoped_ptr<FakeLayerTreeHost> host =
+ FakeLayerTreeHost::Create(&client, &task_graph_runner);
+ layer->SetLayerTreeHost(host.get());
gfx::Rect layer_rect(200, 200);
unsigned char image_pixels[4 * 200 * 200] = {0};
@@ -43,6 +50,8 @@ TEST(PictureImageLayerTest, PaintContentsToDisplayList) {
DrawDisplayList(actual_pixels, layer_rect, display_list);
EXPECT_EQ(0, memcmp(actual_pixels, image_pixels, 4 * 200 * 200));
+
+ layer->SetLayerTreeHost(nullptr);
vmpstr 2016/03/29 18:46:05 Do you need this? If not, then please remove.
Khushal 2016/03/29 18:57:52 The Layer must be detached from its host during te
}
} // namespace
« no previous file with comments | « cc/layers/picture_image_layer.cc ('k') | cc/proto/layer_tree_settings.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698