Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

App switching causes red fill #568

Closed

Description

@ljbade

App switching leaves a red fill

Activity

  1. added
    Android
    on Nov 7, 2014
  2. ljbade commented on Nov 8, 2014

    @ljbade
    ContributorAuthor

    The GL context seems to be destroyed and recreated OK.

    It's getting far enough to fill the screen, but it isn't redrawing the tiles.

    Does it need a redraw triggered?

    Moving around does not fix it either.

  3. ljbade commented on Nov 8, 2014

    @ljbade
    ContributorAuthor

    Is it related to this?

    11-08 20:46:16.933  31657-31657/com.mapbox.mapboxgl.app V/MapView﹕ surfaceChanged
    11-08 20:46:16.933    31657-743/com.mapbox.mapboxgl.app V/../../android/cpp/NativeMapView.cpp:496﹕ MBGLView::make_active
    11-08 20:46:16.933    31657-743/com.mapbox.mapboxgl.app W/Adreno-ES20﹕ < core_glUseProgram:1526 >: GL_INVALID_VALUE
    11-08 20:46:16.933    31657-743/com.mapbox.mapboxgl.app V/../../android/cpp/NativeMapView.cpp:529﹕ MBGLView::swap
    11-08 20:46:16.933    31657-743/com.mapbox.mapboxgl.app V/../../android/cpp/NativeMapView.cpp:496﹕ MBGLView::make_acti
    

    EDIT: fixed this, but still have red screen

  4. ljbade commented on Nov 8, 2014

    @ljbade
    ContributorAuthor

    OK finally got into it with GDB.

    It fails to render anything because there are no layers renderLayers()

    See painter.cpp

    It returns there.

  5. ljbade commented on Nov 8, 2014

    @ljbade
    ContributorAuthor

    Why is style.layers being reset?

  6. ljbade commented on Nov 8, 2014

    @ljbade
    ContributorAuthor

    Perhaps here after map::stop is called in NativeMapView: map.cpp

  7. ljbade commented on Nov 8, 2014

    @ljbade
    ContributorAuthor

    @kkaefer you might be able to help.

    Due to the way Android works, when I switch apps this happens:

    1. Android pauses my app
    2. I call map::stop
    3. I call map::terminate - to release GL objects
    4. Android deletes the GL context

    I switch back:

    1. Android resumes my app
    2. I recreate a new GL context
    3. I call map::start

    It should just pick up where it was, ie the map should not lose state (except for GL rendering related objects and state)
    So it just redraws the tiles from memory (without needing to download them again)

    But when I call map::stop it calls map::async_terminate which resets a bunch of stuff including the style etc.

    So when I resume with map::start and in painter::render if finds style.layers is empty and does not render anything

  8. ljbade commented on Nov 8, 2014

    @ljbade
    ContributorAuthor

    Another error:

    11-08 21:57:27.960  17126-18640/com.mapbox.mapboxgl.app D/HttpRequest﹕ HTTPRequest https://www.mapbox.com/mapbox-gl-styles/sprites/bright.png
    11-08 21:57:27.960  17126-18640/com.mapbox.mapboxgl.app V/../../android/cpp/NativeMapView.cpp:496﹕ MBGLView::make_active
    11-08 21:57:27.960  17126-18640/com.mapbox.mapboxgl.app W/Adreno-ES20﹕ < gl_draw_error_checks:575 >: GL_INVALID_OPERATION
    
  9. ljbade commented on Nov 9, 2014

    @ljbade
    ContributorAuthor

    Fixed with new pause/resume 28d66bb

    Still think about how to do it better in #578

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Androidbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions