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

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

Issue 927783002: cc: Stop passing the occlusion explicitly to AppendQuads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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_impl.h » ('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/test_shared_bitmap_manager.h" 10 #include "cc/test/test_shared_bitmap_manager.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace cc { 13 namespace cc {
14 namespace { 14 namespace {
15 15
16 void CheckDrawLayer(HeadsUpDisplayLayerImpl* layer, 16 void CheckDrawLayer(HeadsUpDisplayLayerImpl* layer,
17 ResourceProvider* resource_provider, 17 ResourceProvider* resource_provider,
18 DrawMode draw_mode) { 18 DrawMode draw_mode) {
19 scoped_ptr<RenderPass> render_pass = RenderPass::Create(); 19 scoped_ptr<RenderPass> render_pass = RenderPass::Create();
20 AppendQuadsData data; 20 AppendQuadsData data;
21 bool will_draw = layer->WillDraw(draw_mode, resource_provider); 21 bool will_draw = layer->WillDraw(draw_mode, resource_provider);
22 if (will_draw) 22 if (will_draw)
23 layer->AppendQuads(render_pass.get(), Occlusion(), &data); 23 layer->AppendQuads(render_pass.get(), &data);
24 layer->UpdateHudTexture(draw_mode, resource_provider); 24 layer->UpdateHudTexture(draw_mode, resource_provider);
25 if (will_draw) 25 if (will_draw)
26 layer->DidDraw(resource_provider); 26 layer->DidDraw(resource_provider);
27 27
28 size_t expected_quad_list_size = will_draw ? 1 : 0; 28 size_t expected_quad_list_size = will_draw ? 1 : 0;
29 EXPECT_EQ(expected_quad_list_size, render_pass->quad_list.size()); 29 EXPECT_EQ(expected_quad_list_size, render_pass->quad_list.size());
30 } 30 }
31 31
32 TEST(HeadsUpDisplayLayerImplTest, ResourcelessSoftwareDrawAfterResourceLoss) { 32 TEST(HeadsUpDisplayLayerImplTest, ResourcelessSoftwareDrawAfterResourceLoss) {
33 FakeImplProxy proxy; 33 FakeImplProxy proxy;
(...skipping 14 matching lines...) Expand all
48 layer->ReleaseResources(); 48 layer->ReleaseResources();
49 49
50 // Should skip resourceless software draw and not crash in UpdateHudTexture. 50 // Should skip resourceless software draw and not crash in UpdateHudTexture.
51 CheckDrawLayer(layer.get(), 51 CheckDrawLayer(layer.get(),
52 host_impl.resource_provider(), 52 host_impl.resource_provider(),
53 DRAW_MODE_RESOURCELESS_SOFTWARE); 53 DRAW_MODE_RESOURCELESS_SOFTWARE);
54 } 54 }
55 55
56 } // namespace 56 } // namespace
57 } // namespace cc 57 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/heads_up_display_layer_impl.cc ('k') | cc/layers/io_surface_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698