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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 const Region* GetPendingInvalidation() override; | 59 const Region* GetPendingInvalidation() override; |
60 const PictureLayerTiling* GetPendingOrActiveTwinTiling( | 60 const PictureLayerTiling* GetPendingOrActiveTwinTiling( |
61 const PictureLayerTiling* tiling) const override; | 61 const PictureLayerTiling* tiling) const override; |
62 bool HasValidTilePriorities() const override; | 62 bool HasValidTilePriorities() const override; |
63 bool RequiresHighResToDraw() const override; | 63 bool RequiresHighResToDraw() const override; |
64 gfx::Rect GetEnclosingRectInTargetSpace() const override; | 64 gfx::Rect GetEnclosingRectInTargetSpace() const override; |
65 | 65 |
66 void set_gpu_raster_max_texture_size(gfx::Size gpu_raster_max_texture_size) { | 66 void set_gpu_raster_max_texture_size(gfx::Size gpu_raster_max_texture_size) { |
67 gpu_raster_max_texture_size_ = gpu_raster_max_texture_size; | 67 gpu_raster_max_texture_size_ = gpu_raster_max_texture_size; |
68 } | 68 } |
69 void UpdateRasterSource(scoped_refptr<RasterSource> raster_source, | 69 void UpdateRasterSource(scoped_refptr<DisplayListRasterSource> raster_source, |
70 Region* new_invalidation, | 70 Region* new_invalidation, |
71 const PictureLayerTilingSet* pending_set); | 71 const PictureLayerTilingSet* pending_set); |
72 bool UpdateTiles(bool resourceless_software_draw); | 72 bool UpdateTiles(bool resourceless_software_draw); |
73 void UpdateCanUseLCDTextAfterCommit(); | 73 void UpdateCanUseLCDTextAfterCommit(); |
74 bool RasterSourceUsesLCDText() const; | 74 bool RasterSourceUsesLCDText() const; |
75 WhichTree GetTree() const; | 75 WhichTree GetTree() const; |
76 | 76 |
77 // Mask-related functions. | 77 // Mask-related functions. |
78 void GetContentsResourceId(ResourceId* resource_id, | 78 void GetContentsResourceId(ResourceId* resource_id, |
79 gfx::Size* resource_size) const override; | 79 gfx::Size* resource_size) const override; |
80 | 80 |
81 void SetNearestNeighbor(bool nearest_neighbor); | 81 void SetNearestNeighbor(bool nearest_neighbor); |
82 | 82 |
83 size_t GPUMemoryUsageInBytes() const override; | 83 size_t GPUMemoryUsageInBytes() const override; |
84 | 84 |
85 void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) override; | 85 void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) override; |
86 | 86 |
87 bool CanHaveTilings() const; | 87 bool CanHaveTilings() const; |
88 | 88 |
89 PictureLayerTilingSet* picture_layer_tiling_set() { return tilings_.get(); } | 89 PictureLayerTilingSet* picture_layer_tiling_set() { return tilings_.get(); } |
90 | 90 |
91 // Functions used by tile manager. | 91 // Functions used by tile manager. |
92 PictureLayerImpl* GetPendingOrActiveTwinLayer() const; | 92 PictureLayerImpl* GetPendingOrActiveTwinLayer() const; |
93 bool IsOnActiveOrPendingTree() const; | 93 bool IsOnActiveOrPendingTree() const; |
94 | 94 |
95 // Used for benchmarking | 95 // Used for benchmarking |
96 RasterSource* GetRasterSource() const { return raster_source_.get(); } | 96 DisplayListRasterSource* GetRasterSource() const { |
| 97 return raster_source_.get(); |
| 98 } |
97 | 99 |
98 protected: | 100 protected: |
99 friend class LayerRasterTileIterator; | 101 friend class LayerRasterTileIterator; |
100 using TileRequirementCheck = bool (PictureLayerTiling::*)(const Tile*) const; | 102 using TileRequirementCheck = bool (PictureLayerTiling::*)(const Tile*) const; |
101 | 103 |
102 PictureLayerImpl(LayerTreeImpl* tree_impl, | 104 PictureLayerImpl(LayerTreeImpl* tree_impl, |
103 int id, | 105 int id, |
104 bool is_mask, | 106 bool is_mask, |
105 scoped_refptr<SyncedScrollOffset> scroll_offset); | 107 scoped_refptr<SyncedScrollOffset> scroll_offset); |
106 PictureLayerTiling* AddTiling(float contents_scale); | 108 PictureLayerTiling* AddTiling(float contents_scale); |
(...skipping 18 matching lines...) Expand all Loading... |
125 std::vector<PrioritizedTile>* prioritized_tiles) const override; | 127 std::vector<PrioritizedTile>* prioritized_tiles) const override; |
126 void AsValueInto(base::trace_event::TracedValue* dict) const override; | 128 void AsValueInto(base::trace_event::TracedValue* dict) const override; |
127 | 129 |
128 virtual void UpdateIdealScales(); | 130 virtual void UpdateIdealScales(); |
129 float MaximumTilingContentsScale() const; | 131 float MaximumTilingContentsScale() const; |
130 scoped_ptr<PictureLayerTilingSet> CreatePictureLayerTilingSet(); | 132 scoped_ptr<PictureLayerTilingSet> CreatePictureLayerTilingSet(); |
131 | 133 |
132 PictureLayerImpl* twin_layer_; | 134 PictureLayerImpl* twin_layer_; |
133 | 135 |
134 scoped_ptr<PictureLayerTilingSet> tilings_; | 136 scoped_ptr<PictureLayerTilingSet> tilings_; |
135 scoped_refptr<RasterSource> raster_source_; | 137 scoped_refptr<DisplayListRasterSource> raster_source_; |
136 Region invalidation_; | 138 Region invalidation_; |
137 | 139 |
138 float ideal_page_scale_; | 140 float ideal_page_scale_; |
139 float ideal_device_scale_; | 141 float ideal_device_scale_; |
140 float ideal_source_scale_; | 142 float ideal_source_scale_; |
141 float ideal_contents_scale_; | 143 float ideal_contents_scale_; |
142 | 144 |
143 float raster_page_scale_; | 145 float raster_page_scale_; |
144 float raster_device_scale_; | 146 float raster_device_scale_; |
145 float raster_source_scale_; | 147 float raster_source_scale_; |
(...skipping 24 matching lines...) Expand all Loading... |
170 // of comparing pointers, since objects pointed to are not guaranteed to | 172 // of comparing pointers, since objects pointed to are not guaranteed to |
171 // exist. | 173 // exist. |
172 std::vector<PictureLayerTiling*> last_append_quads_tilings_; | 174 std::vector<PictureLayerTiling*> last_append_quads_tilings_; |
173 | 175 |
174 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 176 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
175 }; | 177 }; |
176 | 178 |
177 } // namespace cc | 179 } // namespace cc |
178 | 180 |
179 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 181 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
OLD | NEW |