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

Commit 714e236c authored by Alan Viverette's avatar Alan Viverette Committed by Android (Google) Code Review
Browse files

Merge "Add getDither, getFilterBitmap to Drawable for CTS testing"

parents 70f52f6a f4c068b7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -11699,6 +11699,8 @@ package android.graphics.drawable {
    method public android.graphics.drawable.Drawable.ConstantState getConstantState();
    method public android.graphics.drawable.Drawable getCurrent();
    method public android.graphics.Rect getDirtyBounds();
    method public boolean getDither();
    method public boolean getFilterBitmap();
    method public int getIntrinsicHeight();
    method public int getIntrinsicWidth();
    method public final int getLevel();
+5 −0
Original line number Diff line number Diff line
@@ -357,6 +357,11 @@ public class BitmapDrawable extends Drawable {
        invalidateSelf();
    }

    @Override
    public boolean getDither() {
        return mBitmapState.mPaint.isDither();
    }

    /**
     * Indicates the repeat behavior of this drawable on the X axis.
     *
+16 −0
Original line number Diff line number Diff line
@@ -273,6 +273,14 @@ public abstract class Drawable {
     */
    public void setDither(boolean dither) {}

    /**
     * @return whether this drawable dither its colors
     * @see #setDither(boolean)
     */
    public boolean getDither() {
        return false;
    }

    /**
     * Set to true to have the drawable filter its bitmap when scaled or rotated
     * (for drawables that use bitmaps). If the drawable does not use bitmaps,
@@ -281,6 +289,14 @@ public abstract class Drawable {
     */
    public void setFilterBitmap(boolean filter) {}

    /**
     * @return whether this drawable filters its bitmap
     * @see #setFilterBitmap(boolean)
     */
    public boolean getFilterBitmap() {
        return false;
    }

    /**
     * Implement this interface if you want to create an animated drawable that
     * extends {@link android.graphics.drawable.Drawable Drawable}.
+5 −0
Original line number Diff line number Diff line
@@ -166,6 +166,11 @@ public class DrawableContainer extends Drawable implements Drawable.Callback {
        }
    }

    @Override
    public boolean getDither() {
        return mDrawableContainerState.mDither;
    }

    @Override
    public void setColorFilter(ColorFilter cf) {
        mDrawableContainerState.mHasColorFilter = (cf != null);
+5 −0
Original line number Diff line number Diff line
@@ -821,6 +821,11 @@ public class GradientDrawable extends Drawable {
        }
    }

    @Override
    public boolean getDither() {
        return mGradientState.mDither;
    }

    @Override
    public ColorFilter getColorFilter() {
        return mColorFilter;
Loading