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

Side by Side Diff: cc/trees/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/trees/quad_culler.h ('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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "cc/trees/quad_culler.h"
6
7 #include "cc/debug/debug_colors.h"
8 #include "cc/layers/append_quads_data.h"
9 #include "cc/layers/layer_impl.h"
10 #include "cc/quads/debug_border_draw_quad.h"
11 #include "cc/quads/render_pass.h"
12 #include "cc/quads/render_pass_draw_quad.h"
13 #include "cc/trees/occlusion_tracker.h"
14 #include "third_party/skia/include/core/SkColor.h"
15 #include "ui/gfx/transform.h"
16
17 namespace cc {
18
19 QuadCuller::QuadCuller(RenderPass* render_pass,
20 const LayerImpl* layer,
21 const OcclusionTracker<LayerImpl>& occlusion_tracker)
22 : render_pass_(render_pass),
23 layer_(layer),
24 occlusion_tracker_(occlusion_tracker),
25 current_shared_quad_state_(NULL) {
26 }
27
28 SharedQuadState* QuadCuller::CreateSharedQuadState() {
29 current_shared_quad_state_ = render_pass_->CreateAndAppendSharedQuadState();
30 return current_shared_quad_state_;
31 }
32
33 gfx::Rect QuadCuller::UnoccludedContentRect(
34 const gfx::Rect& content_rect,
35 const gfx::Transform& draw_transform) {
36 return occlusion_tracker_.UnoccludedContentRect(content_rect, draw_transform);
37 }
38
39 gfx::Rect QuadCuller::UnoccludedContributingSurfaceContentRect(
40 const gfx::Rect& content_rect,
41 const gfx::Transform& draw_transform) {
42 return occlusion_tracker_.UnoccludedContributingSurfaceContentRect(
43 content_rect, draw_transform);
44 }
45
46 void QuadCuller::Append(scoped_ptr<DrawQuad> draw_quad) {
47 DCHECK(draw_quad->shared_quad_state == current_shared_quad_state_);
48 DCHECK(!render_pass_->shared_quad_state_list.empty());
49 DCHECK(render_pass_->shared_quad_state_list.back() ==
50 current_shared_quad_state_);
51 DCHECK(!draw_quad->rect.IsEmpty());
52 DCHECK(!draw_quad->visible_rect.IsEmpty());
53 render_pass_->quad_list.push_back(draw_quad.Pass());
54 }
55
56 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/quad_culler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698