| OLD | NEW |
| 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 Loading... |
| 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 SkCanvas* CreatePlatformCanvas(int width, int height, bool is_opaque, | 169 std::unique_ptr<SkCanvas> CreatePlatformCanvas(int width, |
| 170 uint8_t* data, OnFailureType failureType) { | 170 int height, |
| 171 bool is_opaque, |
| 172 uint8_t* data, |
| 173 OnFailureType failureType) { |
| 171 sk_sp<SkBaseDevice> dev( | 174 sk_sp<SkBaseDevice> dev( |
| 172 BitmapPlatformDevice::Create(width, height, is_opaque, data)); | 175 BitmapPlatformDevice::Create(width, height, is_opaque, data)); |
| 173 return CreateCanvas(dev, failureType); | 176 return CreateCanvas(dev, failureType); |
| 174 } | 177 } |
| 175 | 178 |
| 176 } // namespace skia | 179 } // namespace skia |
| OLD | NEW |