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

Unified Diff: ui/compositor/canvas_painter.h

Issue 2694023003: Make CanvasPainter raster directly to an SkBitmap (Closed)
Patch Set: Replace CanvasPainter rect with size Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/compositor/canvas_painter.cc » ('j') | ui/compositor/paint_context.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « no previous file | ui/compositor/canvas_painter.cc » ('j') | ui/compositor/paint_context.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698