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

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

Issue 357213002: setConfig is deprecated, use setInfo or allocPixels instead (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « media/video/capture/fake_video_capture_device.cc ('k') | no next file » | 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) 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 CGContextDrawImage(context, bounds, image); 232 CGContextDrawImage(context, bounds, image);
233 } 233 }
234 CGImageRelease(image); 234 CGImageRelease(image);
235 235
236 if (created_dc) 236 if (created_dc)
237 ReleaseBitmapContext(); 237 ReleaseBitmapContext();
238 } 238 }
239 239
240 SkBaseDevice* BitmapPlatformDevice::onCreateDevice(const SkImageInfo& info, 240 SkBaseDevice* BitmapPlatformDevice::onCreateDevice(const SkImageInfo& info,
241 Usage /*usage*/) { 241 Usage /*usage*/) {
242 SkASSERT(info.colorType() == kPMColor_SkColorType); 242 SkASSERT(info.colorType() == kN32_SkColorType);
243 return BitmapPlatformDevice::CreateAndClear(info.width(), info.height(), 243 return BitmapPlatformDevice::CreateAndClear(info.width(), info.height(),
244 info.isOpaque()); 244 info.isOpaque());
245 } 245 }
246 246
247 // PlatformCanvas impl 247 // PlatformCanvas impl
248 248
249 SkCanvas* CreatePlatformCanvas(CGContextRef ctx, int width, int height, 249 SkCanvas* CreatePlatformCanvas(CGContextRef ctx, int width, int height,
250 bool is_opaque, OnFailureType failureType) { 250 bool is_opaque, OnFailureType failureType) {
251 skia::RefPtr<SkBaseDevice> dev = skia::AdoptRef( 251 skia::RefPtr<SkBaseDevice> dev = skia::AdoptRef(
252 BitmapPlatformDevice::Create(ctx, width, height, is_opaque)); 252 BitmapPlatformDevice::Create(ctx, width, height, is_opaque));
(...skipping 23 matching lines...) Expand all
276 276
277 if (!is_opaque) 277 if (!is_opaque)
278 bitmap_.eraseColor(0); 278 bitmap_.eraseColor(0);
279 279
280 surface_ = CGContextForData(bitmap_.getPixels(), bitmap_.width(), 280 surface_ = CGContextForData(bitmap_.getPixels(), bitmap_.width(),
281 bitmap_.height()); 281 bitmap_.height());
282 return true; 282 return true;
283 } 283 }
284 284
285 } // namespace skia 285 } // namespace skia
OLDNEW
« no previous file with comments | « media/video/capture/fake_video_capture_device.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698