Chromium Code Reviews| Index: ui/gfx/canvas_paint_mac.mm |
| diff --git a/ui/gfx/canvas_paint_mac.mm b/ui/gfx/canvas_paint_mac.mm |
| index f29a6afa4eb05594b1b39a25ac9d113b80690f5c..6b2cd66c3fd3894754a56034aa470d109aa1f0ce 100644 |
| --- a/ui/gfx/canvas_paint_mac.mm |
| +++ b/ui/gfx/canvas_paint_mac.mm |
| @@ -2,6 +2,8 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +#include "base/mac/mac_util.h" |
| +#include "third_party/skia/include/utils/mac/SkCGUtils.h" |
| #include "ui/gfx/canvas_paint_mac.h" |
| #include "ui/gfx/geometry/size.h" |
| @@ -25,9 +27,12 @@ CanvasSkiaPaint::~CanvasSkiaPaint() { |
| canvas->restoreToCount(1); |
| // Blit the dirty rect to the current context. |
| - skia::ScopedPlatformPaint spp(canvas); |
| - CGImageRef image = |
| - CGBitmapContextCreateImage(spp.GetNativeDrawingContext()); |
| + SkPixmap pixmap; |
| + bool peek = canvas->peekPixels(&pixmap); |
|
f(malita)
2017/01/04 14:31:36
DCHECK(peek)?
reed1
2017/01/04 14:48:22
Done.
|
| + SkBitmap bitmap; |
| + bitmap.installPixels(pixmap); |
| + CGImageRef image = SkCreateCGImageRefWithColorspace( |
| + bitmap, base::mac::GetSystemColorSpace()); |
| CGRect dest_rect = NSRectToCGRect(rectangle_); |
| CGContextRef destination_context = |