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

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

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 3 years, 12 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
« no previous file with comments | « skia/ext/bitmap_platform_device_cairo.cc ('k') | skia/ext/bitmap_platform_device_skia.cc » ('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) 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 std::unique_ptr<SkCanvas> CreatePlatformCanvas(CGContextRef ctx, 263 std::unique_ptr<CdlCanvas> CreatePlatformCanvas(CGContextRef ctx,
264 int width, 264 int width,
265 int height, 265 int height,
266 bool is_opaque, 266 bool is_opaque,
267 OnFailureType failureType) { 267 OnFailureType failureType) {
268 const bool do_clear = false; 268 const bool do_clear = false;
269 sk_sp<SkBaseDevice> dev( 269 sk_sp<SkBaseDevice> dev(
270 BitmapPlatformDevice::Create(ctx, width, height, is_opaque, do_clear)); 270 BitmapPlatformDevice::Create(ctx, width, height, is_opaque, do_clear));
271 return CreateCanvas(dev, failureType); 271 return CreateCanvas(dev, failureType);
272 } 272 }
273 273
274 std::unique_ptr<SkCanvas> CreatePlatformCanvas(int width, 274 std::unique_ptr<CdlCanvas> CreatePlatformCanvas(int width,
275 int height, 275 int height,
276 bool is_opaque, 276 bool is_opaque,
277 uint8_t* data, 277 uint8_t* data,
278 OnFailureType failureType) { 278 OnFailureType failureType) {
279 sk_sp<SkBaseDevice> dev( 279 sk_sp<SkBaseDevice> dev(
280 BitmapPlatformDevice::CreateWithData(data, width, height, is_opaque)); 280 BitmapPlatformDevice::CreateWithData(data, width, height, is_opaque));
281 return CreateCanvas(dev, failureType); 281 return CreateCanvas(dev, failureType);
282 } 282 }
283 283
284 } // namespace skia 284 } // namespace skia
OLDNEW
« no previous file with comments | « skia/ext/bitmap_platform_device_cairo.cc ('k') | skia/ext/bitmap_platform_device_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698