| 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/image_id.h" | 16 #include "cc/playback/image_id.h" |
| 17 #include "cc/playback/recording_source.h" | 17 #include "cc/playback/recording_source.h" |
| 18 #include "skia/ext/analysis_canvas.h" | 18 #include "skia/ext/analysis_canvas.h" |
| 19 #include "third_party/skia/include/core/SkPicture.h" | 19 #include "third_party/skia/include/core/SkPicture.h" |
| 20 | 20 |
| 21 namespace gfx { | |
| 22 class ColorSpace; | |
| 23 } | |
| 24 | |
| 25 namespace cc { | 21 namespace cc { |
| 26 class DisplayItemList; | 22 class DisplayItemList; |
| 27 class DrawImage; | 23 class DrawImage; |
| 28 class ImageDecodeCache; | 24 class ImageDecodeCache; |
| 29 | 25 |
| 30 class CC_EXPORT RasterSource : public base::RefCountedThreadSafe<RasterSource> { | 26 class CC_EXPORT RasterSource : public base::RefCountedThreadSafe<RasterSource> { |
| 31 public: | 27 public: |
| 32 struct CC_EXPORT PlaybackSettings { | 28 struct CC_EXPORT PlaybackSettings { |
| 33 PlaybackSettings(); | 29 PlaybackSettings(); |
| 34 PlaybackSettings(const PlaybackSettings&); | 30 PlaybackSettings(const PlaybackSettings&); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // Returns true iff the whole raster source is of solid color. | 81 // Returns true iff the whole raster source is of solid color. |
| 86 bool IsSolidColor() const; | 82 bool IsSolidColor() const; |
| 87 | 83 |
| 88 // Returns the color of the raster source if it is solid color. The results | 84 // Returns the color of the raster source if it is solid color. The results |
| 89 // are unspecified if IsSolidColor returns false. | 85 // are unspecified if IsSolidColor returns false. |
| 90 SkColor GetSolidColor() const; | 86 SkColor GetSolidColor() const; |
| 91 | 87 |
| 92 // Returns the size of this raster source. | 88 // Returns the size of this raster source. |
| 93 gfx::Size GetSize() const; | 89 gfx::Size GetSize() const; |
| 94 | 90 |
| 95 // Returns whether or not there was a color space implied by the raster source | |
| 96 // when it was created. If this returns true then no color correction is | |
| 97 // to be applied at rasterization time, and the result of rasterization is to | |
| 98 // be interpreted as being in this color space. If this returns falce, then | |
| 99 // then a destination color space must be specified at raster time. | |
| 100 bool HasImpliedColorSpace() const; | |
| 101 const gfx::ColorSpace& GetImpliedColorSpace() const; | |
| 102 | |
| 103 // Populate the given list with all images that may overlap the given | 91 // Populate the given list with all images that may overlap the given |
| 104 // rect in layer space. The returned draw images' matrices are modified as if | 92 // rect in layer space. The returned draw images' matrices are modified as if |
| 105 // they were being using during raster at scale |raster_scale|. | 93 // they were being using during raster at scale |raster_scale|. |
| 106 void GetDiscardableImagesInRect(const gfx::Rect& layer_rect, | 94 void GetDiscardableImagesInRect(const gfx::Rect& layer_rect, |
| 107 float contents_scale, | 95 float contents_scale, |
| 108 std::vector<DrawImage>* images) const; | 96 std::vector<DrawImage>* images) const; |
| 109 | 97 |
| 110 // Return true iff this raster source can raster the given rect in layer | 98 // Return true iff this raster source can raster the given rect in layer |
| 111 // space. | 99 // space. |
| 112 bool CoversRect(const gfx::Rect& layer_rect) const; | 100 bool CoversRect(const gfx::Rect& layer_rect) const; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 void RasterCommon(SkCanvas* canvas, SkPicture::AbortCallback* callback) const; | 154 void RasterCommon(SkCanvas* canvas, SkPicture::AbortCallback* callback) const; |
| 167 | 155 |
| 168 void PrepareForPlaybackToCanvas(SkCanvas* canvas) const; | 156 void PrepareForPlaybackToCanvas(SkCanvas* canvas) const; |
| 169 | 157 |
| 170 DISALLOW_COPY_AND_ASSIGN(RasterSource); | 158 DISALLOW_COPY_AND_ASSIGN(RasterSource); |
| 171 }; | 159 }; |
| 172 | 160 |
| 173 } // namespace cc | 161 } // namespace cc |
| 174 | 162 |
| 175 #endif // CC_PLAYBACK_RASTER_SOURCE_H_ | 163 #endif // CC_PLAYBACK_RASTER_SOURCE_H_ |
| OLD | NEW |