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

Commit 39e562df authored by Bo Liu's avatar Bo Liu Committed by android-build-merger
Browse files

Merge "Expose DisplayListCanvas.drawGLFunctor to webview" into nyc-dev

am: 57b615c3

* commit '57b615c3':
  Expose DisplayListCanvas.drawGLFunctor to webview

Change-Id: I715aa5644d405a8e484ddd633e01f5f0336b99b7
parents 17804abf 57b615c3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -48880,6 +48880,7 @@ package android.webkit {
  public final class WebViewDelegate {
    method public void addWebViewAssetPath(android.content.Context);
    method public void callDrawGlFunction(android.graphics.Canvas, long);
    method public void callDrawGlFunction(android.graphics.Canvas, long, java.lang.Runnable);
    method public boolean canInvokeDrawGlFunctor(android.view.View);
    method public void detachDrawGlFunctor(android.view.View, long);
    method public android.app.Application getApplication();
+23 −1
Original line number Diff line number Diff line
@@ -107,7 +107,29 @@ public final class WebViewDelegate {
            throw new IllegalArgumentException(canvas.getClass().getName()
                    + " is not a DisplayList canvas");
        }
        ((DisplayListCanvas) canvas).callDrawGLFunction2(nativeDrawGLFunctor);
        ((DisplayListCanvas) canvas).drawGLFunctor2(nativeDrawGLFunctor, null);
    }

    /**
     * Calls the function specified with the nativeDrawGLFunctor functor pointer. This
     * functionality is used by the WebView for calling into their renderer from the
     * framework display lists.
     *
     * @param canvas a hardware accelerated canvas (see {@link Canvas#isHardwareAccelerated()})
     * @param nativeDrawGLFunctor the pointer to the native functor that implements
     *        system/core/include/utils/Functor.h
     * @param releasedRunnable Called when this nativeDrawGLFunctor is no longer referenced by this
     *        canvas, so is safe to be destroyed.
     * @throws IllegalArgumentException if the canvas is not hardware accelerated
     */
    public void callDrawGlFunction(@NonNull Canvas canvas, long nativeDrawGLFunctor,
            @Nullable Runnable releasedRunnable) {
        if (!(canvas instanceof DisplayListCanvas)) {
            // Canvas#isHardwareAccelerated() is only true for subclasses of HardwareCanvas.
            throw new IllegalArgumentException(canvas.getClass().getName()
                    + " is not a DisplayList canvas");
        }
        ((DisplayListCanvas) canvas).drawGLFunctor2(nativeDrawGLFunctor, releasedRunnable);
    }

    /**