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

Unified Diff: ui/gfx/canvas.h

Issue 2758413002: cc/paint: Remove PaintCanvas::peekPixels. (Closed)
Patch Set: update Created 3 years, 9 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
Index: ui/gfx/canvas.h
diff --git a/ui/gfx/canvas.h b/ui/gfx/canvas.h
index 4fcb4bcfbdfe563610198d12239de0f6e12ec6e4..b325cea86fa88d5a8879d273d7eb01790f8dcdc3 100644
--- a/ui/gfx/canvas.h
+++ b/ui/gfx/canvas.h
@@ -11,10 +11,11 @@
#include <vector>
#include "base/macros.h"
+#include "base/optional.h"
#include "base/strings/string16.h"
#include "cc/paint/paint_canvas.h"
#include "cc/paint/paint_flags.h"
-#include "cc/paint/paint_surface.h"
+#include "cc/paint/skia_paint_canvas.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/text_constants.h"
@@ -496,6 +497,7 @@ class GFX_EXPORT Canvas {
bool filter,
const cc::PaintFlags& flags,
bool remove_image_scale);
+ cc::PaintCanvas* CreateOwnedCanvas(const Size& size, bool is_opaque);
// The device scale factor at which drawing on this canvas occurs.
// An additional scale can be applied via Canvas::Scale(). However,
@@ -503,10 +505,11 @@ class GFX_EXPORT Canvas {
float image_scale_;
// canvas_ is our active canvas object. Sometimes we are also the owner,
- // in which case surface_ will be set. Other times we are just
- // borrowing someone else's canvas, in which case canvas_ will point there
- // but surface_ will be null.
- sk_sp<cc::PaintSurface> surface_;
+ // in which case bitmap_ and owned_canvas_ will be set. Other times we are
+ // just borrowing someone else's canvas, in which case canvas_ will point
+ // there but bitmap_ and owned_canvas_ will not exist.
+ base::Optional<SkBitmap> bitmap_;
+ base::Optional<cc::SkiaPaintCanvas> owned_canvas_;
cc::PaintCanvas* canvas_;
DISALLOW_COPY_AND_ASSIGN(Canvas);

Powered by Google App Engine
This is Rietveld 408576698