8c5d93183fb0793e4ddff36662b069b3ecb02668
[platform/upstream/libSkiaSharp.git] / include / c / gr_context.h
1 /*
2  * Copyright 2016 Xamarin 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  */
7
8 // EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
9 // DO NOT USE -- FOR INTERNAL TESTING ONLY
10
11 #ifndef gr_context_DEFINED
12 #define gr_context_DEFINED
13
14 #include "sk_types.h"
15
16 SK_C_PLUS_PLUS_BEGIN_GUARD
17
18 SK_C_API gr_context_t* gr_context_create(gr_backend_t backend, gr_backendcontext_t backendContext, const gr_context_options_t* options);
19 SK_C_API gr_context_t* gr_context_create_with_defaults(gr_backend_t backend, gr_backendcontext_t backendContext);
20 SK_C_API void gr_context_unref(gr_context_t* context);
21 SK_C_API void gr_context_abandon_context(gr_context_t* context);
22 SK_C_API void gr_context_release_resources_and_abandon_context(gr_context_t* context);
23 SK_C_API void gr_context_get_resource_cache_limits(gr_context_t* context, int* maxResources, size_t* maxResourceBytes);
24 SK_C_API void gr_context_set_resource_cache_limits(gr_context_t* context, int maxResources, size_t maxResourceBytes);
25 SK_C_API void gr_context_get_resource_cache_usage(gr_context_t* context, int* maxResources, size_t* maxResourceBytes);
26 SK_C_API int gr_context_get_recommended_sample_count(gr_context_t* context, gr_pixelconfig_t config, float dpi);
27 SK_C_API void gr_context_flush(gr_context_t* context);
28
29 SK_C_API const gr_glinterface_t* gr_glinterface_default_interface();
30 SK_C_API const gr_glinterface_t* gr_glinterface_create_native_interface();
31 SK_C_API const gr_glinterface_t* gr_glinterface_assemble_interface(void* ctx, gr_gl_get_proc get);
32 SK_C_API const gr_glinterface_t* gr_glinterface_assemble_gl_interface(void* ctx, gr_gl_get_proc get);
33 SK_C_API const gr_glinterface_t* gr_glinterface_assemble_gles_interface(void* ctx, gr_gl_get_proc get);
34 SK_C_API void gr_glinterface_unref(gr_glinterface_t* glInterface);
35 SK_C_API gr_glinterface_t* gr_glinterface_clone(gr_glinterface_t* glInterface);
36 SK_C_API bool gr_glinterface_validate(gr_glinterface_t* glInterface);
37 SK_C_API bool gr_glinterface_has_extension(gr_glinterface_t* glInterface, const char* extension);
38
39 SK_C_PLUS_PLUS_END_GUARD
40
41 #endif