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_PLAYBACK_PICTURE_PILE_IMPL_H_ | 5 #ifndef CC_PLAYBACK_PICTURE_PILE_IMPL_H_ |
6 #define CC_PLAYBACK_PICTURE_PILE_IMPL_H_ | 6 #define CC_PLAYBACK_PICTURE_PILE_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 const gfx::Rect& canvas_bitmap_rect, | 42 const gfx::Rect& canvas_bitmap_rect, |
43 const gfx::Rect& canvas_playback_rect, | 43 const gfx::Rect& canvas_playback_rect, |
44 float contents_scale) const override; | 44 float contents_scale) const override; |
45 void PlaybackToSharedCanvas(SkCanvas* canvas, | 45 void PlaybackToSharedCanvas(SkCanvas* canvas, |
46 const gfx::Rect& canvas_rect, | 46 const gfx::Rect& canvas_rect, |
47 float contents_scale) const override; | 47 float contents_scale) const override; |
48 void PerformSolidColorAnalysis( | 48 void PerformSolidColorAnalysis( |
49 const gfx::Rect& content_rect, | 49 const gfx::Rect& content_rect, |
50 float contents_scale, | 50 float contents_scale, |
51 RasterSource::SolidColorAnalysis* analysis) const override; | 51 RasterSource::SolidColorAnalysis* analysis) const override; |
52 void GatherPixelRefs(const gfx::Rect& content_rect, | 52 void GatherPixelRefs( |
53 float contents_scale, | 53 const gfx::Rect& content_rect, |
54 std::vector<SkPixelRef*>* pixel_refs) const override; | 54 float contents_scale, |
| 55 std::vector<skia::PositionPixelRef>* pixel_refs) const override; |
55 bool CoversRect(const gfx::Rect& content_rect, | 56 bool CoversRect(const gfx::Rect& content_rect, |
56 float contents_scale) const override; | 57 float contents_scale) const override; |
57 void SetShouldAttemptToUseDistanceFieldText() override; | 58 void SetShouldAttemptToUseDistanceFieldText() override; |
58 bool ShouldAttemptToUseDistanceFieldText() const override; | 59 bool ShouldAttemptToUseDistanceFieldText() const override; |
59 gfx::Size GetSize() const override; | 60 gfx::Size GetSize() const override; |
60 bool IsSolidColor() const override; | 61 bool IsSolidColor() const override; |
61 SkColor GetSolidColor() const override; | 62 SkColor GetSolidColor() const override; |
62 bool HasRecordings() const override; | 63 bool HasRecordings() const override; |
63 bool CanUseLCDText() const override; | 64 bool CanUseLCDText() const override; |
64 scoped_refptr<RasterSource> CreateCloneWithoutLCDText() const override; | 65 scoped_refptr<RasterSource> CreateCloneWithoutLCDText() const override; |
65 | 66 |
66 // Tracing functionality. | 67 // Tracing functionality. |
67 void DidBeginTracing() override; | 68 void DidBeginTracing() override; |
68 void AsValueInto(base::trace_event::TracedValue* array) const override; | 69 void AsValueInto(base::trace_event::TracedValue* array) const override; |
69 skia::RefPtr<SkPicture> GetFlattenedPicture() override; | 70 skia::RefPtr<SkPicture> GetFlattenedPicture() override; |
70 size_t GetPictureMemoryUsage() const override; | 71 size_t GetPictureMemoryUsage() const override; |
71 | 72 |
72 // Iterator used to return SkPixelRefs from this picture pile. | 73 // Iterator used to return SkPixelRefs from this picture pile. |
73 // Public for testing. | 74 // Public for testing. |
74 class CC_EXPORT PixelRefIterator { | 75 class CC_EXPORT PixelRefIterator { |
75 public: | 76 public: |
76 PixelRefIterator(const gfx::Rect& content_rect, | 77 PixelRefIterator(const gfx::Rect& content_rect, |
77 float contents_scale, | 78 float contents_scale, |
78 const PicturePileImpl* picture_pile); | 79 const PicturePileImpl* picture_pile); |
79 ~PixelRefIterator(); | 80 ~PixelRefIterator(); |
80 | 81 |
81 SkPixelRef* operator->() const { return *pixel_ref_iterator_; } | 82 const skia::PositionPixelRef* operator->() const { |
82 SkPixelRef* operator*() const { return *pixel_ref_iterator_; } | 83 return &(*pixel_ref_iterator_); |
| 84 } |
| 85 const skia::PositionPixelRef& operator*() const { |
| 86 return *pixel_ref_iterator_; |
| 87 } |
83 PixelRefIterator& operator++(); | 88 PixelRefIterator& operator++(); |
84 operator bool() const { return pixel_ref_iterator_; } | 89 operator bool() const { return pixel_ref_iterator_; } |
85 | 90 |
86 private: | 91 private: |
87 void AdvanceToTilePictureWithPixelRefs(); | 92 void AdvanceToTilePictureWithPixelRefs(); |
88 | 93 |
89 const PicturePileImpl* picture_pile_; | 94 const PicturePileImpl* picture_pile_; |
90 gfx::Rect layer_rect_; | 95 gfx::Rect layer_rect_; |
91 TilingData::Iterator tile_iterator_; | 96 TilingData::Iterator tile_iterator_; |
92 PixelRefMap::Iterator pixel_ref_iterator_; | 97 PixelRefMap::Iterator pixel_ref_iterator_; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 bool CanRasterSlowTileCheck(const gfx::Rect& layer_rect) const; | 156 bool CanRasterSlowTileCheck(const gfx::Rect& layer_rect) const; |
152 | 157 |
153 gfx::Rect PaddedRect(const PictureMapKey& key) const; | 158 gfx::Rect PaddedRect(const PictureMapKey& key) const; |
154 | 159 |
155 DISALLOW_COPY_AND_ASSIGN(PicturePileImpl); | 160 DISALLOW_COPY_AND_ASSIGN(PicturePileImpl); |
156 }; | 161 }; |
157 | 162 |
158 } // namespace cc | 163 } // namespace cc |
159 | 164 |
160 #endif // CC_PLAYBACK_PICTURE_PILE_IMPL_H_ | 165 #endif // CC_PLAYBACK_PICTURE_PILE_IMPL_H_ |
OLD | NEW |