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

Unified Diff: ui/gfx/canvas_paint_mac.mm

Issue 2612023003: don't need native-drawing-context for CanvasSkiaPaint (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698