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

Transparent background #10719

Closed
tobrun opened this issue Dec 16, 2017 · 6 comments
Closed

Transparent background #10719

tobrun opened this issue Dec 16, 2017 · 6 comments
Labels
Android Mapbox Maps SDK for Android feature

Comments

@tobrun
Copy link
Member

tobrun commented Dec 16, 2017

Feature request to allow setting the background of the render surface to transparent:

screen shot 2017-12-12 at 16 08 08

Working branch here.

This feature allows to see through the map bounds and see items in the viewhierachy that are behind it (currently this shows a black background). Besides the feature request this also solves the issue of a flashing black background when starting up a mapview.

There are a couple of ways that we could expose this an api:

  • expose the variables set with eglconfig chooser
  • more limited api with a togle for enabling the transparent background

Before implementing we need to identify what the performance impact will be and if this feature introduces any regressions on older OS verions.

cc @zugaldia @ericdeveloper @kalimar

@tobrun tobrun added Android Mapbox Maps SDK for Android feature labels Dec 16, 2017
@tobrun tobrun added this to the android-v6.0.0 milestone Dec 16, 2017
@tobrun
Copy link
Member Author

tobrun commented Dec 18, 2017

Was able to get something working with GLSurfaceView:
screen shot 2017-12-18 at 15 55 57

While it works, it also doesn't show our logo and attribution icon anymore.
Going to see if I can make this work with TextureView.

@zugaldia
Copy link
Member

more limited api with a togle for enabling the transparent background

I like this approach, preferably being opt-in. This enables the usecase while minimizing potential side effects (rendering, or performance).

@tobrun
Copy link
Member Author

tobrun commented Jan 26, 2018

To follow up on this, approach mentioned in #10719 (comment) will not be feasible due to needing to move the surface before all the views in the hierarchy, as a result the logo/attribution/compass isn't showing anymore and this would go in against our terms and conditions.

I'm looking now into if a TextureView approach is feasible (as this render component wouldn't require the same changes as GlSurfaceView). TBC.

@tobrun
Copy link
Member Author

tobrun commented Jan 26, 2018

Got a POC working with TextureView:

Before

screen shot 2018-01-26 at 13 44 25

After

screen shot 2018-01-26 at 13 41 46

TODO

  • determine performance impact
  • boil current configuration down to minimal changes
  • expose as a configurable
  • run tests on AWS device farm to verify if devices are unsupported

@tobrun
Copy link
Member Author

tobrun commented Jan 26, 2018

Render performance comparison:

Before

ezgif com-video-to-gif 35

After

ezgif com-video-to-gif 36

There is no concrete indication that a translucent surface is adding performance overhead.

@tobrun
Copy link
Member Author

tobrun commented Feb 13, 2018

This landed with #11065

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android feature
Projects
None yet
Development

No branches or pull requests

2 participants