Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: cc/playback/raster_source.h

Issue 2141233002: cc: Clean up RecordingSource API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: keep RecordingSource, move three members to PictureLayer Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
(...skipping 23 matching lines...) Expand all
34 // If set to true, none of the images will be rasterized. 34 // If set to true, none of the images will be rasterized.
35 bool skip_images; 35 bool skip_images;
36 36
37 // If set to true, we will use an image hijack canvas, which enables 37 // If set to true, we will use an image hijack canvas, which enables
38 // compositor image caching. 38 // compositor image caching.
39 bool use_image_hijack_canvas; 39 bool use_image_hijack_canvas;
40 }; 40 };
41 41
42 static scoped_refptr<RasterSource> CreateFromRecordingSource( 42 static scoped_refptr<RasterSource> CreateFromRecordingSource(
43 const RecordingSource* other, 43 const RecordingSource* other,
44 bool can_use_lcd_text); 44 bool can_use_lcd_text,
45 const gfx::Rect& recorded_viewport,
46 const scoped_refptr<DisplayItemList>& display_list,
47 const size_t& painter_reported_memory_usage);
45 48
46 // TODO(trchen): Deprecated. 49 // TODO(trchen): Deprecated.
47 void PlaybackToCanvas(SkCanvas* canvas, 50 void PlaybackToCanvas(SkCanvas* canvas,
48 const gfx::Rect& canvas_bitmap_rect, 51 const gfx::Rect& canvas_bitmap_rect,
49 const gfx::Rect& canvas_playback_rect, 52 const gfx::Rect& canvas_playback_rect,
50 float contents_scale, 53 float contents_scale,
51 const PlaybackSettings& settings) const; 54 const PlaybackSettings& settings) const;
52 55
53 // Raster this RasterSource into the given canvas. Canvas states such as 56 // Raster this RasterSource into the given canvas. Canvas states such as
54 // CTM and clip region will be respected. This function will replace pixels 57 // CTM and clip region will be respected. This function will replace pixels
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 117
115 scoped_refptr<RasterSource> CreateCloneWithoutLCDText() const; 118 scoped_refptr<RasterSource> CreateCloneWithoutLCDText() const;
116 119
117 // Image decode controller should be set once. Its lifetime has to exceed that 120 // Image decode controller should be set once. Its lifetime has to exceed that
118 // of the raster source, since the raster source will access it during raster. 121 // of the raster source, since the raster source will access it during raster.
119 void SetImageDecodeController(ImageDecodeController* image_decode_controller); 122 void SetImageDecodeController(ImageDecodeController* image_decode_controller);
120 123
121 protected: 124 protected:
122 friend class base::RefCountedThreadSafe<RasterSource>; 125 friend class base::RefCountedThreadSafe<RasterSource>;
123 126
124 RasterSource(const RecordingSource* other, bool can_use_lcd_text); 127 RasterSource(const RecordingSource* other,
128 bool can_use_lcd_text,
129 const gfx::Rect& recorded_viewport,
130 const scoped_refptr<DisplayItemList>& display_list,
131 const size_t& painter_reported_memory_usage);
125 RasterSource(const RasterSource* other, bool can_use_lcd_text); 132 RasterSource(const RasterSource* other, bool can_use_lcd_text);
126 virtual ~RasterSource(); 133 virtual ~RasterSource();
127 134
128 // These members are const as this raster source may be in use on another 135 // These members are const as this raster source may be in use on another
129 // thread and so should not be touched after construction. 136 // thread and so should not be touched after construction.
130 const scoped_refptr<DisplayItemList> display_list_; 137 const scoped_refptr<DisplayItemList> display_list_;
131 const size_t painter_reported_memory_usage_; 138 const size_t painter_reported_memory_usage_;
132 const SkColor background_color_; 139 const SkColor background_color_;
133 const bool requires_clear_; 140 const bool requires_clear_;
134 const bool can_use_lcd_text_; 141 const bool can_use_lcd_text_;
(...skipping 15 matching lines...) Expand all
150 void RasterCommon(SkCanvas* canvas, SkPicture::AbortCallback* callback) const; 157 void RasterCommon(SkCanvas* canvas, SkPicture::AbortCallback* callback) const;
151 158
152 void PrepareForPlaybackToCanvas(SkCanvas* canvas) const; 159 void PrepareForPlaybackToCanvas(SkCanvas* canvas) const;
153 160
154 DISALLOW_COPY_AND_ASSIGN(RasterSource); 161 DISALLOW_COPY_AND_ASSIGN(RasterSource);
155 }; 162 };
156 163
157 } // namespace cc 164 } // namespace cc
158 165
159 #endif // CC_PLAYBACK_RASTER_SOURCE_H_ 166 #endif // CC_PLAYBACK_RASTER_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698