| Index: ui/base/clipboard/clipboard_mac.mm
|
| diff --git a/ui/base/clipboard/clipboard_mac.mm b/ui/base/clipboard/clipboard_mac.mm
|
| index 9f65e79e7c3f2e26c73d4ca72268a6d58c6f2a7f..4f6b88ad1097a0c5138cb3f3980bbf8f083b6c79 100644
|
| --- a/ui/base/clipboard/clipboard_mac.mm
|
| +++ b/ui/base/clipboard/clipboard_mac.mm
|
| @@ -247,12 +247,15 @@ SkBitmap Clipboard::ReadImage(Buffer buffer) const {
|
|
|
| scoped_nsobject<NSImage> image(
|
| [[NSImage alloc] initWithPasteboard:GetPasteboard()]);
|
| - if (image.get()) {
|
| - [image setFlipped:YES];
|
| - int width = [image size].width;
|
| - int height = [image size].height;
|
| + if (!image.get())
|
| + return SkBitmap();
|
|
|
| - gfx::CanvasSkia canvas(width, height, false);
|
| + [image setFlipped:YES];
|
| + int width = [image size].width;
|
| + int height = [image size].height;
|
| +
|
| + gfx::CanvasSkia canvas(width, height, false);
|
| + {
|
| skia::ScopedPlatformPaint scoped_platform_paint(&canvas);
|
| CGContextRef gc = scoped_platform_paint.GetPlatformSurface();
|
| NSGraphicsContext* cocoa_gc =
|
| @@ -263,9 +266,8 @@ SkBitmap Clipboard::ReadImage(Buffer buffer) const {
|
| operation:NSCompositeCopy
|
| fraction:1.0];
|
| [NSGraphicsContext restoreGraphicsState];
|
| - return canvas.ExtractBitmap();
|
| }
|
| - return SkBitmap();
|
| + return canvas.ExtractBitmap();
|
| }
|
|
|
| void Clipboard::ReadBookmark(string16* title, std::string* url) const {
|
|
|