Loading graphics/java/android/graphics/Color.java +3 −0 Original line number Diff line number Diff line Loading @@ -289,6 +289,9 @@ import java.util.function.DoubleUnaryOperator; */ @AnyThread @SuppressAutoDoc @android.ravenwood.annotation.RavenwoodKeepWholeClass @android.ravenwood.annotation.RavenwoodClassLoadHook( android.ravenwood.annotation.RavenwoodClassLoadHook.LIBANDROID_LOADING_HOOK) public class Color { @ColorInt public static final int BLACK = 0xFF000000; @ColorInt public static final int DKGRAY = 0xFF444444; Loading graphics/java/android/graphics/ColorSpace.java +11 −5 Original line number Diff line number Diff line Loading @@ -135,6 +135,9 @@ import java.util.function.DoubleUnaryOperator; @AnyThread @SuppressWarnings("StaticInitializerReferencesSubClass") @SuppressAutoDoc @android.ravenwood.annotation.RavenwoodKeepWholeClass @android.ravenwood.annotation.RavenwoodClassLoadHook( android.ravenwood.annotation.RavenwoodClassLoadHook.LIBANDROID_LOADING_HOOK) public abstract class ColorSpace { /** * Standard CIE 1931 2° illuminant A, encoded in xyY. Loading Loading @@ -2490,9 +2493,12 @@ public abstract class ColorSpace { return mNativePtr; } private static native long nativeGetNativeFinalizer(); private static native long nativeCreate(float a, float b, float c, float d, /** Need a nested class due to b/337329128. */ static class Native { static native long nativeGetNativeFinalizer(); static native long nativeCreate(float a, float b, float c, float d, float e, float f, float g, float[] xyz); } private static DoubleUnaryOperator generateOETF(TransferParameters function) { if (function.isHLGish()) { Loading Loading @@ -2959,7 +2965,7 @@ public abstract class ColorSpace { // This mimics the old code that was in native. float[] nativeTransform = adaptToIlluminantD50(mWhitePoint, mTransform); mNativePtr = nativeCreate((float) mTransferParameters.a, mNativePtr = Native.nativeCreate((float) mTransferParameters.a, (float) mTransferParameters.b, (float) mTransferParameters.c, (float) mTransferParameters.d, Loading @@ -2975,7 +2981,7 @@ public abstract class ColorSpace { private static class NoImagePreloadHolder { public static final NativeAllocationRegistry sRegistry = new NativeAllocationRegistry( ColorSpace.Rgb.class.getClassLoader(), nativeGetNativeFinalizer(), 0); ColorSpace.Rgb.class.getClassLoader(), Native.nativeGetNativeFinalizer(), 0); } /** Loading graphics/java/android/graphics/Matrix.java +3 −45 Original line number Diff line number Diff line Loading @@ -232,7 +232,7 @@ public class Matrix { private static class NoImagePreloadHolder { public static final NativeAllocationRegistry sRegistry = NativeAllocationRegistry.createMalloced( Matrix.class.getClassLoader(), nGetNativeFinalizerWrapper()); Matrix.class.getClassLoader(), ExtraNatives.nGetNativeFinalizer()); } private final long native_instance; Loading @@ -241,7 +241,7 @@ public class Matrix { * Create an identity matrix */ public Matrix() { native_instance = nCreateWrapper(0); native_instance = ExtraNatives.nCreate(0); NoImagePreloadHolder.sRegistry.registerNativeAllocation(this, native_instance); } Loading @@ -251,7 +251,7 @@ public class Matrix { * @param src The matrix to copy into this matrix */ public Matrix(Matrix src) { native_instance = nCreateWrapper(src != null ? src.native_instance : 0); native_instance = ExtraNatives.nCreate(src != null ? src.native_instance : 0); NoImagePreloadHolder.sRegistry.registerNativeAllocation(this, native_instance); } Loading Loading @@ -849,40 +849,6 @@ public class Matrix { return native_instance; } /** * Wrapper method we use to switch to ExtraNatives.nCreate(src) only on Ravenwood. * * @see ExtraNatives */ @android.ravenwood.annotation.RavenwoodReplace private static long nCreateWrapper(long src) { return nCreate(src); } private static long nCreateWrapper$ravenwood(long src) { return ExtraNatives.nCreate(src); } /** * Wrapper method we use to switch to ExtraNatives.nGetNativeFinalizer(src) only on Ravenwood. * * @see ExtraNatives */ @android.ravenwood.annotation.RavenwoodReplace private static long nGetNativeFinalizerWrapper() { return nGetNativeFinalizer(); } private static long nGetNativeFinalizerWrapper$ravenwood() { return ExtraNatives.nGetNativeFinalizer(); } // ------------------ Regular JNI ------------------------ private static native long nCreate(long nSrc_or_zero); private static native long nGetNativeFinalizer(); // ------------------ Fast JNI ------------------------ @FastNative Loading Loading @@ -982,14 +948,6 @@ public class Matrix { * There are two methods that are called by the static initializers (either directly or * indirectly) in this class, namely nCreate() and nGetNativeFinalizer(). On Ravenwood * these methods can't be on the Matrix class itself, so we use a nested class to host them. * * We still keep the original nCreate() method and call it on non-ravenwood environment, * in order to avoid problems in downstream (such as Android Studio). * * @see #nCreateWrapper(long) * @see #nGetNativeFinalizerWrapper() * * TODO(b/337110712) Clean it up somehow. (remove the original nCreate() and unify the code?) */ private static class ExtraNatives { static native long nCreate(long nSrc_or_zero); Loading libs/hwui/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -336,6 +336,7 @@ cc_defaults { "jni/android_graphics_animation_NativeInterpolatorFactory.cpp", "jni/android_graphics_animation_RenderNodeAnimator.cpp", "jni/android_graphics_Canvas.cpp", "jni/android_graphics_Color.cpp", "jni/android_graphics_ColorSpace.cpp", "jni/android_graphics_drawable_AnimatedVectorDrawable.cpp", "jni/android_graphics_drawable_VectorDrawable.cpp", Loading libs/hwui/apex/LayoutlibLoader.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ namespace android { extern int register_android_graphics_Canvas(JNIEnv* env); extern int register_android_graphics_CanvasProperty(JNIEnv* env); extern int register_android_graphics_Color(JNIEnv* env); extern int register_android_graphics_ColorFilter(JNIEnv* env); extern int register_android_graphics_ColorSpace(JNIEnv* env); extern int register_android_graphics_DrawFilter(JNIEnv* env); Loading Loading @@ -87,6 +88,7 @@ static const std::unordered_map<std::string, RegJNIRec> gRegJNIMap = { {"android.graphics.Camera", REG_JNI(register_android_graphics_Camera)}, {"android.graphics.Canvas", REG_JNI(register_android_graphics_Canvas)}, {"android.graphics.CanvasProperty", REG_JNI(register_android_graphics_CanvasProperty)}, {"android.graphics.Color", REG_JNI(register_android_graphics_Color)}, {"android.graphics.ColorFilter", REG_JNI(register_android_graphics_ColorFilter)}, {"android.graphics.ColorSpace", REG_JNI(register_android_graphics_ColorSpace)}, {"android.graphics.CreateJavaOutputStreamAdaptor", Loading Loading
graphics/java/android/graphics/Color.java +3 −0 Original line number Diff line number Diff line Loading @@ -289,6 +289,9 @@ import java.util.function.DoubleUnaryOperator; */ @AnyThread @SuppressAutoDoc @android.ravenwood.annotation.RavenwoodKeepWholeClass @android.ravenwood.annotation.RavenwoodClassLoadHook( android.ravenwood.annotation.RavenwoodClassLoadHook.LIBANDROID_LOADING_HOOK) public class Color { @ColorInt public static final int BLACK = 0xFF000000; @ColorInt public static final int DKGRAY = 0xFF444444; Loading
graphics/java/android/graphics/ColorSpace.java +11 −5 Original line number Diff line number Diff line Loading @@ -135,6 +135,9 @@ import java.util.function.DoubleUnaryOperator; @AnyThread @SuppressWarnings("StaticInitializerReferencesSubClass") @SuppressAutoDoc @android.ravenwood.annotation.RavenwoodKeepWholeClass @android.ravenwood.annotation.RavenwoodClassLoadHook( android.ravenwood.annotation.RavenwoodClassLoadHook.LIBANDROID_LOADING_HOOK) public abstract class ColorSpace { /** * Standard CIE 1931 2° illuminant A, encoded in xyY. Loading Loading @@ -2490,9 +2493,12 @@ public abstract class ColorSpace { return mNativePtr; } private static native long nativeGetNativeFinalizer(); private static native long nativeCreate(float a, float b, float c, float d, /** Need a nested class due to b/337329128. */ static class Native { static native long nativeGetNativeFinalizer(); static native long nativeCreate(float a, float b, float c, float d, float e, float f, float g, float[] xyz); } private static DoubleUnaryOperator generateOETF(TransferParameters function) { if (function.isHLGish()) { Loading Loading @@ -2959,7 +2965,7 @@ public abstract class ColorSpace { // This mimics the old code that was in native. float[] nativeTransform = adaptToIlluminantD50(mWhitePoint, mTransform); mNativePtr = nativeCreate((float) mTransferParameters.a, mNativePtr = Native.nativeCreate((float) mTransferParameters.a, (float) mTransferParameters.b, (float) mTransferParameters.c, (float) mTransferParameters.d, Loading @@ -2975,7 +2981,7 @@ public abstract class ColorSpace { private static class NoImagePreloadHolder { public static final NativeAllocationRegistry sRegistry = new NativeAllocationRegistry( ColorSpace.Rgb.class.getClassLoader(), nativeGetNativeFinalizer(), 0); ColorSpace.Rgb.class.getClassLoader(), Native.nativeGetNativeFinalizer(), 0); } /** Loading
graphics/java/android/graphics/Matrix.java +3 −45 Original line number Diff line number Diff line Loading @@ -232,7 +232,7 @@ public class Matrix { private static class NoImagePreloadHolder { public static final NativeAllocationRegistry sRegistry = NativeAllocationRegistry.createMalloced( Matrix.class.getClassLoader(), nGetNativeFinalizerWrapper()); Matrix.class.getClassLoader(), ExtraNatives.nGetNativeFinalizer()); } private final long native_instance; Loading @@ -241,7 +241,7 @@ public class Matrix { * Create an identity matrix */ public Matrix() { native_instance = nCreateWrapper(0); native_instance = ExtraNatives.nCreate(0); NoImagePreloadHolder.sRegistry.registerNativeAllocation(this, native_instance); } Loading @@ -251,7 +251,7 @@ public class Matrix { * @param src The matrix to copy into this matrix */ public Matrix(Matrix src) { native_instance = nCreateWrapper(src != null ? src.native_instance : 0); native_instance = ExtraNatives.nCreate(src != null ? src.native_instance : 0); NoImagePreloadHolder.sRegistry.registerNativeAllocation(this, native_instance); } Loading Loading @@ -849,40 +849,6 @@ public class Matrix { return native_instance; } /** * Wrapper method we use to switch to ExtraNatives.nCreate(src) only on Ravenwood. * * @see ExtraNatives */ @android.ravenwood.annotation.RavenwoodReplace private static long nCreateWrapper(long src) { return nCreate(src); } private static long nCreateWrapper$ravenwood(long src) { return ExtraNatives.nCreate(src); } /** * Wrapper method we use to switch to ExtraNatives.nGetNativeFinalizer(src) only on Ravenwood. * * @see ExtraNatives */ @android.ravenwood.annotation.RavenwoodReplace private static long nGetNativeFinalizerWrapper() { return nGetNativeFinalizer(); } private static long nGetNativeFinalizerWrapper$ravenwood() { return ExtraNatives.nGetNativeFinalizer(); } // ------------------ Regular JNI ------------------------ private static native long nCreate(long nSrc_or_zero); private static native long nGetNativeFinalizer(); // ------------------ Fast JNI ------------------------ @FastNative Loading Loading @@ -982,14 +948,6 @@ public class Matrix { * There are two methods that are called by the static initializers (either directly or * indirectly) in this class, namely nCreate() and nGetNativeFinalizer(). On Ravenwood * these methods can't be on the Matrix class itself, so we use a nested class to host them. * * We still keep the original nCreate() method and call it on non-ravenwood environment, * in order to avoid problems in downstream (such as Android Studio). * * @see #nCreateWrapper(long) * @see #nGetNativeFinalizerWrapper() * * TODO(b/337110712) Clean it up somehow. (remove the original nCreate() and unify the code?) */ private static class ExtraNatives { static native long nCreate(long nSrc_or_zero); Loading
libs/hwui/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -336,6 +336,7 @@ cc_defaults { "jni/android_graphics_animation_NativeInterpolatorFactory.cpp", "jni/android_graphics_animation_RenderNodeAnimator.cpp", "jni/android_graphics_Canvas.cpp", "jni/android_graphics_Color.cpp", "jni/android_graphics_ColorSpace.cpp", "jni/android_graphics_drawable_AnimatedVectorDrawable.cpp", "jni/android_graphics_drawable_VectorDrawable.cpp", Loading
libs/hwui/apex/LayoutlibLoader.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ namespace android { extern int register_android_graphics_Canvas(JNIEnv* env); extern int register_android_graphics_CanvasProperty(JNIEnv* env); extern int register_android_graphics_Color(JNIEnv* env); extern int register_android_graphics_ColorFilter(JNIEnv* env); extern int register_android_graphics_ColorSpace(JNIEnv* env); extern int register_android_graphics_DrawFilter(JNIEnv* env); Loading Loading @@ -87,6 +88,7 @@ static const std::unordered_map<std::string, RegJNIRec> gRegJNIMap = { {"android.graphics.Camera", REG_JNI(register_android_graphics_Camera)}, {"android.graphics.Canvas", REG_JNI(register_android_graphics_Canvas)}, {"android.graphics.CanvasProperty", REG_JNI(register_android_graphics_CanvasProperty)}, {"android.graphics.Color", REG_JNI(register_android_graphics_Color)}, {"android.graphics.ColorFilter", REG_JNI(register_android_graphics_ColorFilter)}, {"android.graphics.ColorSpace", REG_JNI(register_android_graphics_ColorSpace)}, {"android.graphics.CreateJavaOutputStreamAdaptor", Loading