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_LAYERS_QUAD_SINK_H_
6 #define CC_LAYERS_QUAD_SINK_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "cc/base/cc_export.h"
21 class RenderSurfaceImpl;
22 class SharedQuadState;
23 template <typename LayerType>
24 class OcclusionTracker;
26 class CC_EXPORT QuadSink {
28 QuadSink(RenderPass* render_pass,
29 const OcclusionTracker<LayerImpl>* occlusion_tracker);
32 // Call this to add a SharedQuadState before appending quads that refer to it.
33 // Returns a pointer to the given SharedQuadState, that can be set on the
35 virtual SharedQuadState* CreateSharedQuadState();
37 virtual gfx::Rect UnoccludedContentRect(const gfx::Rect& content_rect,
38 const gfx::Transform& draw_transform);
40 virtual gfx::Rect UnoccludedContributingSurfaceContentRect(
41 const gfx::Rect& content_rect,
42 const gfx::Transform& draw_transform);
44 virtual void Append(scoped_ptr<DrawQuad> draw_quad);
46 const RenderPass* render_pass() const { return render_pass_; }
49 RenderPass* render_pass_;
51 SharedQuadState* current_shared_quad_state_;
54 const OcclusionTracker<LayerImpl>* occlusion_tracker_;
56 DISALLOW_COPY_AND_ASSIGN(QuadSink);
61 #endif // CC_LAYERS_QUAD_SINK_H_