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

Unified Diff: ui/gfx/canvas.cc

Issue 2682123003: Remove uses of skia::ReadPixels(PaintCanvas) (Closed)
Patch Set: more readpixels 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 | « ui/gfx/canvas.h ('k') | ui/gfx/color_analysis_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/canvas.cc
diff --git a/ui/gfx/canvas.cc b/ui/gfx/canvas.cc
index c2e62df752578e31b9681572dbc68ff0e536fa68..43d799716b479999dc736c5aed223e47428c5811 100644
--- a/ui/gfx/canvas.cc
+++ b/ui/gfx/canvas.cc
@@ -545,6 +545,13 @@ void Canvas::Transform(const gfx::Transform& transform) {
canvas_->concat(transform.matrix());
}
+SkBitmap Canvas::ToBitmap() {
+ SkBitmap bitmap;
+ bitmap.setInfo(canvas_->imageInfo());
+ canvas_->readPixels(&bitmap, 0, 0);
+ return bitmap;
+}
+
bool Canvas::IntersectsClipRect(const SkRect& rect) {
SkRect clip;
return canvas_->getLocalClipBounds(&clip) && clip.intersects(rect);
« no previous file with comments | « ui/gfx/canvas.h ('k') | ui/gfx/color_analysis_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698