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_layer_tiling.h" |
10 #include "cc/picture_layer_tiling_set.h" | 10 #include "cc/picture_layer_tiling_set.h" |
11 #include "cc/picture_pile_impl.h" | 11 #include "cc/picture_pile_impl.h" |
12 #include "cc/scoped_ptr_vector.h" | 12 #include "cc/scoped_ptr_vector.h" |
13 | 13 |
14 namespace cc { | 14 namespace cc { |
15 | 15 |
16 struct AppendQuadsData; | 16 struct AppendQuadsData; |
17 class QuadSink; | 17 class QuadSink; |
18 | 18 |
19 class CC_EXPORT PictureLayerImpl : public LayerImpl, | 19 class CC_EXPORT PictureLayerImpl : public LayerImpl, |
20 public PictureLayerTilingClient { | 20 public PictureLayerTilingClient { |
21 public: | 21 public: |
22 static scoped_ptr<PictureLayerImpl> create(LayerTreeHostImpl* host, int id) | 22 static scoped_ptr<PictureLayerImpl> create(LayerTreeImpl* treeImpl, int id) |
23 { | 23 { |
24 return make_scoped_ptr(new PictureLayerImpl(host, id)); | 24 return make_scoped_ptr(new PictureLayerImpl(treeImpl, id)); |
25 } | 25 } |
26 virtual ~PictureLayerImpl(); | 26 virtual ~PictureLayerImpl(); |
27 | 27 |
28 // LayerImpl overrides. | 28 // LayerImpl overrides. |
29 virtual const char* layerTypeAsString() const OVERRIDE; | 29 virtual const char* layerTypeAsString() const OVERRIDE; |
30 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; | 30 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; |
31 virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE; | 31 virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE; |
32 virtual void didUpdateTransforms() OVERRIDE; | 32 virtual void didUpdateTransforms() OVERRIDE; |
33 | 33 |
34 // PictureLayerTilingClient overrides. | 34 // PictureLayerTilingClient overrides. |
35 virtual scoped_refptr<Tile> CreateTile(PictureLayerTiling*, | 35 virtual scoped_refptr<Tile> CreateTile(PictureLayerTiling*, |
36 gfx::Rect) OVERRIDE; | 36 gfx::Rect) OVERRIDE; |
37 | 37 |
38 // PushPropertiesTo active tree => pending tree | 38 // PushPropertiesTo active tree => pending tree |
39 void SyncFromActiveLayer(const PictureLayerImpl* other); | 39 void SyncFromActiveLayer(const PictureLayerImpl* other); |
40 | 40 |
41 protected: | 41 protected: |
42 PictureLayerImpl(LayerTreeHostImpl* host, int id); | 42 PictureLayerImpl(LayerTreeImpl* treeImpl, int id); |
43 | 43 |
44 PictureLayerTilingSet tilings_; | 44 PictureLayerTilingSet tilings_; |
45 scoped_refptr<PicturePileImpl> pile_; | 45 scoped_refptr<PicturePileImpl> pile_; |
46 | 46 |
47 gfx::Transform last_screen_space_transform_; | 47 gfx::Transform last_screen_space_transform_; |
48 double last_update_time_; | 48 double last_update_time_; |
49 gfx::Size last_bounds_; | 49 gfx::Size last_bounds_; |
50 gfx::Size last_content_bounds_; | 50 gfx::Size last_content_bounds_; |
51 float last_content_scale_x_; | 51 float last_content_scale_x_; |
52 float last_content_scale_y_; | 52 float last_content_scale_y_; |
53 | 53 |
54 friend class PictureLayer; | 54 friend class PictureLayer; |
55 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 55 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
56 }; | 56 }; |
57 | 57 |
58 } | 58 } |
59 | 59 |
60 #endif // CC_PICTURE_LAYER_IMPL_H_ | 60 #endif // CC_PICTURE_LAYER_IMPL_H_ |
OLD | NEW |