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

Side by Side Diff: cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc

Issue 306683002: MockQC stops create its own RP and MockOcclusionTracker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@testocclusiontracking
Patch Set: rebase Created 6 years, 6 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/test/mock_quad_culler.cc ('k') | no next file » | 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/content_layer_client.h" 6 #include "cc/layers/content_layer_client.h"
7 #include "cc/layers/picture_layer.h" 7 #include "cc/layers/picture_layer.h"
8 #include "cc/layers/picture_layer_impl.h" 8 #include "cc/layers/picture_layer_impl.h"
9 #include "cc/quads/draw_quad.h" 9 #include "cc/quads/draw_quad.h"
10 #include "cc/test/layer_tree_pixel_test.h" 10 #include "cc/test/layer_tree_pixel_test.h"
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 35
36 virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, 36 virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
37 bool result) OVERRIDE { 37 bool result) OVERRIDE {
38 // Find the PictureLayerImpl ask it to append quads to check their material. 38 // Find the PictureLayerImpl ask it to append quads to check their material.
39 // The PictureLayerImpl is assumed to be the first child of the root layer 39 // The PictureLayerImpl is assumed to be the first child of the root layer
40 // in the active tree. 40 // in the active tree.
41 PictureLayerImpl* picture_layer = static_cast<PictureLayerImpl*>( 41 PictureLayerImpl* picture_layer = static_cast<PictureLayerImpl*>(
42 host_impl->active_tree()->root_layer()->child_at(0)); 42 host_impl->active_tree()->root_layer()->child_at(0));
43 43
44 MockOcclusionTracker<LayerImpl> occlusion_tracker;
44 scoped_ptr<RenderPass> render_pass = RenderPass::Create(); 45 scoped_ptr<RenderPass> render_pass = RenderPass::Create();
45 MockQuadCuller quad_culler(render_pass.get()); 46 MockQuadCuller quad_culler(render_pass.get(), &occlusion_tracker);
46 47
47 AppendQuadsData data; 48 AppendQuadsData data;
48 picture_layer->AppendQuads(&quad_culler, &data); 49 picture_layer->AppendQuads(&quad_culler, &data);
49 50
50 for (size_t i = 0; i < render_pass->quad_list.size(); ++i) 51 for (size_t i = 0; i < render_pass->quad_list.size(); ++i)
51 EXPECT_EQ(render_pass->quad_list[i]->material, DrawQuad::PICTURE_CONTENT); 52 EXPECT_EQ(render_pass->quad_list[i]->material, DrawQuad::PICTURE_CONTENT);
52 53
53 // Triggers pixel readback and ends the test. 54 // Triggers pixel readback and ends the test.
54 LayerTreePixelTest::SwapBuffersOnThread(host_impl, result); 55 LayerTreePixelTest::SwapBuffersOnThread(host_impl, result);
55 } 56 }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 104
104 RunPixelTest(GL_WITH_BITMAP, 105 RunPixelTest(GL_WITH_BITMAP,
105 layer, 106 layer,
106 base::FilePath(FILE_PATH_LITERAL("blue_yellow.png"))); 107 base::FilePath(FILE_PATH_LITERAL("blue_yellow.png")));
107 } 108 }
108 109
109 } // namespace 110 } // namespace
110 } // namespace cc 111 } // namespace cc
111 112
112 #endif // OS_ANDROID 113 #endif // OS_ANDROID
OLDNEW
« no previous file with comments | « cc/test/mock_quad_culler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698