| 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_DISPLAY_LIST_RASTER_SOURCE_H_ | 5 #ifndef CC_PLAYBACK_DISPLAY_LIST_RASTER_SOURCE_H_ |
| 6 #define CC_PLAYBACK_DISPLAY_LIST_RASTER_SOURCE_H_ | 6 #define CC_PLAYBACK_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" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 bool HasRecordings() const override; | 47 bool HasRecordings() const override; |
| 48 gfx::Rect RecordedViewport() const override; | 48 gfx::Rect RecordedViewport() const override; |
| 49 void SetShouldAttemptToUseDistanceFieldText() override; | 49 void SetShouldAttemptToUseDistanceFieldText() override; |
| 50 bool ShouldAttemptToUseDistanceFieldText() const override; | 50 bool ShouldAttemptToUseDistanceFieldText() const override; |
| 51 void DidBeginTracing() override; | 51 void DidBeginTracing() override; |
| 52 void AsValueInto(base::trace_event::TracedValue* array) const override; | 52 void AsValueInto(base::trace_event::TracedValue* array) const override; |
| 53 skia::RefPtr<SkPicture> GetFlattenedPicture() override; | 53 skia::RefPtr<SkPicture> GetFlattenedPicture() override; |
| 54 size_t GetPictureMemoryUsage() const override; | 54 size_t GetPictureMemoryUsage() const override; |
| 55 bool CanUseLCDText() const override; | 55 bool CanUseLCDText() const override; |
| 56 scoped_refptr<RasterSource> CreateCloneWithoutLCDText() const override; | 56 scoped_refptr<RasterSource> CreateCloneWithoutLCDText() const override; |
| 57 void SetImageDecodeController( |
| 58 ImageDecodeController* image_decode_controller) override; |
| 57 | 59 |
| 58 protected: | 60 protected: |
| 59 DisplayListRasterSource(); | 61 DisplayListRasterSource(); |
| 60 DisplayListRasterSource(const DisplayListRecordingSource* other, | 62 DisplayListRasterSource(const DisplayListRecordingSource* other, |
| 61 bool can_use_lcd_text); | 63 bool can_use_lcd_text); |
| 62 DisplayListRasterSource(const DisplayListRasterSource* other, | 64 DisplayListRasterSource(const DisplayListRasterSource* other, |
| 63 bool can_use_lcd_text); | 65 bool can_use_lcd_text); |
| 64 ~DisplayListRasterSource() override; | 66 ~DisplayListRasterSource() override; |
| 65 | 67 |
| 66 // These members are const as this raster source may be in use on another | 68 // These members are const as this raster source may be in use on another |
| 67 // thread and so should not be touched after construction. | 69 // thread and so should not be touched after construction. |
| 68 const scoped_refptr<DisplayItemList> display_list_; | 70 const scoped_refptr<DisplayItemList> display_list_; |
| 69 const size_t painter_reported_memory_usage_; | 71 const size_t painter_reported_memory_usage_; |
| 70 const SkColor background_color_; | 72 const SkColor background_color_; |
| 71 const bool requires_clear_; | 73 const bool requires_clear_; |
| 72 const bool can_use_lcd_text_; | 74 const bool can_use_lcd_text_; |
| 73 const bool is_solid_color_; | 75 const bool is_solid_color_; |
| 74 const SkColor solid_color_; | 76 const SkColor solid_color_; |
| 75 const gfx::Rect recorded_viewport_; | 77 const gfx::Rect recorded_viewport_; |
| 76 const gfx::Size size_; | 78 const gfx::Size size_; |
| 77 const bool clear_canvas_with_debug_color_; | 79 const bool clear_canvas_with_debug_color_; |
| 78 const int slow_down_raster_scale_factor_for_debug_; | 80 const int slow_down_raster_scale_factor_for_debug_; |
| 79 // TODO(enne/vmiura): this has a read/write race between raster and compositor | 81 // TODO(enne/vmiura): this has a read/write race between raster and compositor |
| 80 // threads with multi-threaded Ganesh. Make this const or remove it. | 82 // threads with multi-threaded Ganesh. Make this const or remove it. |
| 81 bool should_attempt_to_use_distance_field_text_; | 83 bool should_attempt_to_use_distance_field_text_; |
| 82 | 84 |
| 85 ImageDecodeController* image_decode_controller_; |
| 86 |
| 83 private: | 87 private: |
| 84 // Called when analyzing a tile. We can use AnalysisCanvas as | 88 // Called when analyzing a tile. We can use AnalysisCanvas as |
| 85 // SkPicture::AbortCallback, which allows us to early out from analysis. | 89 // SkPicture::AbortCallback, which allows us to early out from analysis. |
| 86 void RasterForAnalysis(skia::AnalysisCanvas* canvas, | 90 void RasterForAnalysis(skia::AnalysisCanvas* canvas, |
| 87 const gfx::Rect& canvas_rect, | 91 const gfx::Rect& canvas_rect, |
| 88 float contents_scale) const; | 92 float contents_scale) const; |
| 89 | 93 |
| 90 void RasterCommon(SkCanvas* canvas, | 94 void RasterCommon(SkCanvas* canvas, |
| 91 SkPicture::AbortCallback* callback, | 95 SkPicture::AbortCallback* callback, |
| 92 const gfx::Rect& canvas_bitmap_rect, | 96 const gfx::Rect& canvas_bitmap_rect, |
| 93 const gfx::Rect& canvas_playback_rect, | 97 const gfx::Rect& canvas_playback_rect, |
| 94 float contents_scale) const; | 98 float contents_scale) const; |
| 95 | 99 |
| 96 DISALLOW_COPY_AND_ASSIGN(DisplayListRasterSource); | 100 DISALLOW_COPY_AND_ASSIGN(DisplayListRasterSource); |
| 97 }; | 101 }; |
| 98 | 102 |
| 99 } // namespace cc | 103 } // namespace cc |
| 100 | 104 |
| 101 #endif // CC_PLAYBACK_DISPLAY_LIST_RASTER_SOURCE_H_ | 105 #endif // CC_PLAYBACK_DISPLAY_LIST_RASTER_SOURCE_H_ |
| OLD | NEW |