Loading graphics/java/android/graphics/BaseCanvas.java +15 −1 Original line number Diff line number Diff line Loading @@ -96,7 +96,7 @@ public abstract class BaseCanvas { // These are also implemented in RecordingCanvas so that we can // selectively apply on them // Everything below here is copy/pasted from Canvas.java // The JNI registration is handled by android_view_Canvas.cpp // The JNI registration is handled by android_graphics_Canvas.cpp // --------------------------------------------------------------------------- public void drawArc(float left, float top, float right, float bottom, float startAngle, Loading Loading @@ -667,6 +667,17 @@ public abstract class BaseCanvas { indices, indexOffset, indexCount, paint.getNativeInstance()); } /** * @hide */ public void drawMesh(Mesh mesh, BlendMode blendMode, Paint paint) { if (!isHardwareAccelerated() && onHwFeatureInSwMode()) { throw new RuntimeException("software rendering doesn't support meshes"); } nDrawMesh(this.mNativeCanvasWrapper, mesh.getNativeWrapperInstance(), blendMode.getXfermode().porterDuffMode, paint.getNativeInstance()); } /** * @hide */ Loading Loading @@ -801,6 +812,9 @@ public abstract class BaseCanvas { int vertOffset, float[] texs, int texOffset, int[] colors, int colorOffset, short[] indices, int indexOffset, int indexCount, long nativePaint); private static native void nDrawMesh( long nativeCanvas, long nativeMesh, int mode, long nativePaint); private static native void nDrawGlyphs(long nativeCanvas, int[] glyphIds, float[] positions, int glyphIdStart, int positionStart, int glyphCount, long nativeFont, long nativePaint); Loading graphics/java/android/graphics/BaseRecordingCanvas.java +10 −0 Original line number Diff line number Diff line Loading @@ -606,6 +606,12 @@ public class BaseRecordingCanvas extends Canvas { indices, indexOffset, indexCount, paint.getNativeInstance()); } @Override public final void drawMesh(Mesh mesh, BlendMode blendMode, Paint paint) { nDrawMesh(mNativeCanvasWrapper, mesh.getNativeWrapperInstance(), blendMode.getXfermode().porterDuffMode, paint.getNativeInstance()); } /** * @hide */ Loading Loading @@ -707,6 +713,10 @@ public class BaseRecordingCanvas extends Canvas { int meshHeight, float[] verts, int vertOffset, int[] colors, int colorOffset, long nativePaint); @FastNative private static native void nDrawMesh( long canvasHandle, long nativeMesh, int mode, long nativePaint); @FastNative private static native void nDrawVertices(long nativeCanvas, int mode, int n, float[] verts, int vertOffset, float[] texs, int texOffset, int[] colors, int colorOffset, Loading graphics/java/android/graphics/Mesh.java +9 −5 Original line number Diff line number Diff line Loading @@ -196,7 +196,6 @@ public class Mesh { } nativeUpdateUniforms( mNativeMeshWrapper, uniformName, value1, value2, value3, value4, count); nativeUpdateMesh(mNativeMeshWrapper); } private void setUniform(String uniformName, float[] values, boolean isColor) { Loading @@ -208,7 +207,6 @@ public class Mesh { } nativeUpdateUniforms(mNativeMeshWrapper, uniformName, values, isColor); nativeUpdateMesh(mNativeMeshWrapper); } /** Loading Loading @@ -271,7 +269,14 @@ public class Mesh { throw new NullPointerException("The uniform values parameter must not be null"); } nativeUpdateUniforms(mNativeMeshWrapper, uniformName, values); nativeUpdateMesh(mNativeMeshWrapper); } /** * @hide so only calls from module can utilize it */ long getNativeWrapperInstance() { nativeUpdateMesh(mNativeMeshWrapper, mIsIndexed); return mNativeMeshWrapper; } private void setIntUniform( Loading @@ -282,7 +287,6 @@ public class Mesh { nativeUpdateUniforms( mNativeMeshWrapper, uniformName, value1, value2, value3, value4, count); nativeUpdateMesh(mNativeMeshWrapper); } private Mesh(long nativeMeshWrapper, boolean isIndexed) { Loading Loading @@ -313,5 +317,5 @@ public class Mesh { private static native void nativeUpdateUniforms(long builder, String uniformName, int[] values); private static native void nativeUpdateMesh(long nativeMeshWrapper); private static native void nativeUpdateMesh(long nativeMeshWrapper, boolean mIsIndexed); } libs/hwui/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -340,6 +340,8 @@ cc_defaults { "jni/Graphics.cpp", "jni/ImageDecoder.cpp", "jni/Interpolator.cpp", "jni/MeshSpecification.cpp", "jni/Mesh.cpp", "jni/MaskFilter.cpp", "jni/NinePatch.cpp", "jni/NinePatchPeeker.cpp", Loading libs/hwui/DisplayListOps.in +1 −0 Original line number Diff line number Diff line Loading @@ -52,3 +52,4 @@ X(DrawShadowRec) X(DrawVectorDrawable) X(DrawRippleDrawable) X(DrawWebView) X(DrawMesh) Loading
graphics/java/android/graphics/BaseCanvas.java +15 −1 Original line number Diff line number Diff line Loading @@ -96,7 +96,7 @@ public abstract class BaseCanvas { // These are also implemented in RecordingCanvas so that we can // selectively apply on them // Everything below here is copy/pasted from Canvas.java // The JNI registration is handled by android_view_Canvas.cpp // The JNI registration is handled by android_graphics_Canvas.cpp // --------------------------------------------------------------------------- public void drawArc(float left, float top, float right, float bottom, float startAngle, Loading Loading @@ -667,6 +667,17 @@ public abstract class BaseCanvas { indices, indexOffset, indexCount, paint.getNativeInstance()); } /** * @hide */ public void drawMesh(Mesh mesh, BlendMode blendMode, Paint paint) { if (!isHardwareAccelerated() && onHwFeatureInSwMode()) { throw new RuntimeException("software rendering doesn't support meshes"); } nDrawMesh(this.mNativeCanvasWrapper, mesh.getNativeWrapperInstance(), blendMode.getXfermode().porterDuffMode, paint.getNativeInstance()); } /** * @hide */ Loading Loading @@ -801,6 +812,9 @@ public abstract class BaseCanvas { int vertOffset, float[] texs, int texOffset, int[] colors, int colorOffset, short[] indices, int indexOffset, int indexCount, long nativePaint); private static native void nDrawMesh( long nativeCanvas, long nativeMesh, int mode, long nativePaint); private static native void nDrawGlyphs(long nativeCanvas, int[] glyphIds, float[] positions, int glyphIdStart, int positionStart, int glyphCount, long nativeFont, long nativePaint); Loading
graphics/java/android/graphics/BaseRecordingCanvas.java +10 −0 Original line number Diff line number Diff line Loading @@ -606,6 +606,12 @@ public class BaseRecordingCanvas extends Canvas { indices, indexOffset, indexCount, paint.getNativeInstance()); } @Override public final void drawMesh(Mesh mesh, BlendMode blendMode, Paint paint) { nDrawMesh(mNativeCanvasWrapper, mesh.getNativeWrapperInstance(), blendMode.getXfermode().porterDuffMode, paint.getNativeInstance()); } /** * @hide */ Loading Loading @@ -707,6 +713,10 @@ public class BaseRecordingCanvas extends Canvas { int meshHeight, float[] verts, int vertOffset, int[] colors, int colorOffset, long nativePaint); @FastNative private static native void nDrawMesh( long canvasHandle, long nativeMesh, int mode, long nativePaint); @FastNative private static native void nDrawVertices(long nativeCanvas, int mode, int n, float[] verts, int vertOffset, float[] texs, int texOffset, int[] colors, int colorOffset, Loading
graphics/java/android/graphics/Mesh.java +9 −5 Original line number Diff line number Diff line Loading @@ -196,7 +196,6 @@ public class Mesh { } nativeUpdateUniforms( mNativeMeshWrapper, uniformName, value1, value2, value3, value4, count); nativeUpdateMesh(mNativeMeshWrapper); } private void setUniform(String uniformName, float[] values, boolean isColor) { Loading @@ -208,7 +207,6 @@ public class Mesh { } nativeUpdateUniforms(mNativeMeshWrapper, uniformName, values, isColor); nativeUpdateMesh(mNativeMeshWrapper); } /** Loading Loading @@ -271,7 +269,14 @@ public class Mesh { throw new NullPointerException("The uniform values parameter must not be null"); } nativeUpdateUniforms(mNativeMeshWrapper, uniformName, values); nativeUpdateMesh(mNativeMeshWrapper); } /** * @hide so only calls from module can utilize it */ long getNativeWrapperInstance() { nativeUpdateMesh(mNativeMeshWrapper, mIsIndexed); return mNativeMeshWrapper; } private void setIntUniform( Loading @@ -282,7 +287,6 @@ public class Mesh { nativeUpdateUniforms( mNativeMeshWrapper, uniformName, value1, value2, value3, value4, count); nativeUpdateMesh(mNativeMeshWrapper); } private Mesh(long nativeMeshWrapper, boolean isIndexed) { Loading Loading @@ -313,5 +317,5 @@ public class Mesh { private static native void nativeUpdateUniforms(long builder, String uniformName, int[] values); private static native void nativeUpdateMesh(long nativeMeshWrapper); private static native void nativeUpdateMesh(long nativeMeshWrapper, boolean mIsIndexed); }
libs/hwui/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -340,6 +340,8 @@ cc_defaults { "jni/Graphics.cpp", "jni/ImageDecoder.cpp", "jni/Interpolator.cpp", "jni/MeshSpecification.cpp", "jni/Mesh.cpp", "jni/MaskFilter.cpp", "jni/NinePatch.cpp", "jni/NinePatchPeeker.cpp", Loading
libs/hwui/DisplayListOps.in +1 −0 Original line number Diff line number Diff line Loading @@ -52,3 +52,4 @@ X(DrawShadowRec) X(DrawVectorDrawable) X(DrawRippleDrawable) X(DrawWebView) X(DrawMesh)