summaryrefslogtreecommitdiffstats
path: root/graphics/java/android/graphics/Bitmap.java
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2015-03-02 09:39:27 -0800
committerTor Norbye <tnorbye@google.com>2015-03-05 16:34:12 -0800
commit80756e38882720860db52f1fcc21fa1505a02abf (patch)
tree284afea0646c9e16b8f0a5ea11e013e21768e813 /graphics/java/android/graphics/Bitmap.java
parentcb59f2afb7a403af7c2bb6a6deb2c981a156fb96 (diff)
downloadframeworks_base-80756e38882720860db52f1fcc21fa1505a02abf.zip
frameworks_base-80756e38882720860db52f1fcc21fa1505a02abf.tar.gz
frameworks_base-80756e38882720860db52f1fcc21fa1505a02abf.tar.bz2
Annotate ARGB integer parameters with @ColorInt
Change-Id: I307f72a382272cf18ddb6b07d9fcb81228568d9a
Diffstat (limited to 'graphics/java/android/graphics/Bitmap.java')
-rw-r--r--graphics/java/android/graphics/Bitmap.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java
index 5b20d48..aae11cd 100644
--- a/graphics/java/android/graphics/Bitmap.java
+++ b/graphics/java/android/graphics/Bitmap.java
@@ -16,6 +16,7 @@
package android.graphics;
+import android.annotation.ColorInt;
import android.annotation.NonNull;
import android.os.Parcel;
import android.os.Parcelable;
@@ -1278,7 +1279,7 @@ public final class Bitmap implements Parcelable {
*
* @throws IllegalStateException if the bitmap is not mutable.
*/
- public void eraseColor(int c) {
+ public void eraseColor(@ColorInt int c) {
checkRecycled("Can't erase a recycled bitmap");
if (!isMutable()) {
throw new IllegalStateException("cannot erase immutable bitmaps");
@@ -1296,6 +1297,7 @@ public final class Bitmap implements Parcelable {
* @return The argb {@link Color} at the specified coordinate
* @throws IllegalArgumentException if x, y exceed the bitmap's bounds
*/
+ @ColorInt
public int getPixel(int x, int y) {
checkRecycled("Can't call getPixel() on a recycled bitmap");
checkPixelAccess(x, y);
@@ -1325,7 +1327,7 @@ public final class Bitmap implements Parcelable {
* @throws ArrayIndexOutOfBoundsException if the pixels array is too small
* to receive the specified number of pixels.
*/
- public void getPixels(int[] pixels, int offset, int stride,
+ public void getPixels(@ColorInt int[] pixels, int offset, int stride,
int x, int y, int width, int height) {
checkRecycled("Can't call getPixels() on a recycled bitmap");
if (width == 0 || height == 0) {
@@ -1407,7 +1409,7 @@ public final class Bitmap implements Parcelable {
* @throws IllegalArgumentException if x, y are outside of the bitmap's
* bounds.
*/
- public void setPixel(int x, int y, int color) {
+ public void setPixel(int x, int y, @ColorInt int color) {
checkRecycled("Can't call setPixel() on a recycled bitmap");
if (!isMutable()) {
throw new IllegalStateException();
@@ -1439,7 +1441,7 @@ public final class Bitmap implements Parcelable {
* @throws ArrayIndexOutOfBoundsException if the pixels array is too small
* to receive the specified number of pixels.
*/
- public void setPixels(int[] pixels, int offset, int stride,
+ public void setPixels(@ColorInt int[] pixels, int offset, int stride,
int x, int y, int width, int height) {
checkRecycled("Can't call setPixels() on a recycled bitmap");
if (!isMutable()) {