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

Side by Side Diff: cc/test/mock_quad_culler.cc

Issue 309493002: Remove QuadCuller class and make QuadSink concrete (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@test2ownMock
Patch Set: gn build fix 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_impl.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"
8 #include "cc/layers/layer_impl.h"
9 #include "cc/quads/draw_quad.h"
10
11 namespace cc { 7 namespace cc {
12 8
13 MockQuadCuller::MockQuadCuller( 9 MockQuadCuller::MockQuadCuller(
14 RenderPass* external_render_pass, 10 RenderPass* render_pass,
15 MockOcclusionTracker<LayerImpl>* occlusion_tracker) 11 MockOcclusionTracker<LayerImpl>* occlusion_tracker)
16 : active_render_pass_(external_render_pass), 12 : QuadSink(render_pass, occlusion_tracker),
17 occlusion_tracker_(occlusion_tracker) { 13 occlusion_tracker_(occlusion_tracker) {
18 } 14 }
19 15
20 MockQuadCuller::~MockQuadCuller() {} 16 MockQuadCuller::~MockQuadCuller() {}
21 17
22 SharedQuadState* MockQuadCuller::CreateSharedQuadState() {
23 return active_render_pass_->CreateAndAppendSharedQuadState();
24 }
25
26 gfx::Rect MockQuadCuller::UnoccludedContentRect( 18 gfx::Rect MockQuadCuller::UnoccludedContentRect(
27 const gfx::Rect& content_rect, 19 const gfx::Rect& content_rect,
28 const gfx::Transform& draw_transform) { 20 const gfx::Transform& draw_transform) {
29 return occlusion_tracker_->UnoccludedContentRect(content_rect, 21 return occlusion_tracker_->UnoccludedContentRect(content_rect,
30 draw_transform); 22 draw_transform);
31 } 23 }
32 24
33 gfx::Rect MockQuadCuller::UnoccludedContributingSurfaceContentRect( 25 gfx::Rect MockQuadCuller::UnoccludedContributingSurfaceContentRect(
34 const gfx::Rect& content_rect, 26 const gfx::Rect& content_rect,
35 const gfx::Transform& draw_transform) { 27 const gfx::Transform& draw_transform) {
36 return occlusion_tracker_->UnoccludedContributingSurfaceContentRect( 28 return occlusion_tracker_->UnoccludedContributingSurfaceContentRect(
37 content_rect, draw_transform); 29 content_rect, draw_transform);
38 } 30 }
39 31
40 void MockQuadCuller::Append(scoped_ptr<DrawQuad> draw_quad) { 32 } // namespace cc
41 DCHECK(!draw_quad->rect.IsEmpty());
42 DCHECK(!draw_quad->visible_rect.IsEmpty());
43 active_render_pass_->quad_list.push_back(draw_quad.Pass());
44 }
45 33
46 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/mock_quad_culler.h ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698