@@ -26,8 +26,8 @@ class OpenGLSharedContext {
26
26
return instance;
27
27
}
28
28
29
- gl::Display* getDisplay () { return _glDisplay.get (); }
30
- gl::Context* getContext () { return _glContext.get (); }
29
+ gl::Display * getDisplay () { return _glDisplay.get (); }
30
+ gl::Context * getContext () { return _glContext.get (); }
31
31
32
32
private:
33
33
std::unique_ptr<gl::Display> _glDisplay;
@@ -63,8 +63,11 @@ class OpenGLContext {
63
63
}
64
64
65
65
// Create texture
66
+ auto GL_RGBA8 = 0x8058 ;
67
+ auto format = GrBackendFormats::MakeGL (GL_RGBA8, GL_TEXTURE_2D);
66
68
auto texture = _directContext->createBackendTexture (
67
- width, height, colorType, skgpu::Mipmapped::kNo , GrRenderable::kYes );
69
+ width, height, format, SkColors::kTransparent , skgpu::Mipmapped::kNo ,
70
+ GrRenderable::kYes );
68
71
69
72
if (!texture.isValid ()) {
70
73
RNSkLogger::logToConsole (" couldn't create offscreen texture %dx%d" , width,
@@ -153,8 +156,8 @@ class OpenGLContext {
153
156
std::unique_ptr<WindowContext> MakeWindow (ANativeWindow *window, int width,
154
157
int height) {
155
158
auto display = OpenGLSharedContext::getInstance ().getDisplay ();
156
- return std::make_unique<OpenGLWindowContext>(
157
- _directContext. get (), display, _glContext.get (), window);
159
+ return std::make_unique<OpenGLWindowContext>(_directContext. get (), display,
160
+ _glContext.get (), window);
158
161
}
159
162
160
163
GrDirectContext *getDirectContext () { return _directContext.get (); }
@@ -180,4 +183,4 @@ class OpenGLContext {
180
183
}
181
184
};
182
185
183
- } // namespace RNSkia
186
+ } // namespace RNSkia
0 commit comments