Skip to content

Vulkan Support #2

@mikeskydev

Description

@mikeskydev

Hi, I've just found your whole suite of webview plugins and it's looking really promising.

I'm interested in what would be required for Vulkan support, as our app requires Vulkan.

From there, I'd be really interested in retrieving the android surface to use with Unity's upcoming composition layers package https://docs.unity3d.com/Packages/[email protected]/manual/source-texture-component.html#android-surface for crisp cross platform XR rendering.

From Unity's sample:

package com.unity.xr.compositorlayers;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.view.Surface;

/**
 * Provides functionality to render a Bitmap onto a Surface
 * received from Unity. Primarily used for handling and displaying
 * texture data passed from Unity to Android native code.
 */
public class TestSurface {

    /**
     * Initializes and renders a Bitmap onto a specified Surface.
     * 
     * @param surfaceObject An object that should be an instance of android.view.Surface.
     * @param bitmap The Bitmap image to be drawn on the surface.
     * @throws RuntimeException if surfaceObject is not an instance of Surface or if bitmap is null.
     */
    public static void InitTestSurface(Object surfaceObject, Bitmap bitmap) {
        if (!(surfaceObject instanceof Surface)) {
            throw new RuntimeException("TestSurface.ctor: supplied object is not an android.view.Surface!");
        }

        Surface surface = (Surface) surfaceObject;
        Canvas canvas = surface.lockCanvas(null);
        
        if(bitmap != null)
        {
            canvas.drawBitmap(bitmap, new Matrix(), new Paint());
        }
        else
        {
            throw new RuntimeException("Surface or Image is not initialized or is null.");  
        }
                  
        surface.unlockCanvasAndPost(canvas);
    }
}

I don't have much free time but I'd like to voice this out to see if I can help with anything, or attract the right people who might have the requisite knowledge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions