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

Side by Side Diff: skia/ext/bitmap_platform_device_cairo.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/analysis_canvas_unittest.cc ('k') | skia/ext/bitmap_platform_device_mac.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 "build/build_config.h" 5 #include "build/build_config.h"
6 #include "skia/ext/bitmap_platform_device_cairo.h" 6 #include "skia/ext/bitmap_platform_device_cairo.h"
7 #include "skia/ext/platform_canvas.h" 7 #include "skia/ext/platform_canvas.h"
8 8
9 #if defined(OS_OPENBSD) 9 #if defined(OS_OPENBSD)
10 #include <cairo.h> 10 #include <cairo.h>
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 // Tell cairo to flush anything it has pending. 159 // Tell cairo to flush anything it has pending.
160 cairo_surface_flush(surface); 160 cairo_surface_flush(surface);
161 // Tell Cairo that we (probably) modified (actually, will modify) its pixel 161 // Tell Cairo that we (probably) modified (actually, will modify) its pixel
162 // buffer directly. 162 // buffer directly.
163 cairo_surface_mark_dirty(surface); 163 cairo_surface_mark_dirty(surface);
164 return cairo_; 164 return cairo_;
165 } 165 }
166 166
167 // PlatformCanvas impl 167 // PlatformCanvas impl
168 168
169 std::unique_ptr<SkCanvas> CreatePlatformCanvas(int width, 169 SkCanvas* CreatePlatformCanvas(int width, int height, bool is_opaque,
170 int height, 170 uint8_t* data, OnFailureType failureType) {
171 bool is_opaque,
172 uint8_t* data,
173 OnFailureType failureType) {
174 sk_sp<SkBaseDevice> dev( 171 sk_sp<SkBaseDevice> dev(
175 BitmapPlatformDevice::Create(width, height, is_opaque, data)); 172 BitmapPlatformDevice::Create(width, height, is_opaque, data));
176 return CreateCanvas(dev, failureType); 173 return CreateCanvas(dev, failureType);
177 } 174 }
178 175
179 } // namespace skia 176 } // namespace skia
OLDNEW
« no previous file with comments | « skia/ext/analysis_canvas_unittest.cc ('k') | skia/ext/bitmap_platform_device_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698