summaryrefslogtreecommitdiffstats
path: root/cc/trees/quad_culler.h
blob: be0095f9f41f4629b54c4728a34c5fa022f7aa87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CC_TREES_QUAD_CULLER_H_
#define CC_TREES_QUAD_CULLER_H_

#include "cc/base/cc_export.h"
#include "cc/layers/quad_sink.h"
#include "cc/quads/render_pass.h"

namespace cc {
class LayerImpl;
class RenderSurfaceImpl;
template <typename LayerType, typename SurfaceType> class OcclusionTrackerBase;

class CC_EXPORT QuadCuller : public QuadSink {
 public:
  QuadCuller(QuadList* quad_list,
             SharedQuadStateList* shared_quad_state_list,
             const LayerImpl* layer,
             const OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>&
                 occlusion_tracker,
             bool show_culling_with_debug_border_quads,
             bool for_surface);
  virtual ~QuadCuller() {}

  // QuadSink implementation.
  virtual SharedQuadState* UseSharedQuadState(
      scoped_ptr<SharedQuadState> shared_quad_state) OVERRIDE;
  virtual bool Append(scoped_ptr<DrawQuad> draw_quad,
                      AppendQuadsData* append_quads_data) OVERRIDE;

 private:
  QuadList* quad_list_;
  SharedQuadStateList* shared_quad_state_list_;
  const LayerImpl* layer_;
  const OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>& occlusion_tracker_;

  SharedQuadState* current_shared_quad_state_;
  bool show_culling_with_debug_border_quads_;
  bool for_surface_;

  DISALLOW_COPY_AND_ASSIGN(QuadCuller);
};

}  // namespace cc

#endif  // CC_TREES_QUAD_CULLER_H_