| 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" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 public PictureLayerTilingClient { | 22 public PictureLayerTilingClient { |
| 23 public: | 23 public: |
| 24 static scoped_ptr<PictureLayerImpl> create(LayerTreeImpl* treeImpl, int id) | 24 static scoped_ptr<PictureLayerImpl> create(LayerTreeImpl* treeImpl, int id) |
| 25 { | 25 { |
| 26 return make_scoped_ptr(new PictureLayerImpl(treeImpl, id)); | 26 return make_scoped_ptr(new PictureLayerImpl(treeImpl, id)); |
| 27 } | 27 } |
| 28 virtual ~PictureLayerImpl(); | 28 virtual ~PictureLayerImpl(); |
| 29 | 29 |
| 30 // LayerImpl overrides. | 30 // LayerImpl overrides. |
| 31 virtual const char* layerTypeAsString() const OVERRIDE; | 31 virtual const char* layerTypeAsString() const OVERRIDE; |
| 32 virtual scoped_ptr<LayerImpl> createLayerImpl( |
| 33 LayerTreeImpl* treeImpl) OVERRIDE; |
| 34 virtual void pushPropertiesTo(LayerImpl* layer) OVERRIDE; |
| 32 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; | 35 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; |
| 33 virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE; | 36 virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE; |
| 34 virtual void didUpdateTransforms() OVERRIDE; | 37 virtual void didUpdateTransforms() OVERRIDE; |
| 35 virtual void didBecomeActive() OVERRIDE; | 38 virtual void didBecomeActive() OVERRIDE; |
| 36 virtual void didLoseOutputSurface() OVERRIDE; | 39 virtual void didLoseOutputSurface() OVERRIDE; |
| 37 virtual void calculateContentsScale( | 40 virtual void calculateContentsScale( |
| 38 float ideal_contents_scale, | 41 float ideal_contents_scale, |
| 39 float* contents_scale_x, | 42 float* contents_scale_x, |
| 40 float* contents_scale_y, | 43 float* contents_scale_y, |
| 41 gfx::Size* content_bounds) OVERRIDE; | 44 gfx::Size* content_bounds) OVERRIDE; |
| 42 virtual skia::RefPtr<SkPicture> getPicture() OVERRIDE; | 45 virtual skia::RefPtr<SkPicture> getPicture() OVERRIDE; |
| 43 | 46 |
| 44 // PictureLayerTilingClient overrides. | 47 // PictureLayerTilingClient overrides. |
| 45 virtual scoped_refptr<Tile> CreateTile(PictureLayerTiling*, | 48 virtual scoped_refptr<Tile> CreateTile(PictureLayerTiling*, |
| 46 gfx::Rect) OVERRIDE; | 49 gfx::Rect) OVERRIDE; |
| 47 virtual void UpdatePile(Tile* tile) OVERRIDE; | 50 virtual void UpdatePile(Tile* tile) OVERRIDE; |
| 48 | 51 |
| 49 // PushPropertiesTo active tree => pending tree | 52 // PushPropertiesTo active tree => pending tree |
| 50 void SyncFromActiveLayer(); | 53 void SyncFromActiveLayer(); |
| 51 void SyncTiling(const PictureLayerTiling* tiling); | 54 void SyncTiling(const PictureLayerTiling* tiling); |
| 52 | 55 |
| 56 void CreateTilingSet(); |
| 57 void TransferTilingSet(scoped_ptr<PictureLayerTilingSet> tilings); |
| 58 |
| 53 // Mask-related functions | 59 // Mask-related functions |
| 54 void SetIsMask(bool is_mask); | 60 void SetIsMask(bool is_mask); |
| 55 virtual ResourceProvider::ResourceId contentsResourceId() const OVERRIDE; | 61 virtual ResourceProvider::ResourceId contentsResourceId() const OVERRIDE; |
| 56 | 62 |
| 57 virtual bool areVisibleResourcesReady() const OVERRIDE; | 63 virtual bool areVisibleResourcesReady() const OVERRIDE; |
| 58 | 64 |
| 59 protected: | 65 protected: |
| 60 PictureLayerImpl(LayerTreeImpl* treeImpl, int id); | 66 PictureLayerImpl(LayerTreeImpl* treeImpl, int id); |
| 61 PictureLayerTiling* AddTiling(float contents_scale); | 67 PictureLayerTiling* AddTiling(float contents_scale); |
| 62 void SyncFromActiveLayer(const PictureLayerImpl* other); | 68 void SyncFromActiveLayer(const PictureLayerImpl* other); |
| 63 gfx::Size TileSize() const; | 69 gfx::Size TileSize() const; |
| 64 void ManageTilings(float ideal_contents_scale); | 70 void ManageTilings(float ideal_contents_scale); |
| 65 void CleanUpUnusedTilings(std::vector<PictureLayerTiling*> used_tilings); | 71 void CleanUpUnusedTilings(std::vector<PictureLayerTiling*> used_tilings); |
| 66 | 72 |
| 67 PictureLayerTilingSet tilings_; | 73 scoped_ptr<PictureLayerTilingSet> tilings_; |
| 68 scoped_refptr<PicturePileImpl> pile_; | 74 scoped_refptr<PicturePileImpl> pile_; |
| 69 Region invalidation_; | 75 Region invalidation_; |
| 70 | 76 |
| 71 gfx::Transform last_screen_space_transform_; | 77 gfx::Transform last_screen_space_transform_; |
| 72 double last_update_time_; | 78 double last_update_time_; |
| 73 gfx::Size last_bounds_; | 79 gfx::Size last_bounds_; |
| 74 gfx::Size last_content_bounds_; | 80 gfx::Size last_content_bounds_; |
| 75 float last_content_scale_; | 81 float last_content_scale_; |
| 76 float ideal_contents_scale_; | 82 float ideal_contents_scale_; |
| 77 bool is_mask_; | 83 bool is_mask_; |
| 78 | 84 |
| 79 friend class PictureLayer; | 85 friend class PictureLayer; |
| 80 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 86 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
| 81 }; | 87 }; |
| 82 | 88 |
| 83 } | 89 } |
| 84 | 90 |
| 85 #endif // CC_PICTURE_LAYER_IMPL_H_ | 91 #endif // CC_PICTURE_LAYER_IMPL_H_ |
| OLD | NEW |