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

Unified Diff: cc/paint/paint_canvas.cc

Issue 2686173003: Remove uses of skia::GetWritablePixels(PaintCanvas) (Closed)
Patch Set: Add more deps 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 | « cc/paint/paint_canvas.h ('k') | cc/resources/video_resource_updater.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/paint/paint_canvas.cc
diff --git a/cc/paint/paint_canvas.cc b/cc/paint/paint_canvas.cc
index c3512dada61547f9b7d69768df6d6fa316f13acf..042af4754fe0cad7132dcd9f18190bb5f5bf4514 100644
--- a/cc/paint/paint_canvas.cc
+++ b/cc/paint/paint_canvas.cc
@@ -21,4 +21,17 @@ PaintCanvasPassThrough::PaintCanvasPassThrough(int width, int height)
PaintCanvasPassThrough::~PaintCanvasPassThrough() = default;
+bool ToPixmap(PaintCanvas* canvas, SkPixmap* output) {
+ SkImageInfo info;
+ size_t row_bytes;
+ void* pixels = canvas->accessTopLayerPixels(&info, &row_bytes);
+ if (!pixels) {
+ output->reset();
+ return false;
+ }
+
+ output->reset(info, pixels, row_bytes);
+ return true;
+}
+
} // namespace cc
« no previous file with comments | « cc/paint/paint_canvas.h ('k') | cc/resources/video_resource_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698