| 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_RESOURCES_DISPLAY_LIST_RASTER_SOURCE_H_ | 5 #ifndef CC_RESOURCES_DISPLAY_LIST_RASTER_SOURCE_H_ |
| 6 #define CC_RESOURCES_DISPLAY_LIST_RASTER_SOURCE_H_ | 6 #define CC_RESOURCES_DISPLAY_LIST_RASTER_SOURCE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "cc/base/cc_export.h" | 11 #include "cc/base/cc_export.h" |
| 12 #include "cc/debug/rendering_stats_instrumentation.h" | 12 #include "cc/debug/rendering_stats_instrumentation.h" |
| 13 #include "cc/resources/display_list_recording_source.h" | 13 #include "cc/resources/display_list_recording_source.h" |
| 14 #include "cc/resources/raster_source.h" | 14 #include "cc/resources/raster_source.h" |
| 15 #include "skia/ext/analysis_canvas.h" | 15 #include "skia/ext/analysis_canvas.h" |
| 16 #include "skia/ext/refptr.h" | 16 #include "skia/ext/refptr.h" |
| 17 #include "third_party/skia/include/core/SkPicture.h" | 17 #include "third_party/skia/include/core/SkPicture.h" |
| 18 | 18 |
| 19 namespace cc { | 19 namespace cc { |
| 20 class DisplayItemList; | 20 class DisplayItemList; |
| 21 | 21 |
| 22 class CC_EXPORT DisplayListRasterSource : public RasterSource { | 22 class CC_EXPORT DisplayListRasterSource : public RasterSource { |
| 23 public: | 23 public: |
| 24 static scoped_refptr<DisplayListRasterSource> | 24 static scoped_refptr<DisplayListRasterSource> |
| 25 CreateFromDisplayListRecordingSource(const DisplayListRecordingSource* other, | 25 CreateFromDisplayListRecordingSource(const DisplayListRecordingSource* other, |
| 26 bool can_use_lcd_text); | 26 bool can_use_lcd_text); |
| 27 | 27 |
| 28 // RasterSource overrides. | 28 // RasterSource overrides. |
| 29 void PlaybackToCanvas(SkCanvas* canvas, | 29 void PlaybackToCanvas(SkCanvas* canvas, |
| 30 const gfx::Rect& canvas_rect, | 30 const gfx::Rect& canvas_bitmap_rect, |
| 31 const gfx::Rect& canvas_playback_rect, |
| 31 float contents_scale) const override; | 32 float contents_scale) const override; |
| 32 void PlaybackToSharedCanvas(SkCanvas* canvas, | 33 void PlaybackToSharedCanvas(SkCanvas* canvas, |
| 33 const gfx::Rect& canvas_rect, | 34 const gfx::Rect& canvas_rect, |
| 34 float contents_scale) const override; | 35 float contents_scale) const override; |
| 35 void PerformSolidColorAnalysis( | 36 void PerformSolidColorAnalysis( |
| 36 const gfx::Rect& content_rect, | 37 const gfx::Rect& content_rect, |
| 37 float contents_scale, | 38 float contents_scale, |
| 38 RasterSource::SolidColorAnalysis* analysis) const override; | 39 RasterSource::SolidColorAnalysis* analysis) const override; |
| 39 bool IsSolidColor() const override; | 40 bool IsSolidColor() const override; |
| 40 SkColor GetSolidColor() const override; | 41 SkColor GetSolidColor() const override; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 81 |
| 81 private: | 82 private: |
| 82 // Called when analyzing a tile. We can use AnalysisCanvas as | 83 // Called when analyzing a tile. We can use AnalysisCanvas as |
| 83 // SkDrawPictureCallback, which allows us to early out from analysis. | 84 // SkDrawPictureCallback, which allows us to early out from analysis. |
| 84 void RasterForAnalysis(skia::AnalysisCanvas* canvas, | 85 void RasterForAnalysis(skia::AnalysisCanvas* canvas, |
| 85 const gfx::Rect& canvas_rect, | 86 const gfx::Rect& canvas_rect, |
| 86 float contents_scale) const; | 87 float contents_scale) const; |
| 87 | 88 |
| 88 void RasterCommon(SkCanvas* canvas, | 89 void RasterCommon(SkCanvas* canvas, |
| 89 SkDrawPictureCallback* callback, | 90 SkDrawPictureCallback* callback, |
| 90 const gfx::Rect& canvas_rect, | 91 const gfx::Rect& canvas_bitmap_rect, |
| 92 const gfx::Rect& canvas_playback_rect, |
| 91 float contents_scale) const; | 93 float contents_scale) const; |
| 92 | 94 |
| 93 DISALLOW_COPY_AND_ASSIGN(DisplayListRasterSource); | 95 DISALLOW_COPY_AND_ASSIGN(DisplayListRasterSource); |
| 94 }; | 96 }; |
| 95 | 97 |
| 96 } // namespace cc | 98 } // namespace cc |
| 97 | 99 |
| 98 #endif // CC_RESOURCES_DISPLAY_LIST_RASTER_SOURCE_H_ | 100 #endif // CC_RESOURCES_DISPLAY_LIST_RASTER_SOURCE_H_ |
| OLD | NEW |