Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android renderThreadManager changed to non static #2872

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
public abstract class MapLibreSurfaceView extends SurfaceView implements SurfaceHolder.Callback2 {

protected static final String TAG = "MapLibreSurfaceView";
protected static final RenderThreadManager renderThreadManager = new RenderThreadManager();
protected final RenderThreadManager renderThreadManager = new RenderThreadManager();

protected SurfaceViewMapRenderer renderer;
protected RenderThread renderThread;
Expand Down Expand Up @@ -266,13 +266,14 @@ protected void onDetachedFromWindow() {
* sRenderThreadManager object. This avoids multiple-lock ordering issues.
*/
abstract static class RenderThread extends Thread {
RenderThread() {
RenderThread(RenderThreadManager aRenderThreadManager) {
super();
width = 0;
height = 0;
requestRender = true;
renderMode = MapRenderer.RenderingRefreshMode.WHEN_DIRTY;
wantRenderNotification = false;
renderThreadManager = aRenderThreadManager;
}

@Override
Expand Down Expand Up @@ -489,6 +490,7 @@ public void waitForEmpty() {
protected ArrayList<Runnable> eventQueue = new ArrayList<>();
protected boolean sizeChanged = true;
protected Runnable finishDrawingRunnable = null;
protected RenderThreadManager renderThreadManager = null;
// End of member variables protected by the sRenderThreadManager monitor.

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ static String formatEglError(String function, int error) {
*/
static class GLThread extends MapLibreSurfaceView.RenderThread {
GLThread(WeakReference<MapLibreGLSurfaceView> surfaceViewWeakRef) {
super();
super(surfaceViewWeakRef.get().renderThreadManager);

mSurfaceViewWeakRef = surfaceViewWeakRef;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ protected void createRenderThread() {

static class VulkanThread extends MapLibreSurfaceView.RenderThread {
VulkanThread(WeakReference<MapLibreVulkanSurfaceView> surfaceViewWeakRef) {
super();
super(surfaceViewWeakRef.get().renderThreadManager);
mSurfaceViewWeakRef = surfaceViewWeakRef;
}

Expand Down
Loading