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

Unified Diff: cc/layers/heads_up_display_layer_impl_unittest.cc

Issue 1544103002: Determine a layer's IsAffectedByPageScale property without using Layer Tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moving in_subtree_of_page_scale_layer assignment from BuildPropertyTreesInternal to AddTransformNod… Created 5 years 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/layers/layer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/heads_up_display_layer_impl_unittest.cc
diff --git a/cc/layers/heads_up_display_layer_impl_unittest.cc b/cc/layers/heads_up_display_layer_impl_unittest.cc
index e104c33d061fc6ae873c8b70971bf16ce6cb8c28..15357873c4e8082966f5c92557e30e149c376256 100644
--- a/cc/layers/heads_up_display_layer_impl_unittest.cc
+++ b/cc/layers/heads_up_display_layer_impl_unittest.cc
@@ -11,6 +11,7 @@
#include "cc/test/fake_output_surface.h"
#include "cc/test/test_shared_bitmap_manager.h"
#include "cc/test/test_task_graph_runner.h"
+#include "cc/trees/layer_tree_impl.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace cc {
@@ -46,16 +47,19 @@ TEST(HeadsUpDisplayLayerImplTest, ResourcelessSoftwareDrawAfterResourceLoss) {
HeadsUpDisplayLayerImpl::Create(host_impl.pending_tree(), 1);
layer->SetBounds(gfx::Size(100, 100));
+ HeadsUpDisplayLayerImpl* layer_ptr = layer.get();
+
+ host_impl.pending_tree()->SetRootLayer(std::move(layer));
+ host_impl.pending_tree()->BuildPropertyTreesForTesting();
+
// Check regular hardware draw is ok.
- CheckDrawLayer(
- layer.get(), host_impl.resource_provider(), DRAW_MODE_HARDWARE);
+ CheckDrawLayer(layer_ptr, host_impl.resource_provider(), DRAW_MODE_HARDWARE);
// Simulate a resource loss on transitioning to resourceless software mode.
- layer->ReleaseResources();
+ layer_ptr->ReleaseResources();
// Should skip resourceless software draw and not crash in UpdateHudTexture.
- CheckDrawLayer(layer.get(),
- host_impl.resource_provider(),
+ CheckDrawLayer(layer_ptr, host_impl.resource_provider(),
DRAW_MODE_RESOURCELESS_SOFTWARE);
}
« no previous file with comments | « no previous file | cc/layers/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698