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

Unified Diff: ui/gfx/canvas_paint_mac.mm

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_paint_mac.mm
diff --git a/ui/gfx/canvas_paint_mac.mm b/ui/gfx/canvas_paint_mac.mm
index ab7dda216fdf965ff89b9ad90a3a8997b2ec1a60..6123d915828f34b61813485b6393a9c1dc5674fc 100644
--- a/ui/gfx/canvas_paint_mac.mm
+++ b/ui/gfx/canvas_paint_mac.mm
@@ -23,20 +23,11 @@ CanvasSkiaPaint::CanvasSkiaPaint(NSRect dirtyRect, bool opaque)
CanvasSkiaPaint::~CanvasSkiaPaint() {
if (!is_empty()) {
- cc::PaintCanvas* canvas = sk_canvas();
- canvas->restoreToCount(1);
+ sk_canvas()->restoreToCount(1);
// Blit the dirty rect to the current context.
- SkPixmap pixmap;
- // TODO(enne): make this class record directly into a bitmap and
- // remove this peekPixels call.
- bool success = canvas->peekPixels(&pixmap);
- DCHECK(success);
- SkBitmap bitmap;
- success = bitmap.installPixels(pixmap);
- DCHECK(success);
CGImageRef image = SkCreateCGImageRefWithColorspace(
- bitmap, base::mac::GetSystemColorSpace());
+ GetBitmap(), base::mac::GetSystemColorSpace());
CGRect dest_rect = NSRectToCGRect(rectangle_);
CGContextRef destination_context =
« ui/gfx/canvas.cc ('K') | « ui/gfx/canvas.cc ('k') | ui/gfx/color_analysis_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698