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

Commit f4c068b7 authored by Alan Viverette's avatar Alan Viverette
Browse files

Add getDither, getFilterBitmap to Drawable for CTS testing

Also removes unnecessary overrides from PictureDrawable.

Change-Id: I13539b5204e8c0d8b9912da14de7ceae62720e3f
parent 304ea5aa
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