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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 SkCanvas* canvas, | 50 SkCanvas* canvas, |
51 gfx::Rect canvas_rect, | 51 gfx::Rect canvas_rect, |
52 float contents_scale, | 52 float contents_scale, |
53 RenderingStatsInstrumentation* stats_instrumentation); | 53 RenderingStatsInstrumentation* stats_instrumentation); |
54 | 54 |
55 // Called when analyzing a tile. We can use AnalysisCanvas as | 55 // Called when analyzing a tile. We can use AnalysisCanvas as |
56 // SkDrawPictureCallback, which allows us to early out from analysis. | 56 // SkDrawPictureCallback, which allows us to early out from analysis. |
57 void RasterForAnalysis( | 57 void RasterForAnalysis( |
58 skia::AnalysisCanvas* canvas, | 58 skia::AnalysisCanvas* canvas, |
59 gfx::Rect canvas_rect, | 59 gfx::Rect canvas_rect, |
60 float contents_scale); | 60 float contents_scale, |
61 | 61 RenderingStatsInstrumentation* stats_instrumentation); |
62 | 62 |
63 skia::RefPtr<SkPicture> GetFlattenedPicture(); | 63 skia::RefPtr<SkPicture> GetFlattenedPicture(); |
64 | 64 |
65 struct CC_EXPORT Analysis { | 65 struct CC_EXPORT Analysis { |
66 Analysis(); | 66 Analysis(); |
67 ~Analysis(); | 67 ~Analysis(); |
68 | 68 |
69 bool is_solid_color; | 69 bool is_solid_color; |
70 bool has_text; | 70 bool has_text; |
71 SkColor solid_color; | 71 SkColor solid_color; |
72 }; | 72 }; |
73 | 73 |
74 void AnalyzeInRect(gfx::Rect content_rect, | 74 void AnalyzeInRect(gfx::Rect content_rect, |
75 float contents_scale, | 75 float contents_scale, |
76 Analysis* analysis); | 76 Analysis* analysis); |
77 | 77 |
| 78 void AnalyzeInRect(gfx::Rect content_rect, |
| 79 float contents_scale, |
| 80 Analysis* analysis, |
| 81 RenderingStatsInstrumentation* stats_instrumentation); |
| 82 |
78 class CC_EXPORT PixelRefIterator { | 83 class CC_EXPORT PixelRefIterator { |
79 public: | 84 public: |
80 PixelRefIterator(gfx::Rect content_rect, | 85 PixelRefIterator(gfx::Rect content_rect, |
81 float contents_scale, | 86 float contents_scale, |
82 const PicturePileImpl* picture_pile); | 87 const PicturePileImpl* picture_pile); |
83 ~PixelRefIterator(); | 88 ~PixelRefIterator(); |
84 | 89 |
85 skia::LazyPixelRef* operator->() const { return *pixel_ref_iterator_; } | 90 skia::LazyPixelRef* operator->() const { return *pixel_ref_iterator_; } |
86 skia::LazyPixelRef* operator*() const { return *pixel_ref_iterator_; } | 91 skia::LazyPixelRef* operator*() const { return *pixel_ref_iterator_; } |
87 PixelRefIterator& operator++(); | 92 PixelRefIterator& operator++(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 void CoalesceRasters(gfx::Rect canvas_rect, | 132 void CoalesceRasters(gfx::Rect canvas_rect, |
128 gfx::Rect content_rect, | 133 gfx::Rect content_rect, |
129 float contents_scale, | 134 float contents_scale, |
130 PictureRegionMap* result); | 135 PictureRegionMap* result); |
131 | 136 |
132 void RasterCommon( | 137 void RasterCommon( |
133 SkCanvas* canvas, | 138 SkCanvas* canvas, |
134 SkDrawPictureCallback* callback, | 139 SkDrawPictureCallback* callback, |
135 gfx::Rect canvas_rect, | 140 gfx::Rect canvas_rect, |
136 float contents_scale, | 141 float contents_scale, |
137 RenderingStatsInstrumentation* rendering_stats_instrumentation); | 142 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
| 143 bool is_analysis); |
138 | 144 |
139 // Once instantiated, |clones_for_drawing_| can't be modified. This | 145 // Once instantiated, |clones_for_drawing_| can't be modified. This |
140 // guarantees thread-safe access during the life time of a PicturePileImpl | 146 // guarantees thread-safe access during the life time of a PicturePileImpl |
141 // instance. This member variable must be last so that other member | 147 // instance. This member variable must be last so that other member |
142 // variables have already been initialized and can be clonable. | 148 // variables have already been initialized and can be clonable. |
143 const ClonesForDrawing clones_for_drawing_; | 149 const ClonesForDrawing clones_for_drawing_; |
144 | 150 |
145 DISALLOW_COPY_AND_ASSIGN(PicturePileImpl); | 151 DISALLOW_COPY_AND_ASSIGN(PicturePileImpl); |
146 }; | 152 }; |
147 | 153 |
148 } // namespace cc | 154 } // namespace cc |
149 | 155 |
150 #endif // CC_RESOURCES_PICTURE_PILE_IMPL_H_ | 156 #endif // CC_RESOURCES_PICTURE_PILE_IMPL_H_ |
OLD | NEW |