History log of /frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
813680780f365648b39873fa26dfae0123d51aed 21-Nov-2012 Chet Haase <chet@google.com> Use correct alpha value when a color is not set on a GradientDrawable.

A previous fix ensured that color filters would have a default (black) color to
interact with if no color was set on the GradientDrawable object. However, that fix
assumed an opaque alpha value, which is not always the case. Specifically, calling
setImageAlpha() on an ImageView with a shape drawable source (as in the bug here)
caused the alpha to be set to a translucent value, which was then ignored in the fix
above.

The fix is to account for the current alpha value of the GradientDrawable object
when setting the color used by the paint object.

Issue #7592193 ImageView.setImageAlpha() broken when colorFilter is in use

Change-Id: Ie622ffca776fdd8731ced78ce1f683ca6a51dec8
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
39824f685c33f8aabbe9526b4cc79b7411e8b37f 31-Oct-2012 Raph Levien <raph@google.com> Fix for bug 7400445 regression in background drawable

The opacity calculation for a gradient drawable of shape must take
rounded corners into account - if the corner radius is nonzero, then the
shape is translucent rather than opaque. Previously the code always
assumed that such rectangles were fully opaque, which led to the
background (visible behind the rectangle) not getting drawn.

This patch simply checks for corner radius in addition to shape and
computes opacity as translucent in the nonzero case.

Change-Id: Iaf4d24abc6ecf49f85c82972b8f998700c83295e
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
41c769d9a8858ad20b0a6ed942a1cea19ba59d2d 03-Oct-2012 Romain Guy <romainguy@google.com> Bring back Netflix progress bar
Bug #7274157

Gradients and color filters are multiplied by the paint's color so it
needs to be set to opaque black to have an effect.

Change-Id: Ib5dd1e6185f758f55b57a0f4496dfae98f1a096b
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
cf8675ee176a375f873792684d38a47f78348dff 02-Oct-2012 Romain Guy <romainguy@google.com> Draw stroked rectangle as meshes instead of textures
Bug #7233734

Stroked rectangles were rendered using software generated textures
which would lead to slightly misaligned results. Instead, let's use
the new convex path rendering code that will do the right thing
(and save a lot of bandwidth.)

Change-Id: Ib95ff581e56c1ecead97e4919298e6fd146ca167
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
684385ddde2ac0c26de0862390ad713aff3fb149 19-Sep-2012 Romain Guy <romainguy@google.com> mutate() didn't work as advertised
Bug #7162705

Change-Id: I15b2663fa7f1c71a2a3479134b8b7f37bfcbc607
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
e91aa0fa64db892194ba82ec7d41df6fb9185471 19-Sep-2012 Romain Guy <romainguy@google.com> Compute GradientDrawable's opacity correctly

The current implementation of GradientDrawable always assumes the shape needs
to be blended. This causes all windows to be considered translucent by default.
This change recomputes the opacity as needed to ensure windows are marked
opaque when they should.

Change-Id: Iaf291d889a6c5122ab00c9f5781df3e7f61547fa
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
5f49c3023a512efbef8bc9515d310c7a72be4af2 07-Sep-2012 Romain Guy <romainguy@google.com> The drawables cache strikes again
Bug #7117785

Draawables created from the ConstantState cache found in Resources must be
mutated before they can be safely modified by apps. Failure to do so results
in all drawables sharing the same constant state to be affected by the
modification.

In the case of the bugreport above, the status bar code plays tricks with
a background drawable and modifies its color to implement a fade in/out
effect. This drawable comes from a cached resource (color 0x0) and the
modifications made by the status bar apply to other clients of this drawable,
most notably the recents panel.

This change fixes several things:
- Simplifies colors caching by removing the assetCookie from the key. This
should result in better reuse of cached drawables
- Makes View.setBackgroundColor() honor the mutate() contract
- Ensure StateListDrawable properly mutates its children before modifying
them
- Optimize Bitmap/ColorDrawable to mark them mutated when they are not
created from an existing ConstantSate. The same optimization should be
applied to other drawables in the future

Change-Id: I54adb5d5b914c7d8930bf9b46f7e3f9dcbf4bcab
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
8bd9698b66d2e1219931ca1be5f81efaba3ed95a 31-Jan-2012 Romain Guy <romainguy@google.com> Add GradientDrawable.setColors(int[])

This change also updates the documentation to warn the user about which properties
require a call to mutate().

Change-Id: I84717068bf026669e3eef1ae92db665a964fe08a
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
098ffcd521cd272ee3a63174759cceeda618d2ef 11-Oct-2011 Romain Guy <romainguy@google.com> Don't call saveLayer() when it's not required
Bug #5435653

saveLayer() can be extremely expensive on some GPU architectures. Avoiding
this call greatly improve the rendering performance of drawables with
strok + fill.

Change-Id: Ib414174ba05d5bad56d942b8e67ab784e7d60b9e
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
e1c6ff4b91072a4071589938c74dd65d66f88fb5 26-Apr-2011 Romain Guy <romainguy@google.com> Make setGradientCenter/Radius work.

The previous implementation would not rebuild the gradient shader
when programmatically changing the shader's properties. Also fixes
the documentation since the gradient center does affect linear
gradients.

Change-Id: I5387188484b862f6835b0da9042b25032e55e792
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
ee6d5cfdff475f6c1119f060b139bdc1b621fa8b 26-Apr-2011 Romain Guy <romainguy@google.com> Copy the solid color when mutating a gradient drawable.

Change-Id: If3eed36b81f54bb5a56eab7784feda3e3786f8fc
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
ed7894352f8addfe3d0da75cc7fe8bc6fef201dc 24-Feb-2011 Romain Guy <romainguy@google.com> Add dither XML attribute support to Gradient and ShapeDrawable.

Change-Id: I4b60a0ba6766b7e7b176e78dc7f15f8467e2b890
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
39c512b623eff1d7a7b17f68a42723fbda9bf483 23-Feb-2011 Romain Guy <romainguy@google.com> Don't swap bottom left and bottom right corner radii.

Change-Id: If57b6627f67998edc384de15e3d970f8edf18211
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
6efd2bad954e0e5bd74916a32f036a0f149dcd4d 13-Jan-2011 Christopher Lais <chris+android@zenthought.org> Don't drop the drawable cache completely on configuration change

There was a lot of fancy code just above the clear to ensure
that drawables that aren't affected by the change are kept,
then the entire array was cleared. This patch removes the
clear, so that the drawables that haven't changed are really
kept, matching the logs, comments and larger part of the code.

This patch also fixes the various constant states to return
correct ChangingConfigurations.

Change-Id: Ic11f6179537318d3de16dc58286989eb62a07f15
Old-Change-Id: I22495e6ed232dfe056207ce5155405af1fa82428
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
9891e1fce5f29d0421d34aa481037417bd70853d 11-Nov-2010 Chet Haase <chet@google.com> Add invalidation to Drawable when its properties change

invalidateSelf() already exists on Drawable. This triggers a call to
callback listeners so that they know the drawable has been invalidated.
For example, the background drawable on View will cause the View itself
to be invalidated.

Change-Id: I45b231a7600dcf3bc139e4059b7c9940ff49f60c
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
1041aded2df45094c36831028245fb7c5e9b67b7 04-Nov-2010 Romain Guy <romainguy@google.com> Fix possible rendering issue when drawing a path.

Change-Id: I25f2e609589f0dd9294bcf7930de6398c0d7e377
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
61c8c9c5b2006d18e9310b6521c65b36ffe75ce4 10-Aug-2010 Romain Guy <romainguy@google.com> Fix tons of bugs and add new text rendering support.

Change-Id: I326c66b10784006f6df2f12d38e120cef94cd0d7
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
dfe5c204403bc56c29bb36410574eab8b1950417 09-Jun-2010 Scott Main <smain@google.com> docs: lots of additions to the resources docs
new drawable resources
add <merge> and <include> to layout resource
update drawable class descriptioons to point to resources guide
add ID resource type

Change-Id: I733eec50bb2671f28c9e6dd7dec14eb6586f5193
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
1be46d7920dbdce24f878d6f4889ea8591ab75c6 25-Mar-2010 viral.vkm <viral.vkm@gmail.com> setCornerRadii should be called when either of corners radius is specified
as 0dp and thus while checking for condition, it should be ORed and not ANDed.

It solves Android Issue: 939
http://code.google.com/p/android/issues/detail?id=939

Change-Id: Ic18fae769480972f763f634e7462c6ed3853220b
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
4e03999ca20fd326e4ded3d7444ddd5c14f369c7 29-Sep-2009 Mike Reed <reed@google.com> if we have a single value for roundrect radius, manually clamp it before drawing.

Skia will clamp the radius independently in X and Y to ensure it is not larger than 1/2 the width (or height).
If the caller to our drawable gives us a single value, we'll assume they want it to be circular, and not an oval.
To do that, we clamp it up front, so we get (possibly smaller) circular corners, rather than potentially
elliptical ones.

This makes the progress bar look "nicer" when it is very thin in one dimension.
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
c2974809373697147cbe5754835cc871fb93aef1 14-Sep-2009 Dianne Hackborn <hackbod@google.com> Fix issue #2116977: buttons are huge and bent

Now that we are using preloaded drawables in compatibilty mode, when
constructing them from their constant state we need to set the new
drawable's target density appropriately.

Change-Id: I3665cbea09d38b9ac5f45f8c380dc8641f86b266
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
562bf17c6c7c5226b2220e27a1543d4a43543d6c 24-Jun-2009 Phil Dubach <phillipd@google.com> Fix NPE in GradientDrawable constructor

The mColors member can be null, as can be seen in
GradientDrawable.setSolidColor() or the plain constructor. In that case, an NPE
will be thrown on attempts to derive a new GradientDrawable from the instance
using the private constructor GradientDrawable(GradientDrawable).

The problem also occurs when inflating a GradientDrawable from XML without
defining the start, center and end colors and then calling mutate() on the
instance.
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
da996f390e17e16f2dfa60e972e7ebc4f868f37e 13-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@131421
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
d24b8183b93e781080b2c16c487e60d51c12da31 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
b798689749c64baba81f02e10cf2157c747d6b46 10-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@125939
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/graphics/java/android/graphics/drawable/GradientDrawable.java