Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: skia/ext/bitmap_platform_device_mac.cc

Issue 7633040: CL removing inheritance of SkDevice from PlatformDevice. Flavours of PlatformDevice classes now ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « skia/ext/bitmap_platform_device_mac.h ('k') | skia/ext/bitmap_platform_device_win.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « skia/ext/bitmap_platform_device_mac.h ('k') | skia/ext/bitmap_platform_device_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698