Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Instance Methods | Properties | List of all members
SkiaGLContext Class Reference
Inheritance diagram for SkiaGLContext:
SkiaContext

Instance Methods

(instancetype) - init
 
(UIView *) - makeViewWithController:withFrame:
 
(SkiaViewController *) - getViewController:
 

Properties

EAGLContext * eaglContext
 

Detailed Description

Definition at line 106 of file SkiaGLContext.mm.

Method Documentation

◆ getViewController:

- (SkiaViewController *) getViewController: (UIView*)  view

Reimplemented from SkiaContext.

Definition at line 107 of file SkiaGLContext.mm.

145 :(UIView*)view {
146 return [view isKindOfClass:[SkiaGLView class]] ? [(SkiaGLView*)view controller] : nil;
147}

◆ init

- (instancetype) init
Initial value:
{
GrDirectContext * fDContext

Definition at line 107 of file SkiaGLContext.mm.

116 {
117 self = [super init];
118 [self setEaglContext:[[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3]];
119 if (![self eaglContext]) {
120 NSLog(@"Falling back to GLES2.\n");
121 [self setEaglContext:[[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]];
122 }
123 if (![self eaglContext]) {
124 NSLog(@"[[EAGLContext alloc] initWithAPI:...] failed");
125 return nil;
126 }
127 EAGLContext* oldContext = [EAGLContext currentContext];
128 [EAGLContext setCurrentContext:[self eaglContext]];
130 [EAGLContext setCurrentContext:oldContext];
131 if (!fDContext) {
132 NSLog(@"GrDirectContexts::MakeGL failed");
133 return nil;
134 }
135 return self;
136}
EAGLContext * eaglContext
SK_API sk_sp< GrDirectContext > MakeGL()

◆ makeViewWithController:withFrame:

- (UIView *) makeViewWithController: (SkiaViewController*)  vc
withFrame: (CGRect)  frame 

Reimplemented from SkiaContext.

Definition at line 107 of file SkiaGLContext.mm.

138 :(SkiaViewController*)vc withFrame:(CGRect)frame {
139 SkiaGLView* skiaView = [[SkiaGLView alloc] initWithFrame:frame
140 withEAGLContext:[self eaglContext]
141 withDirectContext:fDContext.get()];
142 [skiaView setController:vc];
143 return skiaView;
144}
double frame
Definition examples.cpp:31
instancetype initWithFrame
const myers::Point & get(const myers::Segment &)

Property Documentation

◆ eaglContext

- (EAGLContext*) eaglContext
readwriteatomicstrong

Definition at line 107 of file SkiaGLContext.mm.


The documentation for this class was generated from the following file: