| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 if (context) | 173 if (context) |
| 174 CGContextRelease(context); | 174 CGContextRelease(context); |
| 175 | 175 |
| 176 return rv; | 176 return rv; |
| 177 } | 177 } |
| 178 | 178 |
| 179 // The device will own the bitmap, which corresponds to also owning the pixel | 179 // The device will own the bitmap, which corresponds to also owning the pixel |
| 180 // data. Therefore, we do not transfer ownership to the SkDevice's bitmap. | 180 // data. Therefore, we do not transfer ownership to the SkDevice's bitmap. |
| 181 BitmapPlatformDevice::BitmapPlatformDevice( | 181 BitmapPlatformDevice::BitmapPlatformDevice( |
| 182 BitmapPlatformDeviceData* data, const SkBitmap& bitmap) | 182 BitmapPlatformDeviceData* data, const SkBitmap& bitmap) |
| 183 : PlatformDevice(bitmap), | 183 : SkDevice(bitmap), |
| 184 data_(data) { | 184 data_(data) { |
| 185 SetPlatformDevice(this, this); |
| 185 } | 186 } |
| 186 | 187 |
| 187 BitmapPlatformDevice::~BitmapPlatformDevice() { | 188 BitmapPlatformDevice::~BitmapPlatformDevice() { |
| 188 data_->unref(); | 189 data_->unref(); |
| 189 } | 190 } |
| 190 | 191 |
| 191 CGContextRef BitmapPlatformDevice::GetBitmapContext() { | 192 CGContextRef BitmapPlatformDevice::GetBitmapContext() { |
| 192 data_->LoadConfig(); | 193 data_->LoadConfig(); |
| 193 return data_->bitmap_context(); | 194 return data_->bitmap_context(); |
| 194 } | 195 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 } | 236 } |
| 236 | 237 |
| 237 SkDevice* BitmapPlatformDevice::onCreateCompatibleDevice( | 238 SkDevice* BitmapPlatformDevice::onCreateCompatibleDevice( |
| 238 SkBitmap::Config config, int width, int height, bool isOpaque, | 239 SkBitmap::Config config, int width, int height, bool isOpaque, |
| 239 Usage /*usage*/) { | 240 Usage /*usage*/) { |
| 240 SkASSERT(config == SkBitmap::kARGB_8888_Config); | 241 SkASSERT(config == SkBitmap::kARGB_8888_Config); |
| 241 return BitmapPlatformDevice::Create(NULL, width, height, isOpaque); | 242 return BitmapPlatformDevice::Create(NULL, width, height, isOpaque); |
| 242 } | 243 } |
| 243 | 244 |
| 244 } // namespace skia | 245 } // namespace skia |
| OLD | NEW |