Closed Bug 821453 Opened 12 years ago Closed 12 years ago

Lightweight theme buttons don't have a gradient on 4.2.1

Categories

(Firefox for Android Graveyard :: Theme and Visual Design, defect)

ARM
Android
defect
Not set
normal

Tracking

(firefox19 fixed, firefox20 fixed)

RESOLVED FIXED
Firefox 20
Tracking Status
firefox19 --- fixed
firefox20 --- fixed

People

(Reporter: sriram, Assigned: sriram)

References

Details

Attachments

(1 file)

With changes to mutate() in the Android drawables, the BitmapDrawable inside a LayerDrawable, which inturn is inside a ShapeDrawable (and oh! that's inside a LevelDrawable) cannot show transparency, starting 4.2.1. Also, it's better to combine the layers in a LayerDrawable into a single Drawable using shaders. This reduces the number of times a paint is drawn. This is also better over the PorterDuffXfermode approach.
Attached patch PatchSplinter Review
This patch solves the problem on 4.2.1 and lower. From view's perspective: 1. A view either gets a Color based or Texture based LightweightThemeDrawable. TabsPanel is special which gets both. 2. The view sets an alpha value --> this is used for the LinearGradient used with the bitmap shader. On LightweightThemeDrawable: 1. A texture-paint is created based on the given texture -- this uses a bitmap-shader. 2. A color-paint is created based on the given color. 3. A bitmap-paint is created based on the given bitmap and the linear-gradient to apply. It's based to combine these shaders into one ComposeShader, that will make the paint draw in one go. (Ofcourse, porter-duff is needed, as always). Suggestions: It might be better to combine the texture-paint's shader and the color-paint's shader with the bitmap-paint. That will ensure paint the canvas only once -- which is a performance win. However, I didn't want to overload this patch and would like to do as a followup.
Assignee: nobody → sriram
Attachment #691982 - Flags: review?(mark.finkle)
Comment on attachment 691982 [details] [diff] [review] Patch Thanks for adding the comments too
Attachment #691982 - Flags: review?(mark.finkle) → review+
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 20
Depends on: 822133
Comment on attachment 691982 [details] [diff] [review] Patch [Approval Request Comment] Bug caused by (feature/regressing bug #): Android's bug on mutating drawable. (Someone watched X-men there!) User impact if declined: JB phones will not show personas properly. Testing completed (on m-c, etc.): Landed on m-c on 12/15 Risk to taking this patch (and alternatives if risky): Very low. This optimizes the drawable for performance. This is needed for bug 822421 to land. String or UUID changes made by this patch: None.
Attachment #691982 - Flags: approval-mozilla-aurora?
Attachment #691982 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
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: