| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RASTER_SOURCE_H_ | 5 #ifndef CC_PLAYBACK_RASTER_SOURCE_H_ |
| 6 #define CC_PLAYBACK_RASTER_SOURCE_H_ | 6 #define CC_PLAYBACK_RASTER_SOURCE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "cc/base/cc_export.h" | 14 #include "cc/base/cc_export.h" |
| 15 #include "cc/debug/rendering_stats_instrumentation.h" | 15 #include "cc/debug/rendering_stats_instrumentation.h" |
| 16 #include "cc/playback/recording_source.h" | 16 #include "cc/playback/recording_source.h" |
| 17 #include "skia/ext/analysis_canvas.h" | 17 #include "skia/ext/analysis_canvas.h" |
| 18 #include "third_party/skia/include/core/SkPicture.h" | 18 #include "third_party/skia/include/core/SkPicture.h" |
| 19 | 19 |
| 20 namespace gfx { |
| 21 class ColorSpace; |
| 22 } |
| 23 |
| 20 namespace cc { | 24 namespace cc { |
| 21 class DisplayItemList; | 25 class DisplayItemList; |
| 22 class DrawImage; | 26 class DrawImage; |
| 23 class ImageDecodeController; | 27 class ImageDecodeController; |
| 24 | 28 |
| 25 class CC_EXPORT RasterSource : public base::RefCountedThreadSafe<RasterSource> { | 29 class CC_EXPORT RasterSource : public base::RefCountedThreadSafe<RasterSource> { |
| 26 public: | 30 public: |
| 27 struct CC_EXPORT PlaybackSettings { | 31 struct CC_EXPORT PlaybackSettings { |
| 28 PlaybackSettings(); | 32 PlaybackSettings(); |
| 29 | 33 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // Returns true iff the whole raster source is of solid color. | 75 // Returns true iff the whole raster source is of solid color. |
| 72 bool IsSolidColor() const; | 76 bool IsSolidColor() const; |
| 73 | 77 |
| 74 // Returns the color of the raster source if it is solid color. The results | 78 // Returns the color of the raster source if it is solid color. The results |
| 75 // are unspecified if IsSolidColor returns false. | 79 // are unspecified if IsSolidColor returns false. |
| 76 SkColor GetSolidColor() const; | 80 SkColor GetSolidColor() const; |
| 77 | 81 |
| 78 // Returns the size of this raster source. | 82 // Returns the size of this raster source. |
| 79 gfx::Size GetSize() const; | 83 gfx::Size GetSize() const; |
| 80 | 84 |
| 85 // Returns whether or not there was a color space implied by the raster source |
| 86 // when it was created. If this returns true then no color correction is |
| 87 // to be applied at rasterization time, and the result of rasterization is to |
| 88 // be interpreted as being in this color space. If this returns falce, then |
| 89 // then a destination color space must be specified at raster time. |
| 90 bool HasImpliedColorSpace() const; |
| 91 const gfx::ColorSpace& GetImpliedColorSpace() const; |
| 92 |
| 81 // Populate the given list with all images that may overlap the given | 93 // Populate the given list with all images that may overlap the given |
| 82 // rect in layer space. The returned draw images' matrices are modified as if | 94 // rect in layer space. The returned draw images' matrices are modified as if |
| 83 // they were being using during raster at scale |raster_scale|. | 95 // they were being using during raster at scale |raster_scale|. |
| 84 void GetDiscardableImagesInRect(const gfx::Rect& layer_rect, | 96 void GetDiscardableImagesInRect(const gfx::Rect& layer_rect, |
| 85 const gfx::SizeF& raster_scales, | 97 const gfx::SizeF& raster_scales, |
| 86 std::vector<DrawImage>* images) const; | 98 std::vector<DrawImage>* images) const; |
| 87 | 99 |
| 88 // Return true iff this raster source can raster the given rect in layer | 100 // Return true iff this raster source can raster the given rect in layer |
| 89 // space. | 101 // space. |
| 90 bool CoversRect(const gfx::Rect& layer_rect) const; | 102 bool CoversRect(const gfx::Rect& layer_rect) const; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 void RasterCommon(SkCanvas* canvas, SkPicture::AbortCallback* callback) const; | 177 void RasterCommon(SkCanvas* canvas, SkPicture::AbortCallback* callback) const; |
| 166 | 178 |
| 167 void PrepareForPlaybackToCanvas(SkCanvas* canvas) const; | 179 void PrepareForPlaybackToCanvas(SkCanvas* canvas) const; |
| 168 | 180 |
| 169 DISALLOW_COPY_AND_ASSIGN(RasterSource); | 181 DISALLOW_COPY_AND_ASSIGN(RasterSource); |
| 170 }; | 182 }; |
| 171 | 183 |
| 172 } // namespace cc | 184 } // namespace cc |
| 173 | 185 |
| 174 #endif // CC_PLAYBACK_RASTER_SOURCE_H_ | 186 #endif // CC_PLAYBACK_RASTER_SOURCE_H_ |
| OLD | NEW |