blob: f3c17d075d542244978b230181cfb665c0aa8721 [file] [log] [blame]
reed8e474782014-10-06 11:00:51 -07001/*
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 */
reed938dfba2014-10-06 06:08:16 -07007
reede3323962014-10-24 11:16:19 -07008// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
9// DO NOT USE -- FOR INTERNAL TESTING ONLY
10
reed73c25012014-11-17 06:15:42 -080011#ifndef sk_surface_DEFINED
12#define sk_surface_DEFINED
reed8e474782014-10-06 11:00:51 -070013
reed73c25012014-11-17 06:15:42 -080014#include "sk_types.h"
reed8e474782014-10-06 11:00:51 -070015
reed73c25012014-11-17 06:15:42 -080016SK_C_PLUS_PLUS_BEGIN_GUARD
reed938dfba2014-10-06 06:08:16 -070017
halcanary219f18f2015-09-01 10:01:38 -070018SK_API sk_surface_t* sk_surface_new_raster(const sk_imageinfo_t*, const sk_surfaceprops_t*);
19SK_API sk_surface_t* sk_surface_new_raster_direct(const sk_imageinfo_t*,
20 void* pixels, size_t rowBytes,
21 const sk_surfaceprops_t* props);
22SK_API void sk_surface_unref(sk_surface_t*);
reede3323962014-10-24 11:16:19 -070023
24/**
25 * Return the canvas associated with this surface. Note: the canvas is owned by the surface,
26 * so the returned object is only valid while the owning surface is valid.
27 */
halcanary219f18f2015-09-01 10:01:38 -070028SK_API sk_canvas_t* sk_surface_get_canvas(sk_surface_t*);
reed73c25012014-11-17 06:15:42 -080029
30/**
31 * Call sk_image_unref() when the returned image is no longer used.
32 */
halcanary219f18f2015-09-01 10:01:38 -070033SK_API sk_image_t* sk_surface_new_image_snapshot(sk_surface_t*);
reed938dfba2014-10-06 06:08:16 -070034
reed73c25012014-11-17 06:15:42 -080035SK_C_PLUS_PLUS_END_GUARD
36
reed8e474782014-10-06 11:00:51 -070037#endif