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

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

Issue 1491033002: Create RenderSurface on Effect Tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@alwayspt
Patch Set: fix for crash 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"
12 #include "cc/test/fake_impl_task_runner_provider.h" 13 #include "cc/test/fake_impl_task_runner_provider.h"
13 #include "cc/test/fake_layer_tree_host_impl.h" 14 #include "cc/test/fake_layer_tree_host_impl.h"
14 #include "cc/test/fake_output_surface.h" 15 #include "cc/test/fake_output_surface.h"
15 #include "cc/test/geometry_test_utils.h" 16 #include "cc/test/geometry_test_utils.h"
16 #include "cc/test/test_shared_bitmap_manager.h" 17 #include "cc/test/test_shared_bitmap_manager.h"
17 #include "cc/test/test_task_graph_runner.h" 18 #include "cc/test/test_task_graph_runner.h"
18 #include "cc/trees/layer_tree_impl.h" 19 #include "cc/trees/layer_tree_impl.h"
19 #include "cc/trees/single_thread_proxy.h" 20 #include "cc/trees/single_thread_proxy.h"
20 #include "cc/trees/tree_synchronizer.h" 21 #include "cc/trees/tree_synchronizer.h"
21 #include "testing/gmock/include/gmock/gmock.h" 22 #include "testing/gmock/include/gmock/gmock.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 gfx::Transform arbitrary_transform; 291 gfx::Transform arbitrary_transform;
291 arbitrary_transform.Scale3d(0.1f, 0.2f, 0.3f); 292 arbitrary_transform.Scale3d(0.1f, 0.2f, 0.3f);
292 FilterOperations arbitrary_filters; 293 FilterOperations arbitrary_filters;
293 arbitrary_filters.Append(FilterOperation::CreateOpacityFilter(0.5f)); 294 arbitrary_filters.Append(FilterOperation::CreateOpacityFilter(0.5f));
294 SkXfermode::Mode arbitrary_blend_mode = SkXfermode::kMultiply_Mode; 295 SkXfermode::Mode arbitrary_blend_mode = SkXfermode::kMultiply_Mode;
295 296
296 // Set layer to draw content so that their draw property by property trees is 297 // Set layer to draw content so that their draw property by property trees is
297 // verified. 298 // verified.
298 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetDrawsContent(true)); 299 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetDrawsContent(true));
299 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer2->SetDrawsContent(true)); 300 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer2->SetDrawsContent(true));
300 // Render surface functions. 301 // Render surface functions should not trigger update draw properties, because
301 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetHasRenderSurface(true)); 302 // creating render surface is part of update draw properties.
302 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetHasRenderSurface(true)); 303 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetHasRenderSurface(true));
303 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetHasRenderSurface(false)); 304 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetHasRenderSurface(false));
304 // Create a render surface, because we must have a render surface if we have 305 // Create a render surface, because we must have a render surface if we have
305 // filters. 306 // filters.
306 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetHasRenderSurface(true)); 307 VERIFY_NO_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));
307 313
308 // Related filter functions. 314 // Related filter functions.
309 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetFilters(arbitrary_filters)); 315 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetFilters(arbitrary_filters));
310 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetFilters(arbitrary_filters)); 316 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetFilters(arbitrary_filters));
311 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetFilters(FilterOperations())); 317 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetFilters(FilterOperations()));
312 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetFilters(arbitrary_filters)); 318 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetFilters(arbitrary_filters));
313 319
314 // Related scrolling functions. 320 // Related scrolling functions.
315 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetBounds(large_size)); 321 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetBounds(large_size));
316 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetBounds(large_size)); 322 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetBounds(large_size));
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 597
592 pending_layer->PushPropertiesTo(layer()); 598 pending_layer->PushPropertiesTo(layer());
593 599
594 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset()); 600 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset());
595 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(), 601 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(),
596 pending_layer->CurrentScrollOffset()); 602 pending_layer->CurrentScrollOffset());
597 } 603 }
598 604
599 } // namespace 605 } // namespace
600 } // namespace cc 606 } // 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