| 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 | 12 |
| 12 namespace cc { | 13 namespace cc { |
| 13 class LayerUpdater; | 14 class LayerUpdater; |
| 14 class PrioritizedResourceManager; | 15 class PrioritizedResourceManager; |
| 15 class PrioritizedResource; | 16 class PrioritizedResource; |
| 16 class UpdatableTile; | 17 class UpdatableTile; |
| 17 | 18 |
| 18 class CC_EXPORT TiledLayer : public ContentsScalingLayer { | 19 class CC_EXPORT TiledLayer : public ContentsScalingLayer { |
| 19 public: | 20 public: |
| 20 enum TilingOption { | 21 enum TilingOption { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 38 | 39 |
| 39 protected: | 40 protected: |
| 40 TiledLayer(); | 41 TiledLayer(); |
| 41 virtual ~TiledLayer(); | 42 virtual ~TiledLayer(); |
| 42 | 43 |
| 43 void UpdateTileSizeAndTilingOption(); | 44 void UpdateTileSizeAndTilingOption(); |
| 44 void UpdateBounds(); | 45 void UpdateBounds(); |
| 45 | 46 |
| 46 // Exposed to subclasses for testing. | 47 // Exposed to subclasses for testing. |
| 47 void SetTileSize(gfx::Size size); | 48 void SetTileSize(gfx::Size size); |
| 48 void SetTextureFormat(unsigned texture_format) { | 49 void SetTextureFormat(ResourceFormat texture_format) { |
| 49 texture_format_ = texture_format; | 50 texture_format_ = texture_format; |
| 50 } | 51 } |
| 51 void SetBorderTexelOption(LayerTilingData::BorderTexelOption option); | 52 void SetBorderTexelOption(LayerTilingData::BorderTexelOption option); |
| 52 size_t NumPaintedTiles() { return tiler_->tiles().size(); } | 53 size_t NumPaintedTiles() { return tiler_->tiles().size(); } |
| 53 | 54 |
| 54 virtual LayerUpdater* Updater() const = 0; | 55 virtual LayerUpdater* Updater() const = 0; |
| 55 virtual void CreateUpdaterIfNeeded() = 0; | 56 virtual void CreateUpdaterIfNeeded() = 0; |
| 56 | 57 |
| 57 // Set invalidations to be potentially repainted during Update(). | 58 // Set invalidations to be potentially repainted during Update(). |
| 58 void InvalidateContentRect(gfx::Rect content_rect); | 59 void InvalidateContentRect(gfx::Rect content_rect); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 int bottom, | 114 int bottom, |
| 114 ResourceUpdateQueue* queue, | 115 ResourceUpdateQueue* queue, |
| 115 const OcclusionTracker* occlusion); | 116 const OcclusionTracker* occlusion); |
| 116 void UpdateScrollPrediction(); | 117 void UpdateScrollPrediction(); |
| 117 | 118 |
| 118 UpdatableTile* TileAt(int i, int j) const; | 119 UpdatableTile* TileAt(int i, int j) const; |
| 119 UpdatableTile* CreateTile(int i, int j); | 120 UpdatableTile* CreateTile(int i, int j); |
| 120 | 121 |
| 121 bool IsSmallAnimatedLayer() const; | 122 bool IsSmallAnimatedLayer() const; |
| 122 | 123 |
| 123 unsigned texture_format_; | 124 ResourceFormat texture_format_; |
| 124 bool skips_draw_; | 125 bool skips_draw_; |
| 125 bool failed_update_; | 126 bool failed_update_; |
| 126 | 127 |
| 127 // Used for predictive painting. | 128 // Used for predictive painting. |
| 128 gfx::Vector2d predicted_scroll_; | 129 gfx::Vector2d predicted_scroll_; |
| 129 gfx::Rect predicted_visible_rect_; | 130 gfx::Rect predicted_visible_rect_; |
| 130 gfx::Rect previous_visible_rect_; | 131 gfx::Rect previous_visible_rect_; |
| 131 gfx::Size previous_content_bounds_; | 132 gfx::Size previous_content_bounds_; |
| 132 | 133 |
| 133 TilingOption tiling_option_; | 134 TilingOption tiling_option_; |
| 134 scoped_ptr<LayerTilingData> tiler_; | 135 scoped_ptr<LayerTilingData> tiler_; |
| 135 | 136 |
| 136 DISALLOW_COPY_AND_ASSIGN(TiledLayer); | 137 DISALLOW_COPY_AND_ASSIGN(TiledLayer); |
| 137 }; | 138 }; |
| 138 | 139 |
| 139 } // namespace cc | 140 } // namespace cc |
| 140 | 141 |
| 141 #endif // CC_LAYERS_TILED_LAYER_H_ | 142 #endif // CC_LAYERS_TILED_LAYER_H_ |
| OLD | NEW |