Loading core/java/android/view/inspector/PropertyReader.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -133,10 +133,11 @@ public interface PropertyReader { void readColor(int id, @ColorInt int value); void readColor(int id, @ColorInt int value); /** /** * Read a color packed into a {@link ColorLong} as a property. * Read a color packed into a {@code ColorLong} as a property. * * * @param id Identifier of the property from a {@link PropertyMapper} * @param id Identifier of the property from a {@link PropertyMapper} * @param value Value of the property * @param value Value of the property packed as a {@code ColorLong}. See the * {@link Color} class for details of the packing. * @throws PropertyTypeMismatchException If the property ID is not mapped as a color * @throws PropertyTypeMismatchException If the property ID is not mapped as a color */ */ void readColor(int id, @ColorLong long value); void readColor(int id, @ColorLong long value); Loading graphics/java/android/graphics/Bitmap.java +7 −6 Original line number Original line Diff line number Diff line Loading @@ -1813,21 +1813,22 @@ public final class Bitmap implements Parcelable { } } /** /** * Fills the bitmap's pixels with the specified {@link Color}. * Fills the bitmap's pixels with the specified {@code ColorLong}. * * * @param color The color to fill as packed by the {@link Color} class. * @throws IllegalStateException if the bitmap is not mutable. * @throws IllegalStateException if the bitmap is not mutable. * @throws IllegalArgumentException if the color space encoded in the long * @throws IllegalArgumentException if the color space encoded in the * is invalid or unknown. * {@code ColorLong} is invalid or unknown. * * */ */ public void eraseColor(@ColorLong long c) { public void eraseColor(@ColorLong long color) { checkRecycled("Can't erase a recycled bitmap"); checkRecycled("Can't erase a recycled bitmap"); if (!isMutable()) { if (!isMutable()) { throw new IllegalStateException("cannot erase immutable bitmaps"); throw new IllegalStateException("cannot erase immutable bitmaps"); } } ColorSpace cs = Color.colorSpace(c); ColorSpace cs = Color.colorSpace(color); nativeErase(mNativePtr, cs.getNativeInstance(), c); nativeErase(mNativePtr, cs.getNativeInstance(), color); } } /** /** Loading graphics/java/android/graphics/Canvas.java +8 −6 Original line number Original line Diff line number Diff line Loading @@ -1683,8 +1683,9 @@ public class Canvas extends BaseCanvas { * Fill the entire canvas' bitmap (restricted to the current clip) with the specified color, * Fill the entire canvas' bitmap (restricted to the current clip) with the specified color, * using srcover porterduff mode. * using srcover porterduff mode. * * * @param color the color to draw onto the canvas * @param color the {@code ColorLong} to draw onto the canvas. See the {@link Color} * @throws IllegalArgumentException if the color space encoded in the long * class for details about {@code ColorLong}s. * @throws IllegalArgumentException if the color space encoded in the {@code ColorLong} * is invalid or unknown. * is invalid or unknown. */ */ public void drawColor(@ColorLong long color) { public void drawColor(@ColorLong long color) { Loading @@ -1695,7 +1696,7 @@ public class Canvas extends BaseCanvas { * Fill the entire canvas' bitmap (restricted to the current clip) with the specified color and * Fill the entire canvas' bitmap (restricted to the current clip) with the specified color and * porter-duff xfermode. * porter-duff xfermode. * * * @param color the color to draw with * @param color the color to draw onto the canvas * @param mode the porter-duff mode to apply to the color * @param mode the porter-duff mode to apply to the color * * * @deprecated use {@link #drawColor(int, BlendMode)} instead * @deprecated use {@link #drawColor(int, BlendMode)} instead Loading @@ -1709,7 +1710,7 @@ public class Canvas extends BaseCanvas { * Fill the entire canvas' bitmap (restricted to the current clip) with the specified color and * Fill the entire canvas' bitmap (restricted to the current clip) with the specified color and * blendmode. * blendmode. * * * @param color the color to draw with * @param color the color to draw onto the canvas * @param mode the blendmode to apply to the color * @param mode the blendmode to apply to the color */ */ public void drawColor(@ColorInt int color, @NonNull BlendMode mode) { public void drawColor(@ColorInt int color, @NonNull BlendMode mode) { Loading @@ -1720,9 +1721,10 @@ public class Canvas extends BaseCanvas { * Fill the entire canvas' bitmap (restricted to the current clip) with the specified color and * Fill the entire canvas' bitmap (restricted to the current clip) with the specified color and * blendmode. * blendmode. * * * @param color the color to draw with * @param color the {@code ColorLong} to draw onto the canvas. See the {@link Color} * class for details about {@code ColorLong}s. * @param mode the blendmode to apply to the color * @param mode the blendmode to apply to the color * @throws IllegalArgumentException if the color space encoded in the long * @throws IllegalArgumentException if the color space encoded in the {@code ColorLong} * is invalid or unknown. * is invalid or unknown. */ */ public void drawColor(@ColorLong long color, @NonNull BlendMode mode) { public void drawColor(@ColorLong long color, @NonNull BlendMode mode) { Loading graphics/java/android/graphics/Paint.java +10 −8 Original line number Original line Diff line number Diff line Loading @@ -1029,9 +1029,8 @@ public class Paint { * premultiplied, meaning that alpha can be any value, regardless of the * premultiplied, meaning that alpha can be any value, regardless of the * values of r,g,b. See the {@link Color} class for more details. * values of r,g,b. See the {@link Color} class for more details. * * * @see Color for APIs that help manipulate a color long. * @return the paint's color, alpha, and {@code ColorSpace} encoded as a * * {@code ColorLong} * @return the paint's color (and alpha). */ */ @ColorLong @ColorLong public long getColorLong() { public long getColorLong() { Loading @@ -1052,7 +1051,7 @@ public class Paint { } } /** /** * Set the paint's color with a {@link ColorLong}. Note that the color is * Set the paint's color with a {@code ColorLong}. Note that the color is * a long with an encoded {@link ColorSpace} as well as alpha and r,g,b. * a long with an encoded {@link ColorSpace} as well as alpha and r,g,b. * These values are not premultiplied, meaning that alpha can be any value, * These values are not premultiplied, meaning that alpha can be any value, * regardless of the values of r,g,b. See the {@link Color} class for more * regardless of the values of r,g,b. See the {@link Color} class for more Loading @@ -1060,8 +1059,8 @@ public class Paint { * * * @param color The new color (including alpha and {@link ColorSpace}) * @param color The new color (including alpha and {@link ColorSpace}) * to set in the paint. * to set in the paint. * @throws IllegalArgumentException if the color space encoded in the long * @throws IllegalArgumentException if the color space encoded in the * is invalid or unknown. * {@code ColorLong} is invalid or unknown. */ */ public void setColor(@ColorLong long color) { public void setColor(@ColorLong long color) { ColorSpace cs = Color.colorSpace(color); ColorSpace cs = Color.colorSpace(color); Loading Loading @@ -1491,8 +1490,8 @@ public class Paint { * The alpha of the shadow will be the paint's alpha if the shadow color is * The alpha of the shadow will be the paint's alpha if the shadow color is * opaque, or the alpha from the shadow color if not. * opaque, or the alpha from the shadow color if not. * * * @throws IllegalArgumentException if the color space encoded in the long * @throws IllegalArgumentException if the color space encoded in the * is invalid or unknown. * {@code ColorLong} is invalid or unknown. */ */ public void setShadowLayer(float radius, float dx, float dy, @ColorLong long shadowColor) { public void setShadowLayer(float radius, float dx, float dy, @ColorLong long shadowColor) { ColorSpace cs = Color.colorSpace(shadowColor); ColorSpace cs = Color.colorSpace(shadowColor); Loading Loading @@ -1559,8 +1558,11 @@ public class Paint { /** /** * Returns the color of the shadow layer. * Returns the color of the shadow layer. * * @return the shadow layer's color encoded as a {@link ColorLong}. * @see #setShadowLayer(float,float,float,int) * @see #setShadowLayer(float,float,float,int) * @see #setShadowLayer(float,float,float,long) * @see #setShadowLayer(float,float,float,long) * @see Color */ */ public @ColorLong long getShadowLayerColorLong() { public @ColorLong long getShadowLayerColorLong() { return mShadowLayerColor; return mShadowLayerColor; Loading Loading
core/java/android/view/inspector/PropertyReader.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -133,10 +133,11 @@ public interface PropertyReader { void readColor(int id, @ColorInt int value); void readColor(int id, @ColorInt int value); /** /** * Read a color packed into a {@link ColorLong} as a property. * Read a color packed into a {@code ColorLong} as a property. * * * @param id Identifier of the property from a {@link PropertyMapper} * @param id Identifier of the property from a {@link PropertyMapper} * @param value Value of the property * @param value Value of the property packed as a {@code ColorLong}. See the * {@link Color} class for details of the packing. * @throws PropertyTypeMismatchException If the property ID is not mapped as a color * @throws PropertyTypeMismatchException If the property ID is not mapped as a color */ */ void readColor(int id, @ColorLong long value); void readColor(int id, @ColorLong long value); Loading
graphics/java/android/graphics/Bitmap.java +7 −6 Original line number Original line Diff line number Diff line Loading @@ -1813,21 +1813,22 @@ public final class Bitmap implements Parcelable { } } /** /** * Fills the bitmap's pixels with the specified {@link Color}. * Fills the bitmap's pixels with the specified {@code ColorLong}. * * * @param color The color to fill as packed by the {@link Color} class. * @throws IllegalStateException if the bitmap is not mutable. * @throws IllegalStateException if the bitmap is not mutable. * @throws IllegalArgumentException if the color space encoded in the long * @throws IllegalArgumentException if the color space encoded in the * is invalid or unknown. * {@code ColorLong} is invalid or unknown. * * */ */ public void eraseColor(@ColorLong long c) { public void eraseColor(@ColorLong long color) { checkRecycled("Can't erase a recycled bitmap"); checkRecycled("Can't erase a recycled bitmap"); if (!isMutable()) { if (!isMutable()) { throw new IllegalStateException("cannot erase immutable bitmaps"); throw new IllegalStateException("cannot erase immutable bitmaps"); } } ColorSpace cs = Color.colorSpace(c); ColorSpace cs = Color.colorSpace(color); nativeErase(mNativePtr, cs.getNativeInstance(), c); nativeErase(mNativePtr, cs.getNativeInstance(), color); } } /** /** Loading
graphics/java/android/graphics/Canvas.java +8 −6 Original line number Original line Diff line number Diff line Loading @@ -1683,8 +1683,9 @@ public class Canvas extends BaseCanvas { * Fill the entire canvas' bitmap (restricted to the current clip) with the specified color, * Fill the entire canvas' bitmap (restricted to the current clip) with the specified color, * using srcover porterduff mode. * using srcover porterduff mode. * * * @param color the color to draw onto the canvas * @param color the {@code ColorLong} to draw onto the canvas. See the {@link Color} * @throws IllegalArgumentException if the color space encoded in the long * class for details about {@code ColorLong}s. * @throws IllegalArgumentException if the color space encoded in the {@code ColorLong} * is invalid or unknown. * is invalid or unknown. */ */ public void drawColor(@ColorLong long color) { public void drawColor(@ColorLong long color) { Loading @@ -1695,7 +1696,7 @@ public class Canvas extends BaseCanvas { * Fill the entire canvas' bitmap (restricted to the current clip) with the specified color and * Fill the entire canvas' bitmap (restricted to the current clip) with the specified color and * porter-duff xfermode. * porter-duff xfermode. * * * @param color the color to draw with * @param color the color to draw onto the canvas * @param mode the porter-duff mode to apply to the color * @param mode the porter-duff mode to apply to the color * * * @deprecated use {@link #drawColor(int, BlendMode)} instead * @deprecated use {@link #drawColor(int, BlendMode)} instead Loading @@ -1709,7 +1710,7 @@ public class Canvas extends BaseCanvas { * Fill the entire canvas' bitmap (restricted to the current clip) with the specified color and * Fill the entire canvas' bitmap (restricted to the current clip) with the specified color and * blendmode. * blendmode. * * * @param color the color to draw with * @param color the color to draw onto the canvas * @param mode the blendmode to apply to the color * @param mode the blendmode to apply to the color */ */ public void drawColor(@ColorInt int color, @NonNull BlendMode mode) { public void drawColor(@ColorInt int color, @NonNull BlendMode mode) { Loading @@ -1720,9 +1721,10 @@ public class Canvas extends BaseCanvas { * Fill the entire canvas' bitmap (restricted to the current clip) with the specified color and * Fill the entire canvas' bitmap (restricted to the current clip) with the specified color and * blendmode. * blendmode. * * * @param color the color to draw with * @param color the {@code ColorLong} to draw onto the canvas. See the {@link Color} * class for details about {@code ColorLong}s. * @param mode the blendmode to apply to the color * @param mode the blendmode to apply to the color * @throws IllegalArgumentException if the color space encoded in the long * @throws IllegalArgumentException if the color space encoded in the {@code ColorLong} * is invalid or unknown. * is invalid or unknown. */ */ public void drawColor(@ColorLong long color, @NonNull BlendMode mode) { public void drawColor(@ColorLong long color, @NonNull BlendMode mode) { Loading
graphics/java/android/graphics/Paint.java +10 −8 Original line number Original line Diff line number Diff line Loading @@ -1029,9 +1029,8 @@ public class Paint { * premultiplied, meaning that alpha can be any value, regardless of the * premultiplied, meaning that alpha can be any value, regardless of the * values of r,g,b. See the {@link Color} class for more details. * values of r,g,b. See the {@link Color} class for more details. * * * @see Color for APIs that help manipulate a color long. * @return the paint's color, alpha, and {@code ColorSpace} encoded as a * * {@code ColorLong} * @return the paint's color (and alpha). */ */ @ColorLong @ColorLong public long getColorLong() { public long getColorLong() { Loading @@ -1052,7 +1051,7 @@ public class Paint { } } /** /** * Set the paint's color with a {@link ColorLong}. Note that the color is * Set the paint's color with a {@code ColorLong}. Note that the color is * a long with an encoded {@link ColorSpace} as well as alpha and r,g,b. * a long with an encoded {@link ColorSpace} as well as alpha and r,g,b. * These values are not premultiplied, meaning that alpha can be any value, * These values are not premultiplied, meaning that alpha can be any value, * regardless of the values of r,g,b. See the {@link Color} class for more * regardless of the values of r,g,b. See the {@link Color} class for more Loading @@ -1060,8 +1059,8 @@ public class Paint { * * * @param color The new color (including alpha and {@link ColorSpace}) * @param color The new color (including alpha and {@link ColorSpace}) * to set in the paint. * to set in the paint. * @throws IllegalArgumentException if the color space encoded in the long * @throws IllegalArgumentException if the color space encoded in the * is invalid or unknown. * {@code ColorLong} is invalid or unknown. */ */ public void setColor(@ColorLong long color) { public void setColor(@ColorLong long color) { ColorSpace cs = Color.colorSpace(color); ColorSpace cs = Color.colorSpace(color); Loading Loading @@ -1491,8 +1490,8 @@ public class Paint { * The alpha of the shadow will be the paint's alpha if the shadow color is * The alpha of the shadow will be the paint's alpha if the shadow color is * opaque, or the alpha from the shadow color if not. * opaque, or the alpha from the shadow color if not. * * * @throws IllegalArgumentException if the color space encoded in the long * @throws IllegalArgumentException if the color space encoded in the * is invalid or unknown. * {@code ColorLong} is invalid or unknown. */ */ public void setShadowLayer(float radius, float dx, float dy, @ColorLong long shadowColor) { public void setShadowLayer(float radius, float dx, float dy, @ColorLong long shadowColor) { ColorSpace cs = Color.colorSpace(shadowColor); ColorSpace cs = Color.colorSpace(shadowColor); Loading Loading @@ -1559,8 +1558,11 @@ public class Paint { /** /** * Returns the color of the shadow layer. * Returns the color of the shadow layer. * * @return the shadow layer's color encoded as a {@link ColorLong}. * @see #setShadowLayer(float,float,float,int) * @see #setShadowLayer(float,float,float,int) * @see #setShadowLayer(float,float,float,long) * @see #setShadowLayer(float,float,float,long) * @see Color */ */ public @ColorLong long getShadowLayerColorLong() { public @ColorLong long getShadowLayerColorLong() { return mShadowLayerColor; return mShadowLayerColor; Loading