178 Commits

Author SHA1 Message Date
Fabrice Di Meglio
5c2591e6ef Merge "Fix bug #7206086 NumberPicker widget should use locale digits" into jb-mr1-dev 2012-09-23 11:10:40 -07:00
Fabrice Di Meglio
d88e3054d0 Fix bug #7206086 NumberPicker widget should use locale digits
- fix for having the TwoDigitFormatter being able to be recreated if the locale is changed
- accept now also the Arabic and Persian digits

Change-Id: Ifbf7e274d971008f4a5782402d4b76d9472b68fc
2012-09-21 18:42:47 -07:00
Romain Guy
57b5268708 Optimize tiling management
Bug #7186819

Change-Id: Iebc42a6e9c96ad5605fbbe1539aa887695d2e829
2012-09-20 17:38:46 -07:00
Romain Guy
2b7028eaba Add support for QCOM_tiled_rendering
Bug #7186819

This optional OpenGL extension can be used by tiled renderers to optimize
copies from main memory to tiles memory.

Change-Id: Id4a5d64e61ad17f50e773e8104b9bf584bb65077
2012-09-19 21:10:09 -07:00
Romain Guy
189ff17caa Add test for layer updates optimizations
Optimizations are following.

Change-Id: I120e1d0c08d8068fcac46515f37a4ae510e5f3a3
2012-09-18 18:59:59 -07:00
Romain Guy
4aacf93d40 Merge "Fix memory corruption in LayerRenderer::copyLayer" into jb-mr1-dev 2012-09-07 18:44:40 -07:00
Romain Guy
e49d7ec361 Fix memory corruption in LayerRenderer::copyLayer
The pixel store pack alignment was not set for the source texture,
causing a write to occur outside of the destination bitmap's
bounds.

Change-Id: Iaa5767acf7b5943fbc2765c3810a142f06b1a796
2012-09-07 18:42:38 -07:00
Chris Craik
75040f8a77 Handle different x, y scales in drawLines AA path
bug:7114630

Fixes different x, y scales, and fixes boundaryWidthProportion to be from
center, not edge.

Also adds drawLine tests that previously drew blurry.

Change-Id: I2b648a60361ad3931eac67647b9b27909525ee1e
2012-09-07 15:20:38 -07:00
Chris Craik
378d131e65 Merge "Varying-based AA rect drawing" into jb-mr1-dev 2012-09-06 10:52:14 -07:00
Chris Craik
6ebdc114e0 Varying-based AA rect drawing
Instead of calculating opacity from relative position in the shader, use a
shader varying to do this computation for us.

bug:5045101

Also adds a test to HwAccelerationTest to show incorrect antialiasing in
scaled drawAARect / boundarySize calculation.

Change-Id: Icdc41acb01dc10ce354834f8389a5aed2f439162
2012-09-05 16:45:03 -07:00
Romain Guy
9fc4b356a4 Add new hw acceleration test
Change-Id: Id2b94286cf62ab77d8c843cffaba09b3070a6332
2012-09-04 10:27:05 -07:00
Chet Haase
e816baea65 Optimize interactions with glyph cache
There are two fixes here:
- precaching: instead of caching-then-drawing whenever there is a new
glyph, we cache at DisplayList record time. Then when we finally draw that
DisplayList, we just upload the affected texture(s) once, instead of once
per change. This is a huge savings in upload time, especially when there are
larger glyphs being used by the app.
- packing: Previously, glyphs would line up horizontally on each cache line, leaving
potentially tons of space vertically, especially when smaller glyphs got put into cache
lines intended for large glyphs (which can happen when an app uses lots of unique
glyphs, a common case with, for example, chinese/japanese/korean languages). The new
approach packs glyphs vertically as well as horizontally to use the space more efficiently
and provide space for more glyphs in these situations.

Change-Id: I84338aa25db208c7bf13f3f92b4d05ed40c33527
2012-08-14 10:33:30 -07:00
Romain Guy
320d46bf84 Reduce gradients textures size whenever possible
Change-Id: Ifd58625ee62edac3b5d20b77553cb98b6fa2b46e
2012-08-08 16:05:42 -07:00
Romain Guy
33fa1f774c Draw an empty border around glyphs to avoid sampling issues
Bug #6942209

The font renderer was preserving a 1 px border around each glyph to ensure
bilinear filtering would work nicely. Unfortunately, this border was not
set to 0 when glyphs were added in the cache to replace old evicted glyphs.

Change-Id: Ib85afca7ebad5cb63f960dc0e87ae162333dbfe8
2012-08-07 19:09:57 -07:00
Romain Guy
211efea737 Add dithering to gradients
Change-Id: Ic1208855bde3a254eca2fd7cef43e0f1318ce419
2012-08-01 19:18:35 -07:00
Romain Guy
42e1e0d482 Improve gradients
Avoid using textures for common gradients (two stops from 0.0 to 1.0)

Change-Id: Iff55d21b126c8cfc4cfb701669f2339c8f6b131a
2012-07-31 18:55:16 -07:00
Romain Guy
786fc93d71 Make HardwareRenderer able to target generic Surface objects
Change-Id: I4b7199a1eb30e0df354ae12c4819adc69db5df40
2012-07-24 16:41:21 -07:00
Romain Guy
98ba89492a Make gradients look slightly better
Change-Id: Ib12c628a88b9ec6af1214ce6e5cb14cfde40485e
2012-07-20 16:58:45 -07:00
Michael Jurka
ba64974141 Removing setChildrenLayersEnabled
Change-Id: I88d8228eadb59160648f2c4e131fcd85945f2109
2012-06-28 19:15:20 -07:00
Romain Guy
4c43f66d06 Fix TextureView OpenGL sample
The sample was doing something dumb: instead of binding the texture unit
to the shader's sampler, it was binding the texture name. Oops.

Change-Id: I13450dacbbd2dad362a2573aebb95e8eb87b25f0
2012-05-16 20:01:17 -07:00
Romain Guy
e651cc6239 Remove all Dalvik allocations from Cavnas.drawBitmap(int[], ...)
Change-Id: Ie28538a2104d21154fdc78a56525e7403f08287d
2012-05-14 19:44:40 -07:00
Chet Haase
d34dd71800 Fix hang/crash in native path code
An optimization for paths is to only create a texture for the original native
Path object, and have all copies of that object use that texture. This works in
most cases, but sometimes that original path object may get destroyed (when the
SDK path object is finalized) while we are still referencing and using that object
in the DisplayList code. This causes undefined errors such as crashes and hanging
as we iterate through the operations of a destroyed (and garbage-filled) path object.

The fix is to use the existing ResourceCache to refcount the original path until
we are done with it.

Issue #6414050 Analytics Dogfood App crashes reliably on Jellybean

Change-Id: I5dbec5c069f7d6a1e68c13424f454976a7d188e9
2012-05-03 11:14:50 -07:00
Chet Haase
810a8676df Corrects invalidation logic for layered views
A bug in the invalidation logic meant that changes to a view
would not cause parents in the view hiearchy that were set to have
a layer (e.g., View.LAYER_TYPE_HARDWARE) to get invalidated properly.
So even though the child view was all set to recreate its display list
according to the property change, the layer in the tree above it would stay
as-is, meaning that the change would not show up on the screen.

Issue #5887530 DropTarget text does not change color with the icon

Change-Id: Ie6eac4f406d172cb437822d9fe76340ab2afaf1c
2012-05-02 10:44:33 -07:00
Romain Guy
0a1cbc5f7d Merge "New libhwui test activity" 2012-04-03 21:17:34 -07:00
Romain Guy
2946445b56 New libhwui test activity
Change-Id: I0ce4bc665f117d7c0ed47670ceb4ed6f9b54d85c
2012-04-03 21:15:12 -07:00
Chet Haase
db8c9a6a4d Optimization of alpha with DisplayList properties
Some views (such as ImageView and TextView) handle non-opaque alpha
values directly. This was originally an optimization, but we can handle it faster
in many cases without this optimization when DisplayList properties are enabled.
Basically, if a view has non-overlapping rendering, we set the alpha value directly
on the renderer (the equivalent of setting it on the Paint object) and draw each
primitive with that alpha value. Doing it this way avoids re-creating DisplayLists
while getting the same speedup that onSetAlpha() used to get pre-DisplayList properties.

Change-Id: I0f7827f075d3b35093a882d4adbb300a1063c288
2012-04-03 14:02:17 -07:00
Chet Haase
9420abd56a Re-enable DisplayList properties.
Re-enabling DisplayList properties last week caused some app
errors due to the way that some transforms were being handled (specifically,
those coming from the old Animations and ViewGroup's childStaticTransformation
field). This change pushes *all* transform/alpha data from View.draw() into
the view's DisplayList, making DisplayLists more encapsulated (and correct).

Change-Id: Ia702c6aae050784bb3ed505aa87553113f8a1938
2012-04-02 15:31:24 -07:00
Romain Guy
9777173eb6 Full implementation of Canvas.drawPath()
Change-Id: I23223b89770a0cd2b4762365bead9bfddb094290
2012-02-29 19:14:37 -08:00
Romain Guy
03d58520c3 More infrastructure for Canvas.drawTextOnPath
Change-Id: Iff42b24e342650d06fa4e2fa9db6c28da820ff01
2012-02-24 17:54:07 -08:00
Romain Guy
325740fb44 Add hooks to implement Canvas.drawTextOnPath() in GL
Change-Id: I165c9e05facf5365aa6850605688e538640c7fcc
2012-02-24 16:48:34 -08:00
Romain Guy
4bcb7467a1 Only recreate path textures when necessary
When a drawPath command is recorded in a display list, a copy of the
source path is made to preserve against possible modifications of the
said source path. Copies are discarded when a display list is cleared,
which usually happens on invalidate(). This means that even if a path
is never modified, the texture generated to draw it on screen is
destroyed every time an invalidate() is issued. This change fixes this
problem by introducing a reference to the source path in the copy.
If both the copy and the source path have the same genID, they are
the same path and can share the same texture.

Change-Id: I34849311c183e06336a1391d2d1568a087f973f6
2012-02-23 17:08:38 -08:00
Romain Guy
96ebc6b509 Only copy paths, paints and shaders when we need to.
Change-Id: Iba7a9c92c865f698821b6ff7bc4f502659642ac1
2012-02-21 18:32:32 -08:00
Romain Guy
c27cc01f6a Prevent AutoCompleteTextView from opening a popup when it shouldn't
Bug #5553515

The People app is forcing ACTV to show the IME which had the side effect
of showing the drop down popup. ACTV was unfortunately not ready to show
the drop down if the filtering resulted in no results. Doing so was putting
ACTV in a weird state that in turn caused a window to be leaked and really
bad behavior to occur in the lower graphics levels.

Change-Id: I2ff146d5ae4e4a28edf6ea17039c9f8fdb710e4f
2012-02-15 18:34:37 -08:00
Romain Guy
967e2bf3ac Preliminary support for clipRect(Rect, Op)
This adds basic support for clip regions. It is currently disabled at compile
time. Enabling clip regions will require setting up a stencil buffer.

Change-Id: I638616a972276e38737f8ac0633692c3845eaa74
2012-02-07 17:04:34 -08:00
Romain Guy
211370fd94 Add optional metadata to initiliaze the render threat.
The render threat is likely to break your application if you initiate it.
As such it must be explicitely requested using the following meta-data
tag in your manifest's application tag:

<meta-data android:name="android.graphics.renderThread" android:value="true" />

Change-Id: Ibf0a48af2a0d091562bf6907eac970e3d1d601c4
2012-02-01 16:10:55 -08:00
Romain Guy
5ff9df6582 Add full support for Canvas.setDrawFilter()
Change-Id: I0ad35d0603c4eeda469014803be14c1dcdde918c
2012-01-23 17:09:05 -08:00
Romain Guy
f9d9c065ed Deprecate unused APIs
Change-Id: I0107e246b632dda96b8b025217936954f1f46283
2012-01-19 17:16:38 -08:00
Romain Guy
671d6cf460 Full support for Canvas.drawPosText
This also introduces a small optimization when rendering text.

Change-Id: Iff620ac97bf878eaac406bccc6daa07052c93890
2012-01-18 18:00:12 -08:00
Romain Guy
62b6eaa7f3 Fix text encoding when drawing with drawPosText in software
Change-Id: I0cd8ee526189c38c50953a1a08b50e0b31c55d8c
2012-01-17 14:53:26 -08:00
Romain Guy
5e7c469c7a Make sure 9patches are not filtered when not necessary
Bug #5383406

Change-Id: I061c8069a4d9f4eaf45671283710b564639eeb32
2011-10-20 20:33:07 -07:00
Romain Guy
a9dc86b21d Correctly apply transforms when getting a TextureView's bitmap
Bug #5439406

Change-Id: I271a9a2e38f5b3600dc158f8f442a6b0893f472b
2011-10-11 14:06:21 -07:00
Romain Guy
2a9fa89643 Don't build display lists for views with a layer.
This could cause the draw() code of views to be invoked too often
or worse, called with the wrong canvas. For instance, a view backed
by a software layer could get its draw() method called to record a
display list. Using a software layer is the recommended way to use
drawing operations not supported in hardware. Since we would
sometimes call the draw() method with the hardware backend anyway,
the app could crash by executing an unsupported operation.

Change-Id: Ib5f9a3a4c6f3efff5e0162ecd73d2dffe06e30a6
2011-09-28 16:50:02 -07:00
Romain Guy
407ec78b82 Add OpenGL backend to ImageWallpaper
Bug #5204874

Currently disabled.

Change-Id: I5e7b35dce2981b0691f107e39c6394b260466543
2011-08-24 17:06:58 -07:00
Romain Guy
302a9df1d5 Add an API to set the transform on a TextureView's surface texture.
Bug #5156689

Change-Id: I635a625885c9b832a60d44ece0de7613ceb84109
2011-08-16 13:55:02 -07:00
Grace Kloba
402f055303 Add a return value for SurfaceTextureListener#onSurfaceTextureDestroyed.
If returns true, the SurfaceTexture will be released by TextureView.
If returns false, the client needs to release the SurfaceTexture.

Change-Id: I946f71e337ad4170c168854ac27e028b82489c8c
2011-08-09 18:47:17 -07:00
Romain Guy
bd496bc3d4 Paint style and stroke width affect text rendering.
Bug #5112207

Change-Id: Ic34037ace21a5058ba23dd15e51aae58c998454d
2011-08-02 17:32:41 -07:00
Romain Guy
0965a3244b Allow Canvas.setBitmap() to receive a null Bitmap.
Change-Id: I6096f0b44866e532ccd96a29c816bf34d48c1dc2
2011-08-01 17:39:21 -07:00
Romain Guy
b50149825f Correctly apply linear filter to drawBitmap(Rect, Rect)
Change-Id: I1049282e1996b1020c92cb7bec46e9f28e94e967
2011-07-28 15:40:47 -07:00
Romain Guy
7eabe55db6 Add looper profiling to adb shell am
To profile the looper, run the following command:

adb shell am profile looper start <process> <file>
adb shell am profile looper stop <process>

Change-Id: I781f156e473d7bdbb6d13aaffeeaae88bc01a69f
2011-07-21 14:56:34 -07:00
Romain Guy
3c2c9e4e0d Update TextureView.lockCanvas() test.
Change-Id: Ib0f613fcd6ba64a696936e4e2b386b96d76b828a
2011-07-18 17:45:04 -07:00