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

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

Issue 2509983004: Revert "Change call-sites now that SkCanvas is not ref-counted" (Closed)
Patch Set: 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
« no previous file with comments | « skia/ext/bitmap_platform_device_mac_unittest.cc ('k') | skia/ext/bitmap_platform_device_win.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_skia.h" 5 #include "skia/ext/bitmap_platform_device_skia.h"
6 #include "skia/ext/platform_canvas.h" 6 #include "skia/ext/platform_canvas.h"
7 7
8 namespace skia { 8 namespace skia {
9 9
10 BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height, 10 BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height,
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 const SkMatrix& transform, 53 const SkMatrix& transform,
54 const SkIRect& clip_bounds) { 54 const SkIRect& clip_bounds) {
55 // TODO(zhenghao): What should we return? The ptr to the address of the 55 // TODO(zhenghao): What should we return? The ptr to the address of the
56 // pixels? Maybe this won't be called at all. 56 // pixels? Maybe this won't be called at all.
57 SkPixmap pixmap; 57 SkPixmap pixmap;
58 return accessPixels(&pixmap) ? pixmap.writable_addr() : nullptr; 58 return accessPixels(&pixmap) ? pixmap.writable_addr() : nullptr;
59 } 59 }
60 60
61 // PlatformCanvas impl 61 // PlatformCanvas impl
62 62
63 std::unique_ptr<SkCanvas> CreatePlatformCanvas(int width, 63 SkCanvas* CreatePlatformCanvas(int width, int height, bool is_opaque,
64 int height, 64 uint8_t* data, OnFailureType failureType) {
65 bool is_opaque,
66 uint8_t* data,
67 OnFailureType failureType) {
68 sk_sp<SkBaseDevice> dev( 65 sk_sp<SkBaseDevice> dev(
69 BitmapPlatformDevice::Create(width, height, is_opaque, data)); 66 BitmapPlatformDevice::Create(width, height, is_opaque, data));
70 return CreateCanvas(dev, failureType); 67 return CreateCanvas(dev, failureType);
71 } 68 }
72 69
73 } // namespace skia 70 } // namespace skia
OLDNEW
« no previous file with comments | « skia/ext/bitmap_platform_device_mac_unittest.cc ('k') | skia/ext/bitmap_platform_device_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698