Revert 268405 "Make sure that ScratchBuffer::Allocate() always r..."
[chromium-blink-merge.git] / cc / trees / quad_culler.h
blob6377b13d81280076e1a0a3808bdf9107372be7e3
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.
5 #ifndef CC_TREES_QUAD_CULLER_H_
6 #define CC_TREES_QUAD_CULLER_H_
8 #include "cc/base/cc_export.h"
9 #include "cc/layers/quad_sink.h"
10 #include "cc/quads/render_pass.h"
12 namespace cc {
13 class LayerImpl;
14 class RenderSurfaceImpl;
15 template <typename LayerType>
16 class OcclusionTracker;
18 class CC_EXPORT QuadCuller : public QuadSink {
19 public:
20 QuadCuller(QuadList* quad_list,
21 SharedQuadStateList* shared_quad_state_list,
22 const LayerImpl* layer,
23 const OcclusionTracker<LayerImpl>& occlusion_tracker);
24 virtual ~QuadCuller() {}
26 // QuadSink implementation.
27 virtual SharedQuadState* UseSharedQuadState(
28 scoped_ptr<SharedQuadState> shared_quad_state) OVERRIDE;
29 virtual gfx::Rect UnoccludedContentRect(const gfx::Rect& content_rect,
30 const gfx::Transform& draw_transform)
31 OVERRIDE;
32 virtual gfx::Rect UnoccludedContributingSurfaceContentRect(
33 const gfx::Rect& content_rect,
34 const gfx::Transform& draw_transform) OVERRIDE;
35 virtual void Append(scoped_ptr<DrawQuad> draw_quad) OVERRIDE;
37 private:
38 QuadList* quad_list_;
39 SharedQuadStateList* shared_quad_state_list_;
40 const LayerImpl* layer_;
41 const OcclusionTracker<LayerImpl>& occlusion_tracker_;
43 SharedQuadState* current_shared_quad_state_;
45 DISALLOW_COPY_AND_ASSIGN(QuadCuller);
48 } // namespace cc
50 #endif // CC_TREES_QUAD_CULLER_H_