| 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 } | 48 } |
| 49 ~PictureLayerImpl() override; | 49 ~PictureLayerImpl() override; |
| 50 | 50 |
| 51 bool is_mask() const { return is_mask_; } | 51 bool is_mask() const { return is_mask_; } |
| 52 | 52 |
| 53 // LayerImpl overrides. | 53 // LayerImpl overrides. |
| 54 const char* LayerTypeAsString() const override; | 54 const char* LayerTypeAsString() const override; |
| 55 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; | 55 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
| 56 void PushPropertiesTo(LayerImpl* layer) override; | 56 void PushPropertiesTo(LayerImpl* layer) override; |
| 57 void AppendQuads(RenderPass* render_pass, | 57 void AppendQuads(RenderPass* render_pass, |
| 58 const Occlusion& occlusion_in_content_space, | |
| 59 AppendQuadsData* append_quads_data) override; | 58 AppendQuadsData* append_quads_data) override; |
| 60 bool UpdateTiles(const Occlusion& occlusion_in_content_space, | |
| 61 bool resourceless_software_draw) override; | |
| 62 void NotifyTileStateChanged(const Tile* tile) override; | 59 void NotifyTileStateChanged(const Tile* tile) override; |
| 63 void DidBeginTracing() override; | 60 void DidBeginTracing() override; |
| 64 void ReleaseResources() override; | 61 void ReleaseResources() override; |
| 65 void RecreateResources() override; | 62 void RecreateResources() override; |
| 66 skia::RefPtr<SkPicture> GetPicture() override; | 63 skia::RefPtr<SkPicture> GetPicture() override; |
| 67 | 64 |
| 68 // PictureLayerTilingClient overrides. | 65 // PictureLayerTilingClient overrides. |
| 69 scoped_refptr<Tile> CreateTile(float contents_scale, | 66 scoped_refptr<Tile> CreateTile(float contents_scale, |
| 70 const gfx::Rect& content_rect) override; | 67 const gfx::Rect& content_rect) override; |
| 71 gfx::Size CalculateTileSize(const gfx::Size& content_bounds) const override; | 68 gfx::Size CalculateTileSize(const gfx::Size& content_bounds) const override; |
| 72 const Region* GetPendingInvalidation() override; | 69 const Region* GetPendingInvalidation() override; |
| 73 const PictureLayerTiling* GetPendingOrActiveTwinTiling( | 70 const PictureLayerTiling* GetPendingOrActiveTwinTiling( |
| 74 const PictureLayerTiling* tiling) const override; | 71 const PictureLayerTiling* tiling) const override; |
| 75 PictureLayerTiling* GetRecycledTwinTiling( | 72 PictureLayerTiling* GetRecycledTwinTiling( |
| 76 const PictureLayerTiling* tiling) override; | 73 const PictureLayerTiling* tiling) override; |
| 77 TilePriority::PriorityBin GetMaxTilePriorityBin() const override; | 74 TilePriority::PriorityBin GetMaxTilePriorityBin() const override; |
| 78 WhichTree GetTree() const override; | 75 WhichTree GetTree() const override; |
| 79 bool RequiresHighResToDraw() const override; | 76 bool RequiresHighResToDraw() const override; |
| 80 | 77 |
| 81 void UpdateRasterSource(scoped_refptr<RasterSource> raster_source, | 78 void UpdateRasterSource(scoped_refptr<RasterSource> raster_source, |
| 82 Region* new_invalidation, | 79 Region* new_invalidation, |
| 83 const PictureLayerTilingSet* pending_set); | 80 const PictureLayerTilingSet* pending_set); |
| 81 bool UpdateTiles(bool resourceless_software_draw); |
| 84 | 82 |
| 85 // Mask-related functions. | 83 // Mask-related functions. |
| 86 void GetContentsResourceId(ResourceProvider::ResourceId* resource_id, | 84 void GetContentsResourceId(ResourceProvider::ResourceId* resource_id, |
| 87 gfx::Size* resource_size) const override; | 85 gfx::Size* resource_size) const override; |
| 88 | 86 |
| 89 void SetNearestNeighbor(bool nearest_neighbor); | 87 void SetNearestNeighbor(bool nearest_neighbor); |
| 90 | 88 |
| 91 size_t GPUMemoryUsageInBytes() const override; | 89 size_t GPUMemoryUsageInBytes() const override; |
| 92 | 90 |
| 93 void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) override; | 91 void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) override; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 109 friend class LayerRasterTileIterator; | 107 friend class LayerRasterTileIterator; |
| 110 using TileRequirementCheck = bool (PictureLayerTiling::*)(const Tile*) const; | 108 using TileRequirementCheck = bool (PictureLayerTiling::*)(const Tile*) const; |
| 111 | 109 |
| 112 PictureLayerImpl(LayerTreeImpl* tree_impl, | 110 PictureLayerImpl(LayerTreeImpl* tree_impl, |
| 113 int id, | 111 int id, |
| 114 bool is_mask, | 112 bool is_mask, |
| 115 scoped_refptr<SyncedScrollOffset> scroll_offset); | 113 scoped_refptr<SyncedScrollOffset> scroll_offset); |
| 116 PictureLayerTiling* AddTiling(float contents_scale); | 114 PictureLayerTiling* AddTiling(float contents_scale); |
| 117 void RemoveAllTilings(); | 115 void RemoveAllTilings(); |
| 118 void AddTilingsForRasterScale(); | 116 void AddTilingsForRasterScale(); |
| 119 bool UpdateTilePriorities(const Occlusion& occlusion_in_content_space); | |
| 120 virtual bool ShouldAdjustRasterScale() const; | 117 virtual bool ShouldAdjustRasterScale() const; |
| 121 virtual void RecalculateRasterScales(); | 118 virtual void RecalculateRasterScales(); |
| 122 void CleanUpTilingsOnActiveLayer( | 119 void CleanUpTilingsOnActiveLayer( |
| 123 const std::vector<PictureLayerTiling*>& used_tilings); | 120 const std::vector<PictureLayerTiling*>& used_tilings); |
| 124 float MinimumContentsScale() const; | 121 float MinimumContentsScale() const; |
| 125 float MaximumContentsScale() const; | 122 float MaximumContentsScale() const; |
| 126 void ResetRasterScale(); | 123 void ResetRasterScale(); |
| 127 void UpdateViewportRectForTilePriorityInContentSpace(); | 124 void UpdateViewportRectForTilePriorityInContentSpace(); |
| 128 PictureLayerImpl* GetRecycledTwinLayer() const; | 125 PictureLayerImpl* GetRecycledTwinLayer() const; |
| 129 | 126 |
| 130 void SanityCheckTilingState() const; | 127 void SanityCheckTilingState() const; |
| 131 bool ShouldAdjustRasterScaleDuringScaleAnimations() const; | 128 bool ShouldAdjustRasterScaleDuringScaleAnimations() const; |
| 132 | 129 |
| 133 void GetDebugBorderProperties(SkColor* color, float* width) const override; | 130 void GetDebugBorderProperties(SkColor* color, float* width) const override; |
| 134 void GetAllTilesForTracing(std::set<const Tile*>* tiles) const override; | 131 void GetAllTilesForTracing(std::set<const Tile*>* tiles) const override; |
| 135 void AsValueInto(base::debug::TracedValue* dict) const override; | 132 void AsValueInto(base::trace_event::TracedValue* dict) const override; |
| 136 | 133 |
| 137 virtual void UpdateIdealScales(); | 134 virtual void UpdateIdealScales(); |
| 138 float MaximumTilingContentsScale() const; | 135 float MaximumTilingContentsScale() const; |
| 139 scoped_ptr<PictureLayerTilingSet> CreatePictureLayerTilingSet(); | 136 scoped_ptr<PictureLayerTilingSet> CreatePictureLayerTilingSet(); |
| 140 | 137 |
| 141 PictureLayerImpl* twin_layer_; | 138 PictureLayerImpl* twin_layer_; |
| 142 | 139 |
| 143 scoped_ptr<PictureLayerTilingSet> tilings_; | 140 scoped_ptr<PictureLayerTilingSet> tilings_; |
| 144 scoped_refptr<RasterSource> raster_source_; | 141 scoped_refptr<RasterSource> raster_source_; |
| 145 Region invalidation_; | 142 Region invalidation_; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 // of comparing pointers, since objects pointed to are not guaranteed to | 174 // of comparing pointers, since objects pointed to are not guaranteed to |
| 178 // exist. | 175 // exist. |
| 179 std::vector<PictureLayerTiling*> last_append_quads_tilings_; | 176 std::vector<PictureLayerTiling*> last_append_quads_tilings_; |
| 180 | 177 |
| 181 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 178 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
| 182 }; | 179 }; |
| 183 | 180 |
| 184 } // namespace cc | 181 } // namespace cc |
| 185 | 182 |
| 186 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 183 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
| OLD | NEW |