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

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

Issue 205503002: cc: Apply occlusion before creating quads in RenderSurfaceImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: append-rendersurface: headers Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « cc/test/mock_quad_culler.h ('k') | cc/trees/quad_culler.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 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/quads/draw_quad.h" 7 #include "cc/quads/draw_quad.h"
8 8
9 namespace cc { 9 namespace cc {
10 10
(...skipping 12 matching lines...) Expand all
23 SharedQuadState* MockQuadCuller::UseSharedQuadState( 23 SharedQuadState* MockQuadCuller::UseSharedQuadState(
24 scoped_ptr<SharedQuadState> shared_quad_state) { 24 scoped_ptr<SharedQuadState> shared_quad_state) {
25 SharedQuadState* raw_ptr = shared_quad_state.get(); 25 SharedQuadState* raw_ptr = shared_quad_state.get();
26 active_shared_quad_state_list_->push_back(shared_quad_state.Pass()); 26 active_shared_quad_state_list_->push_back(shared_quad_state.Pass());
27 return raw_ptr; 27 return raw_ptr;
28 } 28 }
29 29
30 gfx::Rect MockQuadCuller::UnoccludedContentRect( 30 gfx::Rect MockQuadCuller::UnoccludedContentRect(
31 const gfx::Rect& content_rect, 31 const gfx::Rect& content_rect,
32 const gfx::Transform& draw_transform) { 32 const gfx::Transform& draw_transform) {
33 DCHECK(draw_transform.IsIdentity() || occluded_content_rect_.IsEmpty());
33 gfx::Rect result = content_rect; 34 gfx::Rect result = content_rect;
34 result.Subtract(occluded_content_rect_); 35 result.Subtract(occluded_content_rect_);
35 return result; 36 return result;
36 } 37 }
37 38
39 gfx::Rect MockQuadCuller::UnoccludedContributingSurfaceContentRect(
40 const gfx::Rect& content_rect,
41 const gfx::Transform& draw_transform) {
42 DCHECK(draw_transform.IsIdentity() ||
43 occluded_content_rect_for_contributing_surface_.IsEmpty());
44 gfx::Rect result = content_rect;
45 result.Subtract(occluded_content_rect_for_contributing_surface_);
46 return result;
47 }
48
38 bool MockQuadCuller::MaybeAppend(scoped_ptr<DrawQuad> draw_quad) { 49 bool MockQuadCuller::MaybeAppend(scoped_ptr<DrawQuad> draw_quad) {
39 if (!draw_quad->rect.IsEmpty()) { 50 if (!draw_quad->rect.IsEmpty()) {
40 active_quad_list_->push_back(draw_quad.Pass()); 51 active_quad_list_->push_back(draw_quad.Pass());
41 return true; 52 return true;
42 } 53 }
43 return false; 54 return false;
44 } 55 }
45 56
46 void MockQuadCuller::Append(scoped_ptr<DrawQuad> draw_quad) { 57 void MockQuadCuller::Append(scoped_ptr<DrawQuad> draw_quad) {
47 DCHECK(!draw_quad->rect.IsEmpty()); 58 DCHECK(!draw_quad->rect.IsEmpty());
48 DCHECK(!draw_quad->visible_rect.IsEmpty()); 59 DCHECK(!draw_quad->visible_rect.IsEmpty());
49 active_quad_list_->push_back(draw_quad.Pass()); 60 active_quad_list_->push_back(draw_quad.Pass());
50 } 61 }
51 62
52 } // namespace cc 63 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/mock_quad_culler.h ('k') | cc/trees/quad_culler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698