| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_LAYERS_TILED_LAYER_H_ | 5 #ifndef CC_LAYERS_TILED_LAYER_H_ |
| 6 #define CC_LAYERS_TILED_LAYER_H_ | 6 #define CC_LAYERS_TILED_LAYER_H_ |
| 7 | 7 |
| 8 #include "cc/base/cc_export.h" | 8 #include "cc/base/cc_export.h" |
| 9 #include "cc/layers/contents_scaling_layer.h" | 9 #include "cc/layers/contents_scaling_layer.h" |
| 10 #include "cc/resources/layer_tiling_data.h" | 10 #include "cc/resources/layer_tiling_data.h" |
| 11 #include "cc/resources/resource_format.h" | 11 #include "cc/resources/resource_format.h" |
| 12 | 12 |
| 13 namespace cc { | 13 namespace cc { |
| 14 class LayerUpdater; | 14 class LayerUpdater; |
| 15 class PrioritizedResourceManager; | 15 class PrioritizedResourceManager; |
| 16 class PrioritizedResource; | 16 class PrioritizedResource; |
| 17 class UpdatableTile; | 17 class UpdatableTile; |
| 18 | 18 |
| 19 class CC_EXPORT TiledLayer : public ContentsScalingLayer { | 19 class CC_EXPORT TiledLayer : public ContentsScalingLayer { |
| 20 public: | 20 public: |
| 21 enum TilingOption { | 21 enum TilingOption { |
| 22 ALWAYS_TILE, | 22 ALWAYS_TILE, |
| 23 NEVER_TILE, | 23 NEVER_TILE, |
| 24 AUTO_TILE, | 24 AUTO_TILE, |
| 25 }; | 25 }; |
| 26 | 26 |
| 27 // Layer implementation. | 27 // Layer implementation. |
| 28 virtual void SetIsMask(bool is_mask) OVERRIDE; | 28 virtual void SetIsMask(bool is_mask) OVERRIDE; |
| 29 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; | 29 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; |
| 30 virtual bool DrawsContent() const OVERRIDE; | |
| 31 virtual void ReduceMemoryUsage() OVERRIDE; | 30 virtual void ReduceMemoryUsage() OVERRIDE; |
| 32 virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect) OVERRIDE; | 31 virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect) OVERRIDE; |
| 33 virtual void SetLayerTreeHost(LayerTreeHost* layer_tree_host) OVERRIDE; | 32 virtual void SetLayerTreeHost(LayerTreeHost* layer_tree_host) OVERRIDE; |
| 34 virtual void SetTexturePriorities(const PriorityCalculator& priority_calc) | 33 virtual void SetTexturePriorities(const PriorityCalculator& priority_calc) |
| 35 OVERRIDE; | 34 OVERRIDE; |
| 36 virtual Region VisibleContentOpaqueRegion() const OVERRIDE; | 35 virtual Region VisibleContentOpaqueRegion() const OVERRIDE; |
| 37 virtual bool Update(ResourceUpdateQueue* queue, | 36 virtual bool Update(ResourceUpdateQueue* queue, |
| 38 const OcclusionTracker<Layer>* occlusion) OVERRIDE; | 37 const OcclusionTracker<Layer>* occlusion) OVERRIDE; |
| 39 virtual void OnOutputSurfaceCreated() OVERRIDE; | 38 virtual void OnOutputSurfaceCreated() OVERRIDE; |
| 40 | 39 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 61 | 60 |
| 62 // Reset state on tiles that will be used for updating the layer. | 61 // Reset state on tiles that will be used for updating the layer. |
| 63 void ResetUpdateState(); | 62 void ResetUpdateState(); |
| 64 | 63 |
| 65 // After preparing an update, returns true if more painting is needed. | 64 // After preparing an update, returns true if more painting is needed. |
| 66 bool NeedsIdlePaint(); | 65 bool NeedsIdlePaint(); |
| 67 gfx::Rect IdlePaintRect(); | 66 gfx::Rect IdlePaintRect(); |
| 68 | 67 |
| 69 bool SkipsDraw() const { return skips_draw_; } | 68 bool SkipsDraw() const { return skips_draw_; } |
| 70 | 69 |
| 70 virtual bool HasDrawableContent() const OVERRIDE; |
| 71 |
| 71 // Virtual for testing | 72 // Virtual for testing |
| 72 virtual PrioritizedResourceManager* ResourceManager(); | 73 virtual PrioritizedResourceManager* ResourceManager(); |
| 73 const LayerTilingData* TilerForTesting() const { return tiler_.get(); } | 74 const LayerTilingData* TilerForTesting() const { return tiler_.get(); } |
| 74 const PrioritizedResource* ResourceAtForTesting(int i, int j) const; | 75 const PrioritizedResource* ResourceAtForTesting(int i, int j) const; |
| 75 | 76 |
| 76 private: | 77 private: |
| 77 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) | 78 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) |
| 78 OVERRIDE; | 79 OVERRIDE; |
| 79 | 80 |
| 80 void CreateTilerIfNeeded(); | 81 void CreateTilerIfNeeded(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 139 |
| 139 TilingOption tiling_option_; | 140 TilingOption tiling_option_; |
| 140 scoped_ptr<LayerTilingData> tiler_; | 141 scoped_ptr<LayerTilingData> tiler_; |
| 141 | 142 |
| 142 DISALLOW_COPY_AND_ASSIGN(TiledLayer); | 143 DISALLOW_COPY_AND_ASSIGN(TiledLayer); |
| 143 }; | 144 }; |
| 144 | 145 |
| 145 } // namespace cc | 146 } // namespace cc |
| 146 | 147 |
| 147 #endif // CC_LAYERS_TILED_LAYER_H_ | 148 #endif // CC_LAYERS_TILED_LAYER_H_ |
| OLD | NEW |