Flutter Engine
The Flutter Engine
Instance Methods | Properties | List of all members
SkiaGLView Class Reference
Inheritance diagram for SkiaGLView:

Instance Methods

(void) - drawRect:
 
(instancetype) - initWithFrame:withEAGLContext:withDirectContext:
 

Properties

SkiaViewControllercontroller
 

Detailed Description

Definition at line 52 of file SkiaGLContext.mm.

Method Documentation

◆ drawRect:

- (void) drawRect: (CGRect)  rect

Definition at line 53 of file SkiaGLContext.mm.

77 :(CGRect)rect {
78 SkiaViewController* viewController = [self controller];
79 static constexpr double kFrameRate = 1.0 / 30.0;
80 double next = [viewController isPaused] ? 0 : kFrameRate + SkTime::GetNSecs() * 1e-9;
81
82 [super drawRect:rect];
83
84 int width = (int)[self drawableWidth],
85 height = (int)[self drawableHeight];
86 if (!(fDContext)) {
87 NSLog(@"Error: GrDirectContext missing.\n");
88 return;
89 }
91 [viewController draw:rect
92 toCanvas:(surface->getCanvas())
93 atSize:CGSize{(CGFloat)width, (CGFloat)height}];
95 }
96 if (next) {
97 [NSTimer scheduledTimerWithTimeInterval:std::max(0.0, next - SkTime::GetNSecs() * 1e-9)
98 target:self
99 selector:@selector(setNeedsDisplay)
100 userInfo:nil
101 repeats:NO];
102 }
103}
static float next(float f)
static sk_sp< SkSurface > make_gl_surface(GrDirectContext *dContext, int width, int height)
GrDirectContext * fDContext
void flushAndSubmit(GrSyncCpu sync=GrSyncCpu::kNo)
VkSurfaceKHR surface
Definition: main.cc:49
void draw:toCanvas:atSize:(CGRect rect,[toCanvas] SkCanvas *canvas,[atSize] CGSize size)
FlutterViewController * viewController
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350
int32_t height
int32_t width

◆ initWithFrame:withEAGLContext:withDirectContext:

- (instancetype) initWithFrame: (CGRect)  frame
withEAGLContext: (EAGLContext*)  eaglContext
withDirectContext: (GrDirectContext*)  dContext 
Initial value:

Definition at line 53 of file SkiaGLContext.mm.

68 :(CGRect)frame
69 withEAGLContext:(EAGLContext*)eaglContext
70 withDirectContext:(GrDirectContext*)dContext {
71 self = [super initWithFrame:frame context:eaglContext];
72 fDContext = dContext;
74 return self;
75}
static void configure_glkview_for_skia(GLKView *view)
double frame
Definition: examples.cpp:31

Property Documentation

◆ controller

- (SkiaViewController*) controller
readwriteatomicstrong

Definition at line 53 of file SkiaGLContext.mm.


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