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

Side by Side Diff: cc/trees/layer_tree_host_unittest.cc

Issue 2776473002: Build property trees for the HUD layer when using layer lists (Closed)
Patch Set: Address reviewer comments Created 3 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 unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | no next file » | 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/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
11 11
12 #include "base/auto_reset.h" 12 #include "base/auto_reset.h"
13 #include "base/location.h" 13 #include "base/location.h"
14 #include "base/memory/ptr_util.h" 14 #include "base/memory/ptr_util.h"
15 #include "base/single_thread_task_runner.h" 15 #include "base/single_thread_task_runner.h"
16 #include "base/strings/stringprintf.h" 16 #include "base/strings/stringprintf.h"
17 #include "base/synchronization/lock.h" 17 #include "base/synchronization/lock.h"
18 #include "base/threading/thread_task_runner_handle.h" 18 #include "base/threading/thread_task_runner_handle.h"
19 #include "cc/animation/timing_function.h" 19 #include "cc/animation/timing_function.h"
20 #include "cc/input/scroll_elasticity_helper.h" 20 #include "cc/input/scroll_elasticity_helper.h"
21 #include "cc/layers/content_layer_client.h" 21 #include "cc/layers/content_layer_client.h"
22 #include "cc/layers/heads_up_display_layer.h"
22 #include "cc/layers/layer_impl.h" 23 #include "cc/layers/layer_impl.h"
23 #include "cc/layers/painted_scrollbar_layer.h" 24 #include "cc/layers/painted_scrollbar_layer.h"
24 #include "cc/layers/picture_layer.h" 25 #include "cc/layers/picture_layer.h"
25 #include "cc/layers/solid_color_layer.h" 26 #include "cc/layers/solid_color_layer.h"
26 #include "cc/layers/video_layer.h" 27 #include "cc/layers/video_layer.h"
27 #include "cc/output/begin_frame_args.h" 28 #include "cc/output/begin_frame_args.h"
28 #include "cc/output/copy_output_request.h" 29 #include "cc/output/copy_output_request.h"
29 #include "cc/output/copy_output_result.h" 30 #include "cc/output/copy_output_result.h"
30 #include "cc/output/output_surface.h" 31 #include "cc/output/output_surface.h"
31 #include "cc/output/swap_promise.h" 32 #include "cc/output/swap_promise.h"
(...skipping 7159 matching lines...) Expand 10 before | Expand all | Expand 10 after
7191 7192
7192 void AfterTest() override {} 7193 void AfterTest() override {}
7193 7194
7194 private: 7195 private:
7195 bool first_ = true; 7196 bool first_ = true;
7196 SkBitmap bitmap_; 7197 SkBitmap bitmap_;
7197 }; 7198 };
7198 7199
7199 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestQueueImageDecodeNonLazy); 7200 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestQueueImageDecodeNonLazy);
7200 7201
7202 class LayerTreeHostTestHudLayerWithLayerLists : public LayerTreeHostTest {
7203 public:
7204 void InitializeSettings(LayerTreeSettings* settings) override {
7205 settings->initial_debug_state.show_paint_rects = true;
7206 settings->use_layer_lists = true;
7207 }
7208
7209 void SetupTree() override {
7210 LayerTreeHostTest::SetupTree();
7211
7212 // Build the property trees for the root layer.
7213 layer_tree_host()->BuildPropertyTreesForTesting();
7214
7215 // The HUD layer should not have been setup by the property tree building.
7216 DCHECK_EQ(layer_tree_host()->hud_layer(), nullptr);
7217 }
7218
7219 void BeginTest() override { PostSetNeedsCommitToMainThread(); }
7220
7221 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { EndTest(); }
7222
7223 void DidCommit() override {
7224 auto* hud = layer_tree_host()->hud_layer();
7225 DCHECK(hud);
7226 auto* root_layer = layer_tree_host()->root_layer();
7227 DCHECK_EQ(hud->transform_tree_index(), root_layer->transform_tree_index());
7228 DCHECK_EQ(hud->clip_tree_index(), root_layer->clip_tree_index());
7229 DCHECK_EQ(hud->effect_tree_index(), root_layer->effect_tree_index());
7230 DCHECK_EQ(hud->scroll_tree_index(), root_layer->scroll_tree_index());
7231 }
7232
7233 void AfterTest() override {}
7234 };
7235
7236 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestHudLayerWithLayerLists);
7237
7201 } // namespace 7238 } // namespace
7202 } // namespace cc 7239 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698