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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 23 matching lines...) Expand all Loading... | |
34 SkColor solid_color; | 34 SkColor solid_color; |
35 }; | 35 }; |
36 | 36 |
37 // Raster a subrect of this RasterSource into the given canvas. It is | 37 // Raster a subrect of this RasterSource into the given canvas. It is |
38 // assumed that contents_scale has already been applied to this canvas. | 38 // assumed that contents_scale has already been applied to this canvas. |
39 // Writes the total number of pixels rasterized and the time spent | 39 // Writes the total number of pixels rasterized and the time spent |
40 // rasterizing to the stats if the respective pointer is not nullptr. | 40 // rasterizing to the stats if the respective pointer is not nullptr. |
41 // It is assumed that the canvas passed here will only be rasterized by | 41 // It is assumed that the canvas passed here will only be rasterized by |
42 // this raster source via this call. | 42 // this raster source via this call. |
43 virtual void PlaybackToCanvas(SkCanvas* canvas, | 43 virtual void PlaybackToCanvas(SkCanvas* canvas, |
44 const gfx::Rect& canvas_rect, | 44 const gfx::Rect& canvas_bitmap_rect, |
45 const gfx::Rect& canvas_playback_rect, | |
reveman
2015/05/28 05:07:24
Instead of adding another rect here, can we use Sk
danakj
2015/05/28 18:54:46
I don't like this, it really limits what the calle
reveman
2015/05/29 14:50:26
I'm sure you're right. It's just hard for me to se
| |
45 float contents_scale) const = 0; | 46 float contents_scale) const = 0; |
46 | 47 |
47 // Similar to above, except that the canvas passed here can (or was already) | 48 // Similar to above, except that the canvas passed here can (or was already) |
48 // rasterized into by another raster source. That is, it is not safe to clear | 49 // rasterized into by another raster source. That is, it is not safe to clear |
49 // the canvas or discard its underlying memory. | 50 // the canvas or discard its underlying memory. |
50 virtual void PlaybackToSharedCanvas(SkCanvas* canvas, | 51 virtual void PlaybackToSharedCanvas(SkCanvas* canvas, |
51 const gfx::Rect& canvas_rect, | 52 const gfx::Rect& canvas_rect, |
52 float contents_scale) const = 0; | 53 float contents_scale) const = 0; |
53 | 54 |
54 // Analyze to determine if the given rect at given scale is of solid color in | 55 // Analyze to determine if the given rect at given scale is of solid color in |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
107 RasterSource() {} | 108 RasterSource() {} |
108 virtual ~RasterSource() {} | 109 virtual ~RasterSource() {} |
109 | 110 |
110 private: | 111 private: |
111 DISALLOW_COPY_AND_ASSIGN(RasterSource); | 112 DISALLOW_COPY_AND_ASSIGN(RasterSource); |
112 }; | 113 }; |
113 | 114 |
114 } // namespace cc | 115 } // namespace cc |
115 | 116 |
116 #endif // CC_PLAYBACK_RASTER_SOURCE_H_ | 117 #endif // CC_PLAYBACK_RASTER_SOURCE_H_ |
OLD | NEW |