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

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

Issue 2476113002: Change call-sites now that SkCanvas is not ref-counted (Closed)
Patch Set: try fixing win again Created 4 years, 1 month 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
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 <stddef.h> 8 #include <stddef.h>
9 #include <time.h> 9 #include <time.h>
10 10
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 SkBaseDevice* BitmapPlatformDevice::onCreateDevice(const CreateInfo& cinfo, 253 SkBaseDevice* BitmapPlatformDevice::onCreateDevice(const CreateInfo& cinfo,
254 const SkPaint*) { 254 const SkPaint*) {
255 const SkImageInfo& info = cinfo.fInfo; 255 const SkImageInfo& info = cinfo.fInfo;
256 const bool do_clear = !info.isOpaque(); 256 const bool do_clear = !info.isOpaque();
257 SkASSERT(info.colorType() == kN32_SkColorType); 257 SkASSERT(info.colorType() == kN32_SkColorType);
258 return Create(NULL, info.width(), info.height(), info.isOpaque(), do_clear); 258 return Create(NULL, info.width(), info.height(), info.isOpaque(), do_clear);
259 } 259 }
260 260
261 // PlatformCanvas impl 261 // PlatformCanvas impl
262 262
263 SkCanvas* CreatePlatformCanvas(CGContextRef ctx, int width, int height, 263 std::unique_ptr<SkCanvas> CreatePlatformCanvas(CGContextRef ctx,
264 bool is_opaque, OnFailureType failureType) { 264 int width,
265 int height,
266 bool is_opaque,
267 OnFailureType failureType) {
265 const bool do_clear = false; 268 const bool do_clear = false;
266 sk_sp<SkBaseDevice> dev( 269 sk_sp<SkBaseDevice> dev(
267 BitmapPlatformDevice::Create(ctx, width, height, is_opaque, do_clear)); 270 BitmapPlatformDevice::Create(ctx, width, height, is_opaque, do_clear));
268 return CreateCanvas(dev, failureType); 271 return CreateCanvas(dev, failureType);
269 } 272 }
270 273
271 SkCanvas* CreatePlatformCanvas(int width, int height, bool is_opaque, 274 std::unique_ptr<SkCanvas> CreatePlatformCanvas(int width,
272 uint8_t* data, OnFailureType failureType) { 275 int height,
276 bool is_opaque,
277 uint8_t* data,
278 OnFailureType failureType) {
273 sk_sp<SkBaseDevice> dev( 279 sk_sp<SkBaseDevice> dev(
274 BitmapPlatformDevice::CreateWithData(data, width, height, is_opaque)); 280 BitmapPlatformDevice::CreateWithData(data, width, height, is_opaque));
275 return CreateCanvas(dev, failureType); 281 return CreateCanvas(dev, failureType);
276 } 282 }
277 283
278 } // namespace skia 284 } // namespace skia
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698