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

Unified Diff: cc/layers/layer_impl_unittest.cc

Issue 817653003: Update from https://crrev.com/309717 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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 | « cc/layers/layer_impl.cc ('k') | cc/layers/layer_position_constraint_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl_unittest.cc
diff --git a/cc/layers/layer_impl_unittest.cc b/cc/layers/layer_impl_unittest.cc
index 7745d9004d32f6d8b1571924953fbb8a7991c3be..7b16710e20556e1b3e9bf01a4649f5d05c52d47f 100644
--- a/cc/layers/layer_impl_unittest.cc
+++ b/cc/layers/layer_impl_unittest.cc
@@ -101,6 +101,7 @@ TEST(LayerImplTest, VerifyLayerChangesAreTrackedProperly) {
std::set<LayerImpl*>* scroll_children = new std::set<LayerImpl*>();
scroll_children->insert(scroll_child);
scroll_children->insert(root);
+ root->SetHasRenderSurface(true);
scoped_ptr<LayerImpl> clip_parent =
LayerImpl::Create(host_impl.active_tree(), 5);
@@ -253,6 +254,7 @@ TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties) {
host_impl.active_tree()->SetRootLayer(
LayerImpl::Create(host_impl.active_tree(), 1));
LayerImpl* root = host_impl.active_tree()->root_layer();
+ root->SetHasRenderSurface(true);
scoped_ptr<LayerImpl> layer_ptr =
LayerImpl::Create(host_impl.active_tree(), 2);
LayerImpl* layer = layer_ptr.get();
@@ -276,6 +278,14 @@ TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties) {
arbitrary_filters.Append(FilterOperation::CreateOpacityFilter(0.5f));
SkXfermode::Mode arbitrary_blend_mode = SkXfermode::kMultiply_Mode;
+ // Render surface functions.
+ VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetHasRenderSurface(true));
+ VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetHasRenderSurface(true));
+ VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetHasRenderSurface(false));
+ // Create a render surface, because we must have a render surface if we have
+ // filters.
+ VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetHasRenderSurface(true));
+
// Related filter functions.
VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetFilters(arbitrary_filters));
VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetFilters(arbitrary_filters));
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/layers/layer_position_constraint_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698