Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fa32db15 authored by Derek Sollenberger's avatar Derek Sollenberger
Browse files

setting the pixel format for a given surface

parent 36093d4e
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1999,10 +1999,11 @@ final class WebViewCore {
        private int mPointer;
        private final boolean mIsFixedSize;
        SurfaceViewProxy(Context context, ViewManager.ChildView childView,
                int pointer, boolean isFixedSize) {
                int pointer, int pixelFormat, boolean isFixedSize) {
            super(context);
            setWillNotDraw(false); // this prevents the black box artifact
            getHolder().addCallback(this);
            getHolder().setFormat(pixelFormat);
            mChildView = childView;
            mChildView.mView = this;
            mPointer = pointer;
@@ -2041,12 +2042,13 @@ final class WebViewCore {

    // PluginWidget functions for mainting SurfaceViews for the Surface drawing
    // model.
    private SurfaceView createSurface(int nativePointer, boolean isFixedSize) {
    private SurfaceView createSurface(int nativePointer, int pixelFormat,
                                      boolean isFixedSize) {
        if (mWebView == null) {
            return null;
        }
        return new SurfaceViewProxy(mContext,
                mWebView.mViewManager.createView(), nativePointer, isFixedSize);
        return new SurfaceViewProxy(mContext, mWebView.mViewManager.createView(),
                                    nativePointer, pixelFormat, isFixedSize);
    }

    private void destroySurface(SurfaceView surface) {