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

Side by Side Diff: cc/test/mock_quad_culler.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.h ('k') | cc/trees/layer_tree_host_pixeltest_on_demand_raster.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/test/mock_quad_culler.h" 5 #include "cc/test/mock_quad_culler.h"
6 6
7 #include "cc/base/math_util.h" 7 #include "cc/base/math_util.h"
8 #include "cc/layers/layer_impl.h" 8 #include "cc/layers/layer_impl.h"
9 #include "cc/quads/draw_quad.h" 9 #include "cc/quads/draw_quad.h"
10 10
11 namespace cc { 11 namespace cc {
12 12
13 MockQuadCuller::MockQuadCuller() {
14 render_pass_storage_ = RenderPass::Create();
15 active_render_pass_ = render_pass_storage_.get();
16 occlusion_tracker_storage_ = make_scoped_ptr(
17 new MockOcclusionTracker<LayerImpl>(gfx::Rect(0, 0, 1000, 1000)));
18 occlusion_tracker_ = occlusion_tracker_storage_.get();
19 }
20
21 MockQuadCuller::MockQuadCuller(RenderPass* external_render_pass)
22 : active_render_pass_(external_render_pass) {
23 occlusion_tracker_storage_ = make_scoped_ptr(
24 new MockOcclusionTracker<LayerImpl>(gfx::Rect(0, 0, 1000, 1000)));
25 occlusion_tracker_ = occlusion_tracker_storage_.get();
26 }
27
28 MockQuadCuller::MockQuadCuller(
29 MockOcclusionTracker<LayerImpl>* occlusion_tracker)
30 : occlusion_tracker_(occlusion_tracker) {
31 render_pass_storage_ = RenderPass::Create();
32 active_render_pass_ = render_pass_storage_.get();
33 }
34
35 MockQuadCuller::MockQuadCuller( 13 MockQuadCuller::MockQuadCuller(
36 RenderPass* external_render_pass, 14 RenderPass* external_render_pass,
37 MockOcclusionTracker<LayerImpl>* occlusion_tracker) 15 MockOcclusionTracker<LayerImpl>* occlusion_tracker)
38 : active_render_pass_(external_render_pass), 16 : active_render_pass_(external_render_pass),
39 occlusion_tracker_(occlusion_tracker) { 17 occlusion_tracker_(occlusion_tracker) {
40 } 18 }
41 19
42 MockQuadCuller::~MockQuadCuller() {} 20 MockQuadCuller::~MockQuadCuller() {}
43 21
44 SharedQuadState* MockQuadCuller::CreateSharedQuadState() { 22 SharedQuadState* MockQuadCuller::CreateSharedQuadState() {
(...skipping 14 matching lines...) Expand all
59 content_rect, draw_transform); 37 content_rect, draw_transform);
60 } 38 }
61 39
62 void MockQuadCuller::Append(scoped_ptr<DrawQuad> draw_quad) { 40 void MockQuadCuller::Append(scoped_ptr<DrawQuad> draw_quad) {
63 DCHECK(!draw_quad->rect.IsEmpty()); 41 DCHECK(!draw_quad->rect.IsEmpty());
64 DCHECK(!draw_quad->visible_rect.IsEmpty()); 42 DCHECK(!draw_quad->visible_rect.IsEmpty());
65 active_render_pass_->quad_list.push_back(draw_quad.Pass()); 43 active_render_pass_->quad_list.push_back(draw_quad.Pass());
66 } 44 }
67 45
68 } // namespace cc 46 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/mock_quad_culler.h ('k') | cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698