Chromium Code Reviews| Index: ui/compositor/canvas_painter.h |
| diff --git a/ui/compositor/canvas_painter.h b/ui/compositor/canvas_painter.h |
| index ac9489f6fb6b0f86162156c47d629e30558e7dee..b15b501608c2bd0ac780d8bff28dbd3e5d58c25d 100644 |
| --- a/ui/compositor/canvas_painter.h |
| +++ b/ui/compositor/canvas_painter.h |
| @@ -15,29 +15,29 @@ namespace cc { |
| class DisplayItemList; |
| } |
| -namespace gfx { |
| -class Canvas; |
| -} |
| - |
| namespace ui { |
| -// This class provides a simple helper for painting directly to a bitmap |
| -// backed canvas (for painting use-cases other than compositing). After |
| -// constructing an instance of a CanvasPainter, the context() can be used |
| -// to do painting using the normal composited paint paths. When |
| -// the painter is destroyed, any painting done with the context() will be |
| -// rastered into the canvas. |
| +// This class provides a simple helper for rasterizing from a PaintContext |
| +// interface directly into a bitmap. After constructing an instance of a |
| +// CanvasPainter, the context() can be used to do painting using the normal |
| +// composited paint paths. When the painter is destroyed, any painting done |
| +// with the context() will be rastered into the provided output bitmap. |
| +// |
| +// TODO(enne): rename this class to be PaintContextRasterizer or some such. |
| class COMPOSITOR_EXPORT CanvasPainter { |
| public: |
| - CanvasPainter(gfx::Canvas* canvas, float raster_scale_factor); |
| + CanvasPainter(SkBitmap* output, |
|
danakj
2017/02/14 21:37:26
In blink at least this type of thing should be an
|
| + gfx::Size paint_size, |
|
danakj
2017/02/14 21:37:26
const&
|
| + float raster_scale, |
| + SkColor clear_color); |
| ~CanvasPainter(); |
| const PaintContext& context() const { return context_; } |
| private: |
| - gfx::Canvas* const canvas_; |
| - const float raster_scale_factor_; |
| - const gfx::Rect rect_; |
| + SkBitmap* const output_; |
| + const gfx::Size paint_size_; |
| + SkColor clear_color_; |
|
danakj
2017/02/14 21:37:26
const?
|
| scoped_refptr<cc::DisplayItemList> list_; |
| PaintContext context_; |