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

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

Issue 608503005: Revert of cc: Remove use of PassAs() and constructor-casting with scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/layers/heads_up_display_layer_impl.cc ('k') | cc/layers/io_surface_layer.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 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_occlusion_tracker.h" 10 #include "cc/test/mock_occlusion_tracker.h"
(...skipping 18 matching lines...) Expand all
29 29
30 size_t expected_quad_list_size = will_draw ? 1 : 0; 30 size_t expected_quad_list_size = will_draw ? 1 : 0;
31 EXPECT_EQ(expected_quad_list_size, render_pass->quad_list.size()); 31 EXPECT_EQ(expected_quad_list_size, render_pass->quad_list.size());
32 } 32 }
33 33
34 TEST(HeadsUpDisplayLayerImplTest, ResourcelessSoftwareDrawAfterResourceLoss) { 34 TEST(HeadsUpDisplayLayerImplTest, ResourcelessSoftwareDrawAfterResourceLoss) {
35 FakeImplProxy proxy; 35 FakeImplProxy proxy;
36 TestSharedBitmapManager shared_bitmap_manager; 36 TestSharedBitmapManager shared_bitmap_manager;
37 FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager); 37 FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
38 host_impl.CreatePendingTree(); 38 host_impl.CreatePendingTree();
39 host_impl.InitializeRenderer(FakeOutputSurface::Create3d()); 39 host_impl.InitializeRenderer(
40 FakeOutputSurface::Create3d().PassAs<OutputSurface>());
40 scoped_ptr<HeadsUpDisplayLayerImpl> layer = 41 scoped_ptr<HeadsUpDisplayLayerImpl> layer =
41 HeadsUpDisplayLayerImpl::Create(host_impl.pending_tree(), 1); 42 HeadsUpDisplayLayerImpl::Create(host_impl.pending_tree(), 1);
42 layer->SetContentBounds(gfx::Size(100, 100)); 43 layer->SetContentBounds(gfx::Size(100, 100));
43 44
44 // Check regular hardware draw is ok. 45 // Check regular hardware draw is ok.
45 CheckDrawLayer( 46 CheckDrawLayer(
46 layer.get(), host_impl.resource_provider(), DRAW_MODE_HARDWARE); 47 layer.get(), host_impl.resource_provider(), DRAW_MODE_HARDWARE);
47 48
48 // Simulate a resource loss on transitioning to resourceless software mode. 49 // Simulate a resource loss on transitioning to resourceless software mode.
49 layer->ReleaseResources(); 50 layer->ReleaseResources();
50 51
51 // Should skip resourceless software draw and not crash in UpdateHudTexture. 52 // Should skip resourceless software draw and not crash in UpdateHudTexture.
52 CheckDrawLayer(layer.get(), 53 CheckDrawLayer(layer.get(),
53 host_impl.resource_provider(), 54 host_impl.resource_provider(),
54 DRAW_MODE_RESOURCELESS_SOFTWARE); 55 DRAW_MODE_RESOURCELESS_SOFTWARE);
55 } 56 }
56 57
57 } // namespace 58 } // namespace
58 } // namespace cc 59 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/heads_up_display_layer_impl.cc ('k') | cc/layers/io_surface_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698