OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_PICTURE_LAYER_IMPL_H_ | 5 #ifndef CC_PICTURE_LAYER_IMPL_H_ |
6 #define CC_PICTURE_LAYER_IMPL_H_ | 6 #define CC_PICTURE_LAYER_IMPL_H_ |
7 | 7 |
8 #include "cc/layer_impl.h" | 8 #include "cc/layer_impl.h" |
| 9 #include "cc/picture_layer_tiling.h" |
9 #include "cc/picture_pile.h" | 10 #include "cc/picture_pile.h" |
| 11 #include "cc/scoped_ptr_vector.h" |
10 | 12 |
11 namespace cc { | 13 namespace cc { |
12 | 14 |
13 struct AppendQuadsData; | 15 struct AppendQuadsData; |
14 class QuadSink; | 16 class QuadSink; |
15 | 17 |
16 class CC_EXPORT PictureLayerImpl : public LayerImpl { | 18 class CC_EXPORT PictureLayerImpl : public LayerImpl, |
| 19 public PictureLayerTilingClient { |
17 public: | 20 public: |
18 static scoped_ptr<PictureLayerImpl> create(int id) | 21 static scoped_ptr<PictureLayerImpl> create(int id) |
19 { | 22 { |
20 return make_scoped_ptr(new PictureLayerImpl(id)); | 23 return make_scoped_ptr(new PictureLayerImpl(id)); |
21 } | 24 } |
22 virtual ~PictureLayerImpl(); | 25 virtual ~PictureLayerImpl(); |
23 | 26 |
24 // LayerImpl overrides. | 27 // LayerImpl overrides. |
25 virtual const char* layerTypeAsString() const OVERRIDE; | 28 virtual const char* layerTypeAsString() const OVERRIDE; |
26 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; | 29 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; |
27 virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE; | 30 virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE; |
28 | 31 |
| 32 // PictureLayerTilingClient overrides. |
| 33 virtual scoped_refptr<Tile> CreateTile(PictureLayerTiling*, |
| 34 gfx::Rect) OVERRIDE; |
| 35 |
| 36 // PushPropertiesTo active tree => pending tree |
| 37 void SyncFromActiveLayer(const PictureLayerImpl* other); |
| 38 |
| 39 // Called post-calcDraw. |
| 40 void Update(); |
| 41 |
29 protected: | 42 protected: |
30 PictureLayerImpl(int id); | 43 PictureLayerImpl(int id); |
31 | 44 |
| 45 ScopedPtrVector<PictureLayerTiling> tilings_; |
32 PicturePile pile_; | 46 PicturePile pile_; |
33 | 47 |
34 friend class PictureLayer; | 48 friend class PictureLayer; |
35 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 49 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
36 }; | 50 }; |
37 | 51 |
38 } | 52 } |
39 | 53 |
40 #endif // CC_PICTURE_LAYER_IMPL_H_ | 54 #endif // CC_PICTURE_LAYER_IMPL_H_ |
OLD | NEW |