| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |