| 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" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 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; | 30 virtual bool DrawsContent() const OVERRIDE; |
| 31 virtual void ReduceMemoryUsage() OVERRIDE; | 31 virtual void ReduceMemoryUsage() OVERRIDE; |
| 32 virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect) OVERRIDE; | 32 virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect) OVERRIDE; |
| 33 virtual void SetLayerTreeHost(LayerTreeHost* layer_tree_host) OVERRIDE; | 33 virtual void SetLayerTreeHost(LayerTreeHost* layer_tree_host) OVERRIDE; |
| 34 virtual void SetTexturePriorities(const PriorityCalculator& priority_calc) | 34 virtual void SetTexturePriorities(const PriorityCalculator& priority_calc) |
| 35 OVERRIDE; | 35 OVERRIDE; |
| 36 virtual Region VisibleContentOpaqueRegion() const OVERRIDE; | 36 virtual Region VisibleContentOpaqueRegion() const OVERRIDE; |
| 37 virtual bool Update(ResourceUpdateQueue* queue, | 37 virtual bool Update(ResourceUpdateQueue* queue, |
| 38 const OcclusionTracker* occlusion) OVERRIDE; | 38 const OcclusionTracker<Layer>* occlusion) OVERRIDE; |
| 39 virtual void OnOutputSurfaceCreated() OVERRIDE; | 39 virtual void OnOutputSurfaceCreated() OVERRIDE; |
| 40 | 40 |
| 41 protected: | 41 protected: |
| 42 TiledLayer(); | 42 TiledLayer(); |
| 43 virtual ~TiledLayer(); | 43 virtual ~TiledLayer(); |
| 44 | 44 |
| 45 void UpdateTileSizeAndTilingOption(); | 45 void UpdateTileSizeAndTilingOption(); |
| 46 void UpdateBounds(); | 46 void UpdateBounds(); |
| 47 | 47 |
| 48 // Exposed to subclasses for testing. | 48 // Exposed to subclasses for testing. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 78 OVERRIDE; | 78 OVERRIDE; |
| 79 | 79 |
| 80 void CreateTilerIfNeeded(); | 80 void CreateTilerIfNeeded(); |
| 81 void set_tiling_option(TilingOption tiling_option) { | 81 void set_tiling_option(TilingOption tiling_option) { |
| 82 tiling_option_ = tiling_option; | 82 tiling_option_ = tiling_option; |
| 83 } | 83 } |
| 84 | 84 |
| 85 bool TileOnlyNeedsPartialUpdate(UpdatableTile* tile); | 85 bool TileOnlyNeedsPartialUpdate(UpdatableTile* tile); |
| 86 bool TileNeedsBufferedUpdate(UpdatableTile* tile); | 86 bool TileNeedsBufferedUpdate(UpdatableTile* tile); |
| 87 | 87 |
| 88 void MarkOcclusionsAndRequestTextures(int left, | 88 void MarkOcclusionsAndRequestTextures( |
| 89 int top, | 89 int left, |
| 90 int right, | 90 int top, |
| 91 int bottom, | 91 int right, |
| 92 const OcclusionTracker* occlusion); | 92 int bottom, |
| 93 const OcclusionTracker<Layer>* occlusion); |
| 93 | 94 |
| 94 bool UpdateTiles(int left, | 95 bool UpdateTiles(int left, |
| 95 int top, | 96 int top, |
| 96 int right, | 97 int right, |
| 97 int bottom, | 98 int bottom, |
| 98 ResourceUpdateQueue* queue, | 99 ResourceUpdateQueue* queue, |
| 99 const OcclusionTracker* occlusion, | 100 const OcclusionTracker<Layer>* occlusion, |
| 100 bool* did_paint); | 101 bool* did_paint); |
| 101 bool HaveTexturesForTiles(int left, | 102 bool HaveTexturesForTiles(int left, |
| 102 int top, | 103 int top, |
| 103 int right, | 104 int right, |
| 104 int bottom, | 105 int bottom, |
| 105 bool ignore_occlusions); | 106 bool ignore_occlusions); |
| 106 void MarkTilesForUpdate(gfx::Rect* update_rect, | 107 void MarkTilesForUpdate(gfx::Rect* update_rect, |
| 107 gfx::Rect* paint_rect, | 108 gfx::Rect* paint_rect, |
| 108 int left, | 109 int left, |
| 109 int top, | 110 int top, |
| 110 int right, | 111 int right, |
| 111 int bottom, | 112 int bottom, |
| 112 bool ignore_occlusions); | 113 bool ignore_occlusions); |
| 113 void UpdateTileTextures(const gfx::Rect& update_rect, | 114 void UpdateTileTextures(const gfx::Rect& update_rect, |
| 114 const gfx::Rect& paint_rect, | 115 const gfx::Rect& paint_rect, |
| 115 int left, | 116 int left, |
| 116 int top, | 117 int top, |
| 117 int right, | 118 int right, |
| 118 int bottom, | 119 int bottom, |
| 119 ResourceUpdateQueue* queue, | 120 ResourceUpdateQueue* queue, |
| 120 const OcclusionTracker* occlusion); | 121 const OcclusionTracker<Layer>* occlusion); |
| 121 void UpdateScrollPrediction(); | 122 void UpdateScrollPrediction(); |
| 122 | 123 |
| 123 UpdatableTile* TileAt(int i, int j) const; | 124 UpdatableTile* TileAt(int i, int j) const; |
| 124 UpdatableTile* CreateTile(int i, int j); | 125 UpdatableTile* CreateTile(int i, int j); |
| 125 | 126 |
| 126 bool IsSmallAnimatedLayer() const; | 127 bool IsSmallAnimatedLayer() const; |
| 127 | 128 |
| 128 ResourceFormat texture_format_; | 129 ResourceFormat texture_format_; |
| 129 bool skips_draw_; | 130 bool skips_draw_; |
| 130 bool failed_update_; | 131 bool failed_update_; |
| 131 | 132 |
| 132 // Used for predictive painting. | 133 // Used for predictive painting. |
| 133 gfx::Vector2d predicted_scroll_; | 134 gfx::Vector2d predicted_scroll_; |
| 134 gfx::Rect predicted_visible_rect_; | 135 gfx::Rect predicted_visible_rect_; |
| 135 gfx::Rect previous_visible_rect_; | 136 gfx::Rect previous_visible_rect_; |
| 136 gfx::Size previous_content_bounds_; | 137 gfx::Size previous_content_bounds_; |
| 137 | 138 |
| 138 TilingOption tiling_option_; | 139 TilingOption tiling_option_; |
| 139 scoped_ptr<LayerTilingData> tiler_; | 140 scoped_ptr<LayerTilingData> tiler_; |
| 140 | 141 |
| 141 DISALLOW_COPY_AND_ASSIGN(TiledLayer); | 142 DISALLOW_COPY_AND_ASSIGN(TiledLayer); |
| 142 }; | 143 }; |
| 143 | 144 |
| 144 } // namespace cc | 145 } // namespace cc |
| 145 | 146 |
| 146 #endif // CC_LAYERS_TILED_LAYER_H_ | 147 #endif // CC_LAYERS_TILED_LAYER_H_ |
| OLD | NEW |