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

Side by Side Diff: cc/layers/layer_impl_unittest.cc

Issue 1505243003: Revert of Create RenderSurface on Effect Tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@alwayspt
Patch Set: rebase 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 unified diff | Download patch
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/layers/layer_iterator_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/layers/layer_impl.h" 5 #include "cc/layers/layer_impl.h"
6 6
7 #include "cc/animation/mutable_properties.h" 7 #include "cc/animation/mutable_properties.h"
8 #include "cc/layers/painted_scrollbar_layer_impl.h" 8 #include "cc/layers/painted_scrollbar_layer_impl.h"
9 #include "cc/layers/solid_color_scrollbar_layer_impl.h" 9 #include "cc/layers/solid_color_scrollbar_layer_impl.h"
10 #include "cc/output/filter_operation.h" 10 #include "cc/output/filter_operation.h"
11 #include "cc/output/filter_operations.h" 11 #include "cc/output/filter_operations.h"
12 #include "cc/test/animation_test_common.h"
13 #include "cc/test/fake_impl_task_runner_provider.h" 12 #include "cc/test/fake_impl_task_runner_provider.h"
14 #include "cc/test/fake_layer_tree_host_impl.h" 13 #include "cc/test/fake_layer_tree_host_impl.h"
15 #include "cc/test/fake_output_surface.h" 14 #include "cc/test/fake_output_surface.h"
16 #include "cc/test/geometry_test_utils.h" 15 #include "cc/test/geometry_test_utils.h"
17 #include "cc/test/test_shared_bitmap_manager.h" 16 #include "cc/test/test_shared_bitmap_manager.h"
18 #include "cc/test/test_task_graph_runner.h" 17 #include "cc/test/test_task_graph_runner.h"
19 #include "cc/trees/layer_tree_impl.h" 18 #include "cc/trees/layer_tree_impl.h"
20 #include "cc/trees/single_thread_proxy.h" 19 #include "cc/trees/single_thread_proxy.h"
21 #include "cc/trees/tree_synchronizer.h" 20 #include "cc/trees/tree_synchronizer.h"
22 #include "testing/gmock/include/gmock/gmock.h" 21 #include "testing/gmock/include/gmock/gmock.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 gfx::Transform arbitrary_transform; 290 gfx::Transform arbitrary_transform;
292 arbitrary_transform.Scale3d(0.1f, 0.2f, 0.3f); 291 arbitrary_transform.Scale3d(0.1f, 0.2f, 0.3f);
293 FilterOperations arbitrary_filters; 292 FilterOperations arbitrary_filters;
294 arbitrary_filters.Append(FilterOperation::CreateOpacityFilter(0.5f)); 293 arbitrary_filters.Append(FilterOperation::CreateOpacityFilter(0.5f));
295 SkXfermode::Mode arbitrary_blend_mode = SkXfermode::kMultiply_Mode; 294 SkXfermode::Mode arbitrary_blend_mode = SkXfermode::kMultiply_Mode;
296 295
297 // Set layer to draw content so that their draw property by property trees is 296 // Set layer to draw content so that their draw property by property trees is
298 // verified. 297 // verified.
299 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetDrawsContent(true)); 298 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetDrawsContent(true));
300 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer2->SetDrawsContent(true)); 299 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer2->SetDrawsContent(true));
301 // Render surface functions should not trigger update draw properties, because 300 // Render surface functions.
302 // creating render surface is part of update draw properties. 301 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetHasRenderSurface(true));
303 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetHasRenderSurface(true)); 302 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetHasRenderSurface(true));
304 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetHasRenderSurface(false)); 303 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetHasRenderSurface(false));
305 // Create a render surface, because we must have a render surface if we have 304 // Create a render surface, because we must have a render surface if we have
306 // filters. 305 // filters.
307 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetHasRenderSurface(true)); 306 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetHasRenderSurface(true));
308
309 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetForceRenderSurface(true));
310 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetForceRenderSurface(true));
311 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetForceRenderSurface(false));
312 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetForceRenderSurface(false));
313 307
314 // Related filter functions. 308 // Related filter functions.
315 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetFilters(arbitrary_filters)); 309 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetFilters(arbitrary_filters));
316 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetFilters(arbitrary_filters)); 310 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetFilters(arbitrary_filters));
317 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetFilters(FilterOperations())); 311 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetFilters(FilterOperations()));
318 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetFilters(arbitrary_filters)); 312 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetFilters(arbitrary_filters));
319 313
320 // Related scrolling functions. 314 // Related scrolling functions.
321 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetBounds(large_size)); 315 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetBounds(large_size));
322 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetBounds(large_size)); 316 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetBounds(large_size));
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 591
598 pending_layer->PushPropertiesTo(layer()); 592 pending_layer->PushPropertiesTo(layer());
599 593
600 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset()); 594 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset());
601 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(), 595 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(),
602 pending_layer->CurrentScrollOffset()); 596 pending_layer->CurrentScrollOffset());
603 } 597 }
604 598
605 } // namespace 599 } // namespace
606 } // namespace cc 600 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/layers/layer_iterator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698