Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
fl_compositor_opengl_shader.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_SHELL_PLATFORM_LINUX_FL_COMPOSITOR_OPENGL_SHADER_H_
6#define FLUTTER_SHELL_PLATFORM_LINUX_FL_COMPOSITOR_OPENGL_SHADER_H_
7
8#include <glib-object.h>
9
11
12G_BEGIN_DECLS
13
14G_DECLARE_FINAL_TYPE(FlCompositorOpenGLShader,
15 fl_compositor_opengl_shader,
16 FL,
17 COMPOSITOR_OPENGL_SHADER,
18 GObject)
19
20/**
21 * FlCompositorOpenGLShader:
22 *
23 * #FlCompositorOpenGLShader is the shader program used by #FlCompositorOpenGL
24 * to composite Flutter layers onto the framebuffer.
25 */
26
27/**
28 * fl_compositor_opengl_shader_new:
29 * @opengl_manager: an #FlOpenGLManager.
30 *
31 * Creates and compiles the compositor shader program. Requires a valid OpenGL
32 * context to create.
33 *
34 * Returns: a new #FlCompositorOpenGLShader.
35 */
36FlCompositorOpenGLShader* fl_compositor_opengl_shader_new(
37 FlOpenGLManager* opengl_manager);
38
39/**
40 * fl_compositor_opengl_shader_use:
41 * @shader: an #FlCompositorOpenGLShader.
42 *
43 * Binds the shader's vertex buffer, configures the vertex attributes and makes
44 * the program current. Requires a valid OpenGL context.
45 */
46void fl_compositor_opengl_shader_use(FlCompositorOpenGLShader* shader);
47
48/**
49 * fl_compositor_opengl_shader_set_offset:
50 * @shader: an #FlCompositorOpenGLShader.
51 * @x: horizontal offset.
52 * @y: vertical offset.
53 *
54 * Sets the layer offset uniform. The program must be current (see
55 * fl_compositor_opengl_shader_use).
56 */
57void fl_compositor_opengl_shader_set_offset(FlCompositorOpenGLShader* shader,
58 double x,
59 double y);
60
61/**
62 * fl_compositor_opengl_shader_set_scale:
63 * @shader: an #FlCompositorOpenGLShader.
64 * @x: horizontal scale.
65 * @y: vertical scale.
66 *
67 * Sets the layer scale uniform. The program must be current (see
68 * fl_compositor_opengl_shader_use).
69 */
70void fl_compositor_opengl_shader_set_scale(FlCompositorOpenGLShader* shader,
71 double x,
72 double y);
73
74G_END_DECLS
75
76#endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_COMPOSITOR_OPENGL_SHADER_H_
int32_t x
G_BEGIN_DECLS FlOpenGLManager * opengl_manager
FlCompositorOpenGLShader * fl_compositor_opengl_shader_new(FlOpenGLManager *opengl_manager)
void fl_compositor_opengl_shader_use(FlCompositorOpenGLShader *shader)
G_BEGIN_DECLS G_DECLARE_FINAL_TYPE(FlCompositorOpenGLShader, fl_compositor_opengl_shader, FL, COMPOSITOR_OPENGL_SHADER, GObject) FlCompositorOpenGLShader *fl_compositor_opengl_shader_new(FlOpenGLManager *opengl_manager)
void fl_compositor_opengl_shader_set_scale(FlCompositorOpenGLShader *shader, double x, double y)
void fl_compositor_opengl_shader_set_offset(FlCompositorOpenGLShader *shader, double x, double y)
double y