Closed Bug 1180907 Opened 10 years ago Closed 10 years ago

Call Drawable.mutate before setting tint

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(firefox42 fixed)

RESOLVED FIXED
Firefox 42
Tracking Status
firefox42 --- fixed

People

(Reporter: mcomella, Assigned: mcomella)

References

Details

Attachments

(2 files)

We set tint at [1] but it affects the asset used in bug 1079182. As per the Drawable.mutate documentation [2]: Make this drawable mutable. This operation cannot be reversed. A mutable drawable is guaranteed to not share its state with any other drawable. This is especially useful when you need to modify properties of drawables loaded from resources. By default, all drawables instances loaded from the same resource share a common state; if you modify the state of one instance, all the other instances will receive the same modification. Calling this method on a mutable Drawable will have no effect. --- So we're mutating the shared Drawable. [1]: https://mxr.mozilla.org/mozilla-central/source/mobile/android/base/home/SearchEngineBar.java?rev=cdcfb0ec9848#179 [2]: http://developer.android.com/reference/android/graphics/drawable/Drawable.html#mutate%28%29
Assignee: nobody → michael.l.comella
Bug 1180907 - Mutate search label before tinting it. r=sebastian If we don't mutate, we're tinting the shared Drawable state and other Drawables using the same asset might also get tinted.
Attachment #8630173 - Flags: review?(s.kaspari)
Comment on attachment 8630173 [details] MozReview Request: Bug 1180907 - Mutate search label before tinting it. r=sebastian https://reviewboard.mozilla.org/r/12691/#review11281 Ship It!
Attachment #8630173 - Flags: review?(s.kaspari) → review+
Oh, this is good to know and easy to forget. :)
url: https://hg.mozilla.org/integration/fx-team/rev/43e91e8a73317f69413c66d544a7ab0f90ec5129 changeset: 43e91e8a73317f69413c66d544a7ab0f90ec5129 user: Michael Comella <michael.l.comella@gmail.com> date: Mon Jul 06 14:42:22 2015 -0700 description: Bug 1180907 - Mutate search label before tinting it. r=sebastian If we don't mutate, we're tinting the shared Drawable state and other Drawables using the same asset might also get tinted.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 42
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: