OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bitmap_platform_device_mac.h" | 5 #include "skia/ext/bitmap_platform_device_mac.h" |
6 | 6 |
7 #import <ApplicationServices/ApplicationServices.h> | 7 #import <ApplicationServices/ApplicationServices.h> |
8 #include <time.h> | 8 #include <time.h> |
9 | 9 |
10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 bounds.size.width = width(); | 226 bounds.size.width = width(); |
227 bounds.size.height = height(); | 227 bounds.size.height = height(); |
228 CGContextDrawImage(context, bounds, image); | 228 CGContextDrawImage(context, bounds, image); |
229 } | 229 } |
230 CGImageRelease(image); | 230 CGImageRelease(image); |
231 | 231 |
232 if (created_dc) | 232 if (created_dc) |
233 data_->ReleaseBitmapContext(); | 233 data_->ReleaseBitmapContext(); |
234 } | 234 } |
235 | 235 |
236 void BitmapPlatformDevice::onAccessBitmap(SkBitmap*) { | 236 const SkBitmap& BitmapPlatformDevice::onAccessBitmap(SkBitmap* bitmap) { |
237 // Not needed in CoreGraphics | 237 // Not needed in CoreGraphics |
| 238 return *bitmap; |
238 } | 239 } |
239 | 240 |
240 SkDevice* BitmapPlatformDevice::onCreateCompatibleDevice( | 241 SkDevice* BitmapPlatformDevice::onCreateCompatibleDevice( |
241 SkBitmap::Config config, int width, int height, bool isOpaque, | 242 SkBitmap::Config config, int width, int height, bool isOpaque, |
242 Usage /*usage*/) { | 243 Usage /*usage*/) { |
243 SkASSERT(config == SkBitmap::kARGB_8888_Config); | 244 SkASSERT(config == SkBitmap::kARGB_8888_Config); |
244 return BitmapPlatformDevice::Create(NULL, width, height, isOpaque); | 245 return BitmapPlatformDevice::Create(NULL, width, height, isOpaque); |
245 } | 246 } |
246 | 247 |
247 } // namespace skia | 248 } // namespace skia |
OLD | NEW |