Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Functions
SkiaGLContext.mm File Reference
#include "tools/skottie_ios_app/SkiaContext.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkSurface.h"
#include "include/gpu/GrBackendSurface.h"
#include "include/gpu/GrDirectContext.h"
#include "include/gpu/ganesh/SkSurfaceGanesh.h"
#include "include/gpu/ganesh/gl/GrGLBackendSurface.h"
#include "include/gpu/ganesh/gl/GrGLDirectContext.h"
#include "include/gpu/gl/GrGLInterface.h"
#include "include/gpu/gl/GrGLTypes.h"
#include "src/base/SkTime.h"
import <GLKit/GLKit.h>
import <UIKit/UIKit.h>
import <OpenGLES/ES3/gl.h>
#include <CoreFoundation/CoreFoundation.h>

Go to the source code of this file.

Classes

class  SkiaGLView
 
class  SkiaGLContext
 

Functions

static void configure_glkview_for_skia (GLKView *view)
 
static sk_sp< SkSurfacemake_gl_surface (GrDirectContext *dContext, int width, int height)
 
SkiaContextMakeSkiaGLContext ()
 

Function Documentation

◆ configure_glkview_for_skia()

static void configure_glkview_for_skia ( GLKView *  view)
static

Definition at line 23 of file SkiaGLContext.mm.

23 {
24 [view setDrawableColorFormat:GLKViewDrawableColorFormatRGBA8888];
25 [view setDrawableDepthFormat:GLKViewDrawableDepthFormat24];
26 [view setDrawableStencilFormat:GLKViewDrawableStencilFormat8];
27}

◆ make_gl_surface()

static sk_sp< SkSurface > make_gl_surface ( GrDirectContext dContext,
int  width,
int  height 
)
static

Definition at line 29 of file SkiaGLContext.mm.

29 {
30 static constexpr int kStencilBits = 8;
31 static constexpr int kSampleCount = 1;
32 static const SkSurfaceProps surfaceProps;
33 if (!dContext || width <= 0 || height <= 0) {
34 return nullptr;
35 }
36 GLint fboid = 0;
37 glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &fboid);
39 dContext,
41 height,
43 kStencilBits,
44 GrGLFramebufferInfo{(GrGLuint)fboid, GL_RGBA8}),
47 nullptr,
48 &surfaceProps);
49}
static constexpr int kSampleCount
unsigned int GrGLuint
Definition GrGLTypes.h:113
@ kBottomLeft_GrSurfaceOrigin
Definition GrTypes.h:149
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
Definition SkColorType.h:24
SK_API GrBackendRenderTarget MakeGL(int width, int height, int sampleCnt, int stencilBits, const GrGLFramebufferInfo &glInfo)
SK_API sk_sp< SkSurface > WrapBackendRenderTarget(GrRecordingContext *context, const GrBackendRenderTarget &backendRenderTarget, GrSurfaceOrigin origin, SkColorType colorType, sk_sp< SkColorSpace > colorSpace, const SkSurfaceProps *surfaceProps, RenderTargetReleaseProc releaseProc=nullptr, ReleaseContext releaseContext=nullptr)
int32_t height
int32_t width

◆ MakeSkiaGLContext()

SkiaContext * MakeSkiaGLContext ( )

Definition at line 150 of file SkiaGLContext.mm.

150{ return [[SkiaGLContext alloc] init]; }
init(device_serial, adb_binary)
Definition _adb_path.py:12