Commit 4c5054ae authored by reed's avatar reed Committed by Commit bot

don't need native-drawing-context for CanvasSkiaPaint

BUG=675977

Review-Url: https://codereview.chromium.org/2612023003
Cr-Commit-Position: refs/heads/master@{#441392}
parent fc2e2a6f
......@@ -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,8 +27,14 @@ CanvasSkiaPaint::~CanvasSkiaPaint() {
canvas->restoreToCount(1);
// Blit the dirty rect to the current context.
CGImageRef image =
CGBitmapContextCreateImage(skia::GetNativeDrawingContext(canvas));
SkPixmap pixmap;
bool success = canvas->peekPixels(&pixmap);
DCHECK(success);
SkBitmap bitmap;
success = bitmap.installPixels(pixmap);
DCHECK(success);
CGImageRef image = SkCreateCGImageRefWithColorspace(
bitmap, base::mac::GetSystemColorSpace());
CGRect dest_rect = NSRectToCGRect(rectangle_);
CGContextRef destination_context =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment