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_PICTURE_LAYER_H_
6 #define CC_PICTURE_LAYER_H_
8 #include "cc/contents_scaling_layer.h"
10 #include "cc/picture_pile.h"
11 #include "cc/occlusion_tracker.h"
15 class ContentLayerClient
;
16 class ResourceUpdateQueue
;
17 struct RenderingStats
;
19 class CC_EXPORT PictureLayer
: public ContentsScalingLayer
{
21 static scoped_refptr
<PictureLayer
> create(ContentLayerClient
*);
23 void clearClient() { client_
= 0; }
25 // Implement Layer interface
26 virtual bool drawsContent() const OVERRIDE
;
27 virtual scoped_ptr
<LayerImpl
> createLayerImpl(
28 LayerTreeImpl
* treeImpl
) OVERRIDE
;
29 virtual void pushPropertiesTo(LayerImpl
*) OVERRIDE
;
30 virtual void setNeedsDisplayRect(const gfx::RectF
& layerRect
) OVERRIDE
;
31 virtual void update(ResourceUpdateQueue
&, const OcclusionTracker
*,
32 RenderingStats
&) OVERRIDE
;
35 explicit PictureLayer(ContentLayerClient
*);
36 virtual ~PictureLayer();
39 ContentLayerClient
* client_
;
41 // Invalidation to use the next time update is called.
42 Region pending_invalidation_
;
43 // Invalidation from the last time update was called.
44 Region pile_invalidation_
;
49 #endif // CC_PICTURE_LAYER_H_