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

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..39a4171bfc5a71744045406d46fddb9a4e5d00a1 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());
+ ToBitmap(), base::mac::GetSystemColorSpace());
CGRect dest_rect = NSRectToCGRect(rectangle_);
CGContextRef destination_context =

Powered by Google App Engine
This is Rietveld 408576698