File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
graphics/java/android/graphics/drawable Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -202,18 +202,30 @@ public boolean getPadding(Rect padding) {
202202
203203 @ Override
204204 public void setAlpha (int alpha ) {
205+ if (mPaint == null && alpha == 0xFF ) {
206+ // Fast common case -- leave at normal alpha.
207+ return ;
208+ }
205209 getPaint ().setAlpha (alpha );
206210 invalidateSelf ();
207211 }
208212
209213 @ Override
210214 public void setColorFilter (ColorFilter cf ) {
215+ if (mPaint == null && cf == null ) {
216+ // Fast common case -- leave at no color filter.
217+ return ;
218+ }
211219 getPaint ().setColorFilter (cf );
212220 invalidateSelf ();
213221 }
214222
215223 @ Override
216224 public void setDither (boolean dither ) {
225+ if (mPaint == null && dither == DEFAULT_DITHER ) {
226+ // Fast common case -- leave at default dither.
227+ return ;
228+ }
217229 getPaint ().setDither (dither );
218230 invalidateSelf ();
219231 }
You can’t perform that action at this time.
0 commit comments