summaryrefslogtreecommitdiffstats
path: root/cc/picture_layer.h
blob: 731b90bc28d593b8f1c72805cefd3566524216e4 (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
50
51
52
53
54
// 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_PICTURE_LAYER_H_
#define CC_PICTURE_LAYER_H_

#include "cc/contents_scaling_layer.h"
#include "cc/layer.h"
#include "cc/picture_pile.h"
#include "cc/occlusion_tracker.h"

namespace cc {

class ContentLayerClient;
class ResourceUpdateQueue;
struct RenderingStats;

class CC_EXPORT PictureLayer : public ContentsScalingLayer {
 public:
  static scoped_refptr<PictureLayer> create(ContentLayerClient* client);

  void clearClient() { client_ = 0; }

  // Implement Layer interface
  virtual bool drawsContent() const OVERRIDE;
  virtual scoped_ptr<LayerImpl> createLayerImpl(
      LayerTreeImpl* treeImpl) OVERRIDE;
  virtual void setLayerTreeHost(LayerTreeHost* host) OVERRIDE;
  virtual void pushPropertiesTo(LayerImpl* layer) OVERRIDE;
  virtual void setNeedsDisplayRect(const gfx::RectF& layerRect) OVERRIDE;
  virtual void update(
      ResourceUpdateQueue& queue,
      const OcclusionTracker* occlusion,
      RenderingStats& stats) OVERRIDE;
  virtual void setIsMask(bool is_mask) OVERRIDE;

 protected:
  explicit PictureLayer(ContentLayerClient* client);
  virtual ~PictureLayer();

 private:
  ContentLayerClient* client_;
  scoped_refptr<PicturePile> pile_;
  // Invalidation to use the next time update is called.
  Region pending_invalidation_;
  // Invalidation from the last time update was called.
  Region pile_invalidation_;
  bool is_mask_;
};

}  // namespace cc

#endif  // CC_PICTURE_LAYER_H_