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

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

Issue 2080223010: cc: Clean up root_layer code in LTI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase++ Created 4 years, 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "cc/layers/append_quads_data.h" 7 #include "cc/layers/append_quads_data.h"
8 #include "cc/layers/heads_up_display_layer_impl.h" 8 #include "cc/layers/heads_up_display_layer_impl.h"
9 #include "cc/test/fake_impl_task_runner_provider.h" 9 #include "cc/test/fake_impl_task_runner_provider.h"
10 #include "cc/test/fake_layer_tree_host_impl.h" 10 #include "cc/test/fake_layer_tree_host_impl.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 &task_graph_runner); 42 &task_graph_runner);
43 host_impl.CreatePendingTree(); 43 host_impl.CreatePendingTree();
44 host_impl.SetVisible(true); 44 host_impl.SetVisible(true);
45 host_impl.InitializeRenderer(output_surface.get()); 45 host_impl.InitializeRenderer(output_surface.get());
46 std::unique_ptr<HeadsUpDisplayLayerImpl> layer_ptr = 46 std::unique_ptr<HeadsUpDisplayLayerImpl> layer_ptr =
47 HeadsUpDisplayLayerImpl::Create(host_impl.pending_tree(), 1); 47 HeadsUpDisplayLayerImpl::Create(host_impl.pending_tree(), 1);
48 layer_ptr->SetBounds(gfx::Size(100, 100)); 48 layer_ptr->SetBounds(gfx::Size(100, 100));
49 49
50 HeadsUpDisplayLayerImpl* layer = layer_ptr.get(); 50 HeadsUpDisplayLayerImpl* layer = layer_ptr.get();
51 51
52 host_impl.pending_tree()->SetRootLayer(std::move(layer_ptr)); 52 host_impl.pending_tree()->SetRootLayerForTesting(std::move(layer_ptr));
53 host_impl.pending_tree()->BuildLayerListAndPropertyTreesForTesting(); 53 host_impl.pending_tree()->BuildLayerListAndPropertyTreesForTesting();
54 54
55 // Check regular hardware draw is ok. 55 // Check regular hardware draw is ok.
56 CheckDrawLayer(layer, host_impl.resource_provider(), DRAW_MODE_HARDWARE); 56 CheckDrawLayer(layer, host_impl.resource_provider(), DRAW_MODE_HARDWARE);
57 57
58 // Simulate a resource loss on transitioning to resourceless software mode. 58 // Simulate a resource loss on transitioning to resourceless software mode.
59 layer->ReleaseResources(); 59 layer->ReleaseResources();
60 60
61 // Should skip resourceless software draw and not crash in UpdateHudTexture. 61 // Should skip resourceless software draw and not crash in UpdateHudTexture.
62 CheckDrawLayer(layer, host_impl.resource_provider(), 62 CheckDrawLayer(layer, host_impl.resource_provider(),
63 DRAW_MODE_RESOURCELESS_SOFTWARE); 63 DRAW_MODE_RESOURCELESS_SOFTWARE);
64 } 64 }
65 65
66 } // namespace 66 } // namespace
67 } // namespace cc 67 } // namespace cc
OLDNEW
« no previous file with comments | « cc/input/scrollbar_animation_controller_thinning_unittest.cc ('k') | cc/layers/layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698