| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "skia/ext/platform_canvas_mac.h" | 5 #include "skia/ext/platform_canvas_mac.h" |
| 6 | 6 |
| 7 #include "skia/ext/bitmap_platform_device_mac.h" | 7 #include "skia/ext/bitmap_platform_device_mac.h" |
| 8 #include "SkTypes.h" | 8 #include "SkTypes.h" |
| 9 | 9 |
| 10 namespace skia { | 10 namespace skia { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 } | 29 } |
| 30 | 30 |
| 31 bool PlatformCanvasMac::initialize(int width, | 31 bool PlatformCanvasMac::initialize(int width, |
| 32 int height, | 32 int height, |
| 33 bool is_opaque) { | 33 bool is_opaque) { |
| 34 SkDevice* device = createPlatformDevice(width, height, is_opaque, NULL); | 34 SkDevice* device = createPlatformDevice(width, height, is_opaque, NULL); |
| 35 if (!device) | 35 if (!device) |
| 36 return false; | 36 return false; |
| 37 | 37 |
| 38 setDevice(device); | 38 setDevice(device); |
| 39 device->unref(); // was created with refcount 1, and setDevice also refs | 39 device->unref(); // was created with refcount 1, and setDevice also refs |
| 40 return true; | 40 return true; |
| 41 } | 41 } |
| 42 | 42 |
| 43 CGContextRef PlatformCanvasMac::beginPlatformPaint() { | 43 CGContextRef PlatformCanvasMac::beginPlatformPaint() { |
| 44 return getTopPlatformDevice().GetBitmapContext(); | 44 return getTopPlatformDevice().GetBitmapContext(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void PlatformCanvasMac::endPlatformPaint() { | 47 void PlatformCanvasMac::endPlatformPaint() { |
| 48 // flushing will be done in onAccessBitmap | 48 // flushing will be done in onAccessBitmap |
| 49 } | 49 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 70 is_opaque); | 70 is_opaque); |
| 71 return device; | 71 return device; |
| 72 } | 72 } |
| 73 | 73 |
| 74 SkDevice* PlatformCanvasMac::setBitmapDevice(const SkBitmap&) { | 74 SkDevice* PlatformCanvasMac::setBitmapDevice(const SkBitmap&) { |
| 75 SkASSERT(false); | 75 SkASSERT(false); |
| 76 return NULL; | 76 return NULL; |
| 77 } | 77 } |
| 78 | 78 |
| 79 } // namespace skia | 79 } // namespace skia |
| 80 | |
| OLD | NEW |