reed | 8e47478 | 2014-10-06 11:00:51 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
reed | 938dfba | 2014-10-06 06:08:16 -0700 | [diff] [blame] | 7 | |
reed | e332396 | 2014-10-24 11:16:19 -0700 | [diff] [blame] | 8 | // EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL |
| 9 | // DO NOT USE -- FOR INTERNAL TESTING ONLY |
| 10 | |
reed | 73c2501 | 2014-11-17 06:15:42 -0800 | [diff] [blame] | 11 | #ifndef sk_surface_DEFINED |
| 12 | #define sk_surface_DEFINED |
reed | 8e47478 | 2014-10-06 11:00:51 -0700 | [diff] [blame] | 13 | |
reed | 73c2501 | 2014-11-17 06:15:42 -0800 | [diff] [blame] | 14 | #include "sk_types.h" |
reed | 8e47478 | 2014-10-06 11:00:51 -0700 | [diff] [blame] | 15 | |
reed | 73c2501 | 2014-11-17 06:15:42 -0800 | [diff] [blame] | 16 | SK_C_PLUS_PLUS_BEGIN_GUARD |
reed | 938dfba | 2014-10-06 06:08:16 -0700 | [diff] [blame] | 17 | |
robertphillips | 702edbd | 2015-06-23 06:26:08 -0700 | [diff] [blame] | 18 | sk_surface_t* sk_surface_new_raster(const sk_imageinfo_t*, const sk_surfaceprops_t*); |
| 19 | sk_surface_t* sk_surface_new_raster_direct(const sk_imageinfo_t*, void* pixels, size_t rowBytes, |
| 20 | const sk_surfaceprops_t* props); |
reed | afa278e | 2014-11-24 19:11:48 -0800 | [diff] [blame] | 21 | void sk_surface_unref(sk_surface_t*); |
reed | e332396 | 2014-10-24 11:16:19 -0700 | [diff] [blame] | 22 | |
| 23 | /** |
| 24 | * Return the canvas associated with this surface. Note: the canvas is owned by the surface, |
| 25 | * so the returned object is only valid while the owning surface is valid. |
| 26 | */ |
reed | 938dfba | 2014-10-06 06:08:16 -0700 | [diff] [blame] | 27 | sk_canvas_t* sk_surface_get_canvas(sk_surface_t*); |
reed | 73c2501 | 2014-11-17 06:15:42 -0800 | [diff] [blame] | 28 | |
| 29 | /** |
| 30 | * Call sk_image_unref() when the returned image is no longer used. |
| 31 | */ |
reed | 938dfba | 2014-10-06 06:08:16 -0700 | [diff] [blame] | 32 | sk_image_t* sk_surface_new_image_snapshot(sk_surface_t*); |
| 33 | |
reed | 8e47478 | 2014-10-06 11:00:51 -0700 | [diff] [blame] | 34 | #ifdef __cplusplus |
| 35 | class SkCanvas; |
| 36 | void sk_test_capi(SkCanvas*); |
reed | 8e47478 | 2014-10-06 11:00:51 -0700 | [diff] [blame] | 37 | #endif |
| 38 | |
reed | 73c2501 | 2014-11-17 06:15:42 -0800 | [diff] [blame] | 39 | SK_C_PLUS_PLUS_END_GUARD |
| 40 | |
reed | 8e47478 | 2014-10-06 11:00:51 -0700 | [diff] [blame] | 41 | #endif |