Skip to content

Commit

Permalink
Merge branch 'main' into terrysahaidak/chat-example
Browse files Browse the repository at this point in the history
  • Loading branch information
wcandillon authored Nov 30, 2024
2 parents 3ea6cdd + 3401111 commit f6f7cc5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions packages/skia/android/cpp/rnskia-android/OpenGLContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class OpenGLSharedContext {
return instance;
}

gl::Display* getDisplay() { return _glDisplay.get(); }
gl::Context* getContext() { return _glContext.get(); }
gl::Display *getDisplay() { return _glDisplay.get(); }
gl::Context *getContext() { return _glContext.get(); }

private:
std::unique_ptr<gl::Display> _glDisplay;
Expand Down Expand Up @@ -63,8 +63,11 @@ class OpenGLContext {
}

// Create texture
auto GL_RGBA8 = 0x8058;
auto format = GrBackendFormats::MakeGL(GL_RGBA8, GL_TEXTURE_2D);
auto texture = _directContext->createBackendTexture(
width, height, colorType, skgpu::Mipmapped::kNo, GrRenderable::kYes);
width, height, format, SkColors::kTransparent, skgpu::Mipmapped::kNo,
GrRenderable::kYes);

if (!texture.isValid()) {
RNSkLogger::logToConsole("couldn't create offscreen texture %dx%d", width,
Expand Down Expand Up @@ -153,8 +156,8 @@ class OpenGLContext {
std::unique_ptr<WindowContext> MakeWindow(ANativeWindow *window, int width,
int height) {
auto display = OpenGLSharedContext::getInstance().getDisplay();
return std::make_unique<OpenGLWindowContext>(
_directContext.get(), display, _glContext.get(), window);
return std::make_unique<OpenGLWindowContext>(_directContext.get(), display,
_glContext.get(), window);
}

GrDirectContext *getDirectContext() { return _directContext.get(); }
Expand All @@ -180,4 +183,4 @@ class OpenGLContext {
}
};

} // namespace RNSkia
} // namespace RNSkia

0 comments on commit f6f7cc5

Please sign in to comment.