Fix recycler view test (#3537)

This commit is contained in:
Adrian Cojocaru
2025-06-07 20:00:38 +03:00
committed by GitHub
parent b0e2e2ce85
commit 6704f0f80a
13 changed files with 42 additions and 30 deletions

View File

@@ -68,6 +68,11 @@ void AndroidVulkanRendererBackend::resizeFramebuffer(int width, int height) {
}
}
PremultipliedImage AndroidVulkanRendererBackend::readFramebuffer() {
// TODO not implemented
return PremultipliedImage(Size(2, 2));
}
} // namespace android
} // namespace mbgl

View File

@@ -21,6 +21,7 @@ public:
std::vector<const char*> getInstanceExtensions() override;
void resizeFramebuffer(int width, int height) override;
PremultipliedImage readFramebuffer() override;
// mbgl::gfx::RendererBackend implementation
public:

View File

@@ -234,8 +234,14 @@ void MapRenderer::onSurfaceCreated(JNIEnv& env, const jni::Object<AndroidSurface
// The android system will have already destroyed the underlying
// GL resources if this is not the first initialization and an
// attempt to clean them up will fail
if (backend) backend->markContextLost();
if (renderer) renderer->markContextLost();
if (backend) {
gfx::BackendScope backendGuard{backend->getImpl()};
backend->markContextLost();
}
if (renderer) {
renderer->markContextLost();
}
// Reset in opposite order
renderer.reset();
@@ -270,12 +276,14 @@ void MapRenderer::onSurfaceCreated(JNIEnv& env, const jni::Object<AndroidSurface
}
}
void MapRenderer::onSurfaceChanged(JNIEnv& env, jint width, jint height) {
void MapRenderer::onSurfaceChanged([[maybe_unused]] JNIEnv& env, jint width, jint height) {
#if MLN_RENDER_BACKEND_OPENGL
if (!renderer) {
// In case the surface has been destroyed (due to app back-grounding)
jni::jobject* nullObj = nullptr;
onSurfaceCreated(env, jni::Object<AndroidSurface>(nullObj));
}
#endif
backend->resizeFramebuffer(width, height);
framebufferSizeChanged = true;