[email protected] | d98c024 | 2012-11-08 06:22:35 | [diff] [blame] | 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. | ||||
4 | |||||
5 | #ifndef CC_PICTURE_LAYER_IMPL_H_ | ||||
6 | #define CC_PICTURE_LAYER_IMPL_H_ | ||||
7 | |||||
8 | #include "cc/layer_impl.h" | ||||
[email protected] | 9b18c10 | 2012-11-15 19:57:03 | [diff] [blame^] | 9 | #include "cc/picture_layer_tiling.h" |
[email protected] | d98c024 | 2012-11-08 06:22:35 | [diff] [blame] | 10 | #include "cc/picture_pile.h" |
[email protected] | 9b18c10 | 2012-11-15 19:57:03 | [diff] [blame^] | 11 | #include "cc/scoped_ptr_vector.h" |
[email protected] | d98c024 | 2012-11-08 06:22:35 | [diff] [blame] | 12 | |
13 | namespace cc { | ||||
14 | |||||
[email protected] | 3621e18 | 2012-11-09 22:37:09 | [diff] [blame] | 15 | struct AppendQuadsData; |
16 | class QuadSink; | ||||
17 | |||||
[email protected] | 9b18c10 | 2012-11-15 19:57:03 | [diff] [blame^] | 18 | class CC_EXPORT PictureLayerImpl : public LayerImpl, |
19 | public PictureLayerTilingClient { | ||||
[email protected] | d98c024 | 2012-11-08 06:22:35 | [diff] [blame] | 20 | public: |
21 | static scoped_ptr<PictureLayerImpl> create(int id) | ||||
22 | { | ||||
23 | return make_scoped_ptr(new PictureLayerImpl(id)); | ||||
24 | } | ||||
25 | virtual ~PictureLayerImpl(); | ||||
26 | |||||
[email protected] | 3621e18 | 2012-11-09 22:37:09 | [diff] [blame] | 27 | // LayerImpl overrides. |
28 | virtual const char* layerTypeAsString() const OVERRIDE; | ||||
29 | virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; | ||||
30 | virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE; | ||||
31 | |||||
[email protected] | 9b18c10 | 2012-11-15 19:57:03 | [diff] [blame^] | 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 | |||||
[email protected] | d98c024 | 2012-11-08 06:22:35 | [diff] [blame] | 42 | protected: |
43 | PictureLayerImpl(int id); | ||||
44 | |||||
[email protected] | 9b18c10 | 2012-11-15 19:57:03 | [diff] [blame^] | 45 | ScopedPtrVector<PictureLayerTiling> tilings_; |
[email protected] | d98c024 | 2012-11-08 06:22:35 | [diff] [blame] | 46 | PicturePile pile_; |
47 | |||||
48 | friend class PictureLayer; | ||||
49 | DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | ||||
50 | }; | ||||
51 | |||||
52 | } | ||||
53 | |||||
54 | #endif // CC_PICTURE_LAYER_IMPL_H_ |