| 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_LAYERS_PICTURE_LAYER_IMPL_H_ | 5 #ifndef CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
| 6 #define CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 6 #define CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 const Region* GetPendingInvalidation() override; | 55 const Region* GetPendingInvalidation() override; |
| 56 const PictureLayerTiling* GetPendingOrActiveTwinTiling( | 56 const PictureLayerTiling* GetPendingOrActiveTwinTiling( |
| 57 const PictureLayerTiling* tiling) const override; | 57 const PictureLayerTiling* tiling) const override; |
| 58 bool HasValidTilePriorities() const override; | 58 bool HasValidTilePriorities() const override; |
| 59 bool RequiresHighResToDraw() const override; | 59 bool RequiresHighResToDraw() const override; |
| 60 gfx::Rect GetEnclosingRectInTargetSpace() const override; | 60 gfx::Rect GetEnclosingRectInTargetSpace() const override; |
| 61 | 61 |
| 62 void set_gpu_raster_max_texture_size(gfx::Size gpu_raster_max_texture_size) { | 62 void set_gpu_raster_max_texture_size(gfx::Size gpu_raster_max_texture_size) { |
| 63 gpu_raster_max_texture_size_ = gpu_raster_max_texture_size; | 63 gpu_raster_max_texture_size_ = gpu_raster_max_texture_size; |
| 64 } | 64 } |
| 65 void UpdateRasterSource(scoped_refptr<DisplayListRasterSource> raster_source, | 65 void UpdateRasterSource(scoped_refptr<RasterSource> raster_source, |
| 66 Region* new_invalidation, | 66 Region* new_invalidation, |
| 67 const PictureLayerTilingSet* pending_set); | 67 const PictureLayerTilingSet* pending_set); |
| 68 bool UpdateTiles(); | 68 bool UpdateTiles(); |
| 69 void UpdateCanUseLCDTextAfterCommit(); | 69 void UpdateCanUseLCDTextAfterCommit(); |
| 70 bool RasterSourceUsesLCDText() const; | 70 bool RasterSourceUsesLCDText() const; |
| 71 WhichTree GetTree() const; | 71 WhichTree GetTree() const; |
| 72 | 72 |
| 73 // Mask-related functions. | 73 // Mask-related functions. |
| 74 void GetContentsResourceId(ResourceId* resource_id, | 74 void GetContentsResourceId(ResourceId* resource_id, |
| 75 gfx::Size* resource_size) const override; | 75 gfx::Size* resource_size) const override; |
| 76 | 76 |
| 77 void SetNearestNeighbor(bool nearest_neighbor); | 77 void SetNearestNeighbor(bool nearest_neighbor); |
| 78 | 78 |
| 79 size_t GPUMemoryUsageInBytes() const override; | 79 size_t GPUMemoryUsageInBytes() const override; |
| 80 | 80 |
| 81 void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) override; | 81 void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) override; |
| 82 | 82 |
| 83 bool CanHaveTilings() const; | 83 bool CanHaveTilings() const; |
| 84 | 84 |
| 85 PictureLayerTilingSet* picture_layer_tiling_set() { return tilings_.get(); } | 85 PictureLayerTilingSet* picture_layer_tiling_set() { return tilings_.get(); } |
| 86 | 86 |
| 87 // Functions used by tile manager. | 87 // Functions used by tile manager. |
| 88 PictureLayerImpl* GetPendingOrActiveTwinLayer() const; | 88 PictureLayerImpl* GetPendingOrActiveTwinLayer() const; |
| 89 bool IsOnActiveOrPendingTree() const; | 89 bool IsOnActiveOrPendingTree() const; |
| 90 | 90 |
| 91 // Used for benchmarking | 91 // Used for benchmarking |
| 92 DisplayListRasterSource* GetRasterSource() const { | 92 RasterSource* GetRasterSource() const { return raster_source_.get(); } |
| 93 return raster_source_.get(); | |
| 94 } | |
| 95 | 93 |
| 96 protected: | 94 protected: |
| 97 friend class LayerRasterTileIterator; | 95 friend class LayerRasterTileIterator; |
| 98 using TileRequirementCheck = bool (PictureLayerTiling::*)(const Tile*) const; | 96 using TileRequirementCheck = bool (PictureLayerTiling::*)(const Tile*) const; |
| 99 | 97 |
| 100 PictureLayerImpl(LayerTreeImpl* tree_impl, int id, bool is_mask); | 98 PictureLayerImpl(LayerTreeImpl* tree_impl, int id, bool is_mask); |
| 101 PictureLayerTiling* AddTiling(float contents_scale); | 99 PictureLayerTiling* AddTiling(float contents_scale); |
| 102 void RemoveAllTilings(); | 100 void RemoveAllTilings(); |
| 103 void AddTilingsForRasterScale(); | 101 void AddTilingsForRasterScale(); |
| 104 void AddLowResolutionTilingIfNeeded(); | 102 void AddLowResolutionTilingIfNeeded(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 120 std::vector<PrioritizedTile>* prioritized_tiles) const override; | 118 std::vector<PrioritizedTile>* prioritized_tiles) const override; |
| 121 void AsValueInto(base::trace_event::TracedValue* dict) const override; | 119 void AsValueInto(base::trace_event::TracedValue* dict) const override; |
| 122 | 120 |
| 123 virtual void UpdateIdealScales(); | 121 virtual void UpdateIdealScales(); |
| 124 float MaximumTilingContentsScale() const; | 122 float MaximumTilingContentsScale() const; |
| 125 scoped_ptr<PictureLayerTilingSet> CreatePictureLayerTilingSet(); | 123 scoped_ptr<PictureLayerTilingSet> CreatePictureLayerTilingSet(); |
| 126 | 124 |
| 127 PictureLayerImpl* twin_layer_; | 125 PictureLayerImpl* twin_layer_; |
| 128 | 126 |
| 129 scoped_ptr<PictureLayerTilingSet> tilings_; | 127 scoped_ptr<PictureLayerTilingSet> tilings_; |
| 130 scoped_refptr<DisplayListRasterSource> raster_source_; | 128 scoped_refptr<RasterSource> raster_source_; |
| 131 Region invalidation_; | 129 Region invalidation_; |
| 132 | 130 |
| 133 float ideal_page_scale_; | 131 float ideal_page_scale_; |
| 134 float ideal_device_scale_; | 132 float ideal_device_scale_; |
| 135 float ideal_source_scale_; | 133 float ideal_source_scale_; |
| 136 float ideal_contents_scale_; | 134 float ideal_contents_scale_; |
| 137 | 135 |
| 138 float raster_page_scale_; | 136 float raster_page_scale_; |
| 139 float raster_device_scale_; | 137 float raster_device_scale_; |
| 140 float raster_source_scale_; | 138 float raster_source_scale_; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 159 // of comparing pointers, since objects pointed to are not guaranteed to | 157 // of comparing pointers, since objects pointed to are not guaranteed to |
| 160 // exist. | 158 // exist. |
| 161 std::vector<PictureLayerTiling*> last_append_quads_tilings_; | 159 std::vector<PictureLayerTiling*> last_append_quads_tilings_; |
| 162 | 160 |
| 163 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 161 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
| 164 }; | 162 }; |
| 165 | 163 |
| 166 } // namespace cc | 164 } // namespace cc |
| 167 | 165 |
| 168 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 166 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
| OLD | NEW |