| 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 "cc/layers/append_quads_data.h" | 5 #include "cc/layers/append_quads_data.h" |
| 6 #include "cc/layers/heads_up_display_layer_impl.h" | 6 #include "cc/layers/heads_up_display_layer_impl.h" |
| 7 #include "cc/test/fake_impl_proxy.h" | 7 #include "cc/test/fake_impl_proxy.h" |
| 8 #include "cc/test/fake_layer_tree_host_impl.h" | 8 #include "cc/test/fake_layer_tree_host_impl.h" |
| 9 #include "cc/test/fake_output_surface.h" | 9 #include "cc/test/fake_output_surface.h" |
| 10 #include "cc/test/mock_quad_culler.h" | 10 #include "cc/test/mock_quad_culler.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 host_impl.InitializeRenderer(CreateFakeOutputSurface()); | 36 host_impl.InitializeRenderer(CreateFakeOutputSurface()); |
| 37 scoped_ptr<HeadsUpDisplayLayerImpl> layer = | 37 scoped_ptr<HeadsUpDisplayLayerImpl> layer = |
| 38 HeadsUpDisplayLayerImpl::Create(host_impl.pending_tree(), 1); | 38 HeadsUpDisplayLayerImpl::Create(host_impl.pending_tree(), 1); |
| 39 layer->SetContentBounds(gfx::Size(100, 100)); | 39 layer->SetContentBounds(gfx::Size(100, 100)); |
| 40 | 40 |
| 41 // Check regular hardware draw is ok. | 41 // Check regular hardware draw is ok. |
| 42 CheckDrawLayer( | 42 CheckDrawLayer( |
| 43 layer.get(), host_impl.resource_provider(), DRAW_MODE_HARDWARE); | 43 layer.get(), host_impl.resource_provider(), DRAW_MODE_HARDWARE); |
| 44 | 44 |
| 45 // Simulate a resource loss on transitioning to resourceless software mode. | 45 // Simulate a resource loss on transitioning to resourceless software mode. |
| 46 layer->DidLoseOutputSurface(); | 46 layer->ReleaseResources(); |
| 47 | 47 |
| 48 // Should skip resourceless software draw and not crash in UpdateHudTexture. | 48 // Should skip resourceless software draw and not crash in UpdateHudTexture. |
| 49 CheckDrawLayer(layer.get(), | 49 CheckDrawLayer(layer.get(), |
| 50 host_impl.resource_provider(), | 50 host_impl.resource_provider(), |
| 51 DRAW_MODE_RESOURCELESS_SOFTWARE); | 51 DRAW_MODE_RESOURCELESS_SOFTWARE); |
| 52 } | 52 } |
| 53 | 53 |
| 54 } // namespace | 54 } // namespace |
| 55 } // namespace cc | 55 } // namespace cc |
| OLD | NEW |