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_RESOURCES_PICTURE_PILE_IMPL_H_ | 5 #ifndef CC_RESOURCES_PICTURE_PILE_IMPL_H_ |
6 #define CC_RESOURCES_PICTURE_PILE_IMPL_H_ | 6 #define CC_RESOURCES_PICTURE_PILE_IMPL_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 14 matching lines...) Expand all Loading... |
25 class CC_EXPORT PicturePileImpl : public PicturePileBase, public RasterSource { | 25 class CC_EXPORT PicturePileImpl : public PicturePileBase, public RasterSource { |
26 public: | 26 public: |
27 static scoped_refptr<PicturePileImpl> Create(); | 27 static scoped_refptr<PicturePileImpl> Create(); |
28 static scoped_refptr<PicturePileImpl> CreateFromOther( | 28 static scoped_refptr<PicturePileImpl> CreateFromOther( |
29 const PicturePileBase* other); | 29 const PicturePileBase* other); |
30 | 30 |
31 // RasterSource overrides. See RasterSource header for full description. | 31 // RasterSource overrides. See RasterSource header for full description. |
32 // When slow-down-raster-scale-factor is set to a value greater than 1, the | 32 // When slow-down-raster-scale-factor is set to a value greater than 1, the |
33 // reported rasterize time (in stats_instrumentation) is the minimum measured | 33 // reported rasterize time (in stats_instrumentation) is the minimum measured |
34 // value over all runs. | 34 // value over all runs. |
35 void PlaybackToCanvas( | 35 void PlaybackToCanvas(SkCanvas* canvas, |
36 SkCanvas* canvas, | 36 const gfx::Rect& canvas_rect, |
37 const gfx::Rect& canvas_rect, | 37 float contents_scale) const override; |
38 float contents_scale, | |
39 RenderingStatsInstrumentation* stats_instrumentation) const override; | |
40 void PerformSolidColorAnalysis( | 38 void PerformSolidColorAnalysis( |
41 const gfx::Rect& content_rect, | 39 const gfx::Rect& content_rect, |
42 float contents_scale, | 40 float contents_scale, |
43 RasterSource::SolidColorAnalysis* analysis, | 41 RasterSource::SolidColorAnalysis* analysis) const override; |
44 RenderingStatsInstrumentation* stats_instrumentation) const override; | |
45 void GatherPixelRefs(const gfx::Rect& content_rect, | 42 void GatherPixelRefs(const gfx::Rect& content_rect, |
46 float contents_scale, | 43 float contents_scale, |
47 std::vector<SkPixelRef*>* pixel_refs) const override; | 44 std::vector<SkPixelRef*>* pixel_refs) const override; |
48 bool CoversRect(const gfx::Rect& content_rect, | 45 bool CoversRect(const gfx::Rect& content_rect, |
49 float contents_scale) const override; | 46 float contents_scale) const override; |
50 bool SuitableForDistanceFieldText() const override; | 47 bool SuitableForDistanceFieldText() const override; |
51 | 48 |
52 // Raster into the canvas without applying clips. | 49 // Raster into the canvas without applying clips. |
53 void RasterDirect( | 50 void RasterDirect(SkCanvas* canvas, |
54 SkCanvas* canvas, | 51 const gfx::Rect& canvas_rect, |
55 const gfx::Rect& canvas_rect, | 52 float contents_scale) const; |
56 float contents_scale, | |
57 RenderingStatsInstrumentation* rendering_stats_instrumentation) const; | |
58 | 53 |
59 // Tracing functionality. | 54 // Tracing functionality. |
60 void DidBeginTracing(); | 55 void DidBeginTracing(); |
61 skia::RefPtr<SkPicture> GetFlattenedPicture(); | 56 skia::RefPtr<SkPicture> GetFlattenedPicture(); |
62 | 57 |
63 void set_likely_to_be_used_for_transform_animation() { | 58 void set_likely_to_be_used_for_transform_animation() { |
64 likely_to_be_used_for_transform_animation_ = true; | 59 likely_to_be_used_for_transform_animation_ = true; |
65 } | 60 } |
66 | 61 |
67 // Iterator used to return SkPixelRefs from this picture pile. | 62 // Iterator used to return SkPixelRefs from this picture pile. |
(...skipping 26 matching lines...) Expand all Loading... |
94 | 89 |
95 PicturePileImpl(); | 90 PicturePileImpl(); |
96 explicit PicturePileImpl(const PicturePileBase* other); | 91 explicit PicturePileImpl(const PicturePileBase* other); |
97 ~PicturePileImpl() override; | 92 ~PicturePileImpl() override; |
98 | 93 |
99 private: | 94 private: |
100 typedef std::map<const Picture*, Region> PictureRegionMap; | 95 typedef std::map<const Picture*, Region> PictureRegionMap; |
101 | 96 |
102 // Called when analyzing a tile. We can use AnalysisCanvas as | 97 // Called when analyzing a tile. We can use AnalysisCanvas as |
103 // SkDrawPictureCallback, which allows us to early out from analysis. | 98 // SkDrawPictureCallback, which allows us to early out from analysis. |
104 void RasterForAnalysis( | 99 void RasterForAnalysis(skia::AnalysisCanvas* canvas, |
105 skia::AnalysisCanvas* canvas, | 100 const gfx::Rect& canvas_rect, |
106 const gfx::Rect& canvas_rect, | 101 float contents_scale) const; |
107 float contents_scale, | |
108 RenderingStatsInstrumentation* stats_instrumentation) const; | |
109 | 102 |
110 void CoalesceRasters(const gfx::Rect& canvas_rect, | 103 void CoalesceRasters(const gfx::Rect& canvas_rect, |
111 const gfx::Rect& content_rect, | 104 const gfx::Rect& content_rect, |
112 float contents_scale, | 105 float contents_scale, |
113 PictureRegionMap* result) const; | 106 PictureRegionMap* result) const; |
114 | 107 |
115 void RasterCommon( | 108 void RasterCommon( |
116 SkCanvas* canvas, | 109 SkCanvas* canvas, |
117 SkDrawPictureCallback* callback, | 110 SkDrawPictureCallback* callback, |
118 const gfx::Rect& canvas_rect, | 111 const gfx::Rect& canvas_rect, |
119 float contents_scale, | 112 float contents_scale, |
120 RenderingStatsInstrumentation* rendering_stats_instrumentation, | |
121 bool is_analysis) const; | 113 bool is_analysis) const; |
122 | 114 |
123 bool likely_to_be_used_for_transform_animation_; | 115 bool likely_to_be_used_for_transform_animation_; |
124 | 116 |
125 DISALLOW_COPY_AND_ASSIGN(PicturePileImpl); | 117 DISALLOW_COPY_AND_ASSIGN(PicturePileImpl); |
126 }; | 118 }; |
127 | 119 |
128 } // namespace cc | 120 } // namespace cc |
129 | 121 |
130 #endif // CC_RESOURCES_PICTURE_PILE_IMPL_H_ | 122 #endif // CC_RESOURCES_PICTURE_PILE_IMPL_H_ |
OLD | NEW |