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.

Fix screenshot/snapshot api for SurfaceView #5587

Closed

Description

@tobrun

SurfaceView implementation was merged with 99a4850, this resulted in a not supporting a correctly working snapshot api. We need to look into fixing this to work with a SurfaceView implementation. Original ticket of Snapshot functionality: #3466.

Activity

  1. added
    Android
    on Jul 6, 2016
  2. added this to the android-v4.2.0 milestone on Jul 7, 2016
  3. tobrun commented on Jul 27, 2016

    @tobrun
    MemberAuthor

    I'm currently looking into the code from Grafika. This is repo from Google where you can find a lot different code snippets related to graphics on Android.

  4. tobrun commented on Jul 27, 2016

    @tobrun
    MemberAuthor

    The most promising snippet I could found was saveFrame in EglSurfaceBase. I'm looking into if that is useable for our use-case.

    update: I think this would only work if we construct the Surface in java and use that reference as a base. Since we are managing this in native_map_view.cpp. I'm going to look into some NDK support on this.

  5. tobrun commented on Jul 27, 2016

    @tobrun
    MemberAuthor

    This blog gives some insights into achieving off screen rendering into a bitmap through JNI.

  6. tobrun commented on Jul 27, 2016

    @tobrun
    MemberAuthor

    I'm currently looking into a glReadPixels approach. This seems promising but wasn't able yet to pass back the bytes buffer through JNI to Java.

    update: I got some code working that returns from JNI. Currently running into a java.lang.RuntimeException: Buffer not large enough for pixels exception. Some SO indicate to perform the wrap on the bytearray but that doesn't seem to resolve it.

  7. added 3 commits that reference this issue on Jul 28, 2016
  8. tobrun commented on Jul 29, 2016

    @tobrun
    MemberAuthor

    Been getting some tips on how glReadPixels is used in this projec. Nodejs is using it through headless_view.ccp but more interesting is that macos is using it their print feature here. You can see there that the printing is executed as part of the render call, this ensures that the state is activated. Now looking into bringing that in.

  9. zugaldia commented on Aug 15, 2016

    @zugaldia
    Member

    Fixed via #5826.

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions