Loading graphics/java/android/graphics/drawable/ClipDrawable.java +17 −0 Original line number Diff line number Diff line Loading @@ -149,6 +149,23 @@ public class ClipDrawable extends DrawableWrapper { return true; } @Override public int getOpacity() { final Drawable dr = getDrawable(); final int opacity = dr.getOpacity(); if (opacity == PixelFormat.TRANSPARENT || dr.getLevel() == 0) { return PixelFormat.TRANSPARENT; } final int level = getLevel(); if (level >= MAX_LEVEL) { return dr.getOpacity(); } // Some portion of non-transparent drawable is showing. return PixelFormat.TRANSLUCENT; } @Override public void draw(Canvas canvas) { final Drawable dr = getDrawable(); Loading graphics/java/android/graphics/drawable/DrawableWrapper.java +5 −8 Original line number Diff line number Diff line Loading @@ -180,7 +180,8 @@ public abstract class DrawableWrapper extends Drawable implements Drawable.Callb @Override public int getChangingConfigurations() { return super.getChangingConfigurations() | (mState != null ? mState.getChangingConfigurations() : 0); | (mState != null ? mState.getChangingConfigurations() : 0) | mDrawable.getChangingConfigurations(); } @Override Loading Loading @@ -366,15 +367,12 @@ public abstract class DrawableWrapper extends Drawable implements Drawable.Callb } /** * Called during inflation to inflate the child element. * Called during inflation to inflate the child element. The last valid * child element will take precedence over any other child elements or * explicit drawable attribute. */ void inflateChildDrawable(Resources r, XmlPullParser parser, AttributeSet attrs, Resources.Theme theme) throws XmlPullParserException, IOException { // Drawable specified on the root element takes precedence. if (getDrawable() != null) { return; } // Seek to the first child element. Drawable dr = null; int type; Loading @@ -383,7 +381,6 @@ public abstract class DrawableWrapper extends Drawable implements Drawable.Callb && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) { if (type == XmlPullParser.START_TAG) { dr = Drawable.createFromXmlInner(r, parser, attrs, theme); break; } } Loading Loading
graphics/java/android/graphics/drawable/ClipDrawable.java +17 −0 Original line number Diff line number Diff line Loading @@ -149,6 +149,23 @@ public class ClipDrawable extends DrawableWrapper { return true; } @Override public int getOpacity() { final Drawable dr = getDrawable(); final int opacity = dr.getOpacity(); if (opacity == PixelFormat.TRANSPARENT || dr.getLevel() == 0) { return PixelFormat.TRANSPARENT; } final int level = getLevel(); if (level >= MAX_LEVEL) { return dr.getOpacity(); } // Some portion of non-transparent drawable is showing. return PixelFormat.TRANSLUCENT; } @Override public void draw(Canvas canvas) { final Drawable dr = getDrawable(); Loading
graphics/java/android/graphics/drawable/DrawableWrapper.java +5 −8 Original line number Diff line number Diff line Loading @@ -180,7 +180,8 @@ public abstract class DrawableWrapper extends Drawable implements Drawable.Callb @Override public int getChangingConfigurations() { return super.getChangingConfigurations() | (mState != null ? mState.getChangingConfigurations() : 0); | (mState != null ? mState.getChangingConfigurations() : 0) | mDrawable.getChangingConfigurations(); } @Override Loading Loading @@ -366,15 +367,12 @@ public abstract class DrawableWrapper extends Drawable implements Drawable.Callb } /** * Called during inflation to inflate the child element. * Called during inflation to inflate the child element. The last valid * child element will take precedence over any other child elements or * explicit drawable attribute. */ void inflateChildDrawable(Resources r, XmlPullParser parser, AttributeSet attrs, Resources.Theme theme) throws XmlPullParserException, IOException { // Drawable specified on the root element takes precedence. if (getDrawable() != null) { return; } // Seek to the first child element. Drawable dr = null; int type; Loading @@ -383,7 +381,6 @@ public abstract class DrawableWrapper extends Drawable implements Drawable.Callb && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) { if (type == XmlPullParser.START_TAG) { dr = Drawable.createFromXmlInner(r, parser, attrs, theme); break; } } Loading