4625 Commits

Author SHA1 Message Date
Romain Guy
98ba89492a Make gradients look slightly better
Change-Id: Ib12c628a88b9ec6af1214ce6e5cb14cfde40485e
2012-07-20 16:58:45 -07:00
Raph Levien
00755fed35 Merge "Add drop shadow for drawPosText in hwui renderer." 2012-07-20 14:24:20 -07:00
Raph Levien
416a847633 Add drop shadow for drawPosText in hwui renderer.
This patch adds support for drop shadows (setShadowLayer) for
drawPosText in the hwui renderer. In and of itself, it's not very
important, but it's on the critical path for correct mark positioning,
tracked as bug 5443796.

The change itself is fairly straightforward - it basically just adds an
extra "positions" argument to all draw and measure methods on the code
path for drawing drop shadowed text, as well as to the cache key for
cached shadow textures.

Change-Id: Ic1cb63299ba61ccbef31779459ecb82aa4a5e672
2012-07-20 12:55:30 -07:00
Romain Guy
8dcfd5e836 Clamp gradient textures to max GL texture size
Change-Id: I8ce4e50988f5194fe5ce4bde7945ec01673af3cd
2012-07-20 11:47:57 -07:00
Romain Guy
0aa87bbfc4 Fix crash with new LookupGammaFontRenderer
Bug #6853934

Change-Id: I15e6ca73bfe00eff1a37c4b9d2f7f709ee018eb6
2012-07-20 11:14:32 -07:00
Romain Guy
eb61cd8296 Optimize gradient textures
Compute the size of the backing textures based on the maximum possible
number of shades in the gradient.

Change-Id: I2d7f20477d31b81e9735f2c1d83ebdd0dbcbe340
2012-07-18 20:39:45 -07:00
Romain Guy
243924b08f am 3409e728: Correctly pre-clip paths when recording display lists Bug #6836448 External bug: http://code.google.com/p/android/issues/detail?id=34946
* commit '3409e728e22609b54de8b33d1e614ca51f6d6a77':
  Correctly pre-clip paths when recording display lists Bug #6836448 External bug: http://code.google.com/p/android/issues/detail?id=34946
2012-07-18 20:14:02 -07:00
Romain Guy
6355347813 Remove vendor specific precision qualifier
Change-Id: I0a56ca7a5a399ec94993d3cea0c4aff6c0f86e39
2012-07-18 20:04:14 -07:00
Romain Guy
8e025de5fb Note to self
Change-Id: Ic5699bdbf880ad68748c827bb5b4976b12d4d413
2012-07-18 19:12:11 -07:00
Romain Guy
04299385c6 Clip lines, AA rects and points correctly
Change-Id: I900dd986f397b66f133e6021aa4c2539e7abc2b9
2012-07-18 17:15:41 -07:00
Romain Guy
dfab50d8b9 Tweak text gamma correction
Change-Id: Icd3326e6a054d6020c3ed61c8459394bc87401dd
2012-07-18 17:06:37 -07:00
Romain Guy
6e25e38e43 Add a new method for text gamma correction
To select the gamma correction method, adb shell setprop hwui.text_gamma_correction
with one of the following values:

lookup3
lookup
shader3
shader

See Properties.h for more information about these different methods.
You can also control gamma correction using the following properties:

hwui.text_gamma
hwui.text_gamma.black_threshold
hwui.text_gamma.white_threshold

Change-Id: I47970b804d2c590c37d3da5008db094241579e25
2012-07-18 16:28:44 -07:00
Romain Guy
3409e728e2 Correctly pre-clip paths when recording display lists
Bug #6836448
External bug: http://code.google.com/p/android/issues/detail?id=34946

DO NOT MERGE

DisplayListRenderer::drawPath was not invoking quickReject() properly,
passing x,y,width,height instead of left,top,right,bottom. A path
could thus get rejected when it should be drawn instead.

While working on this change I found a similar issue with another
drawing command, drawBitmapData().

Change-Id: I8306faf72db14d71b54ecb7de295c9a6957d9494
2012-07-17 18:01:51 -07:00
Romain Guy
95c21d0546 Correctly pre-clip paths when recording display lists
External bug: http://code.google.com/p/android/issues/detail?id=34946

DisplayListRenderer::drawPath was not invoking quickReject() properly,
passing x,y,width,height instead of left,top,right,bottom. A path
could thus get rejected when it should be drawn instead.

While working on this change I found a similar issue with another
drawing command, drawBitmapData().

Change-Id: I56484e8c101768cde6a78625290872f7849dd5ee
2012-07-17 17:48:04 -07:00
Romain Guy
8a4ac610e1 Don't clear the dirty clip flag if it's not applied
Bug #6833979

Change-Id: I0ea78b7f31a557a335de10d910d03b0520029080
2012-07-17 17:32:48 -07:00
Romain Guy
4121063313 Add shader-based text gamma correction
To enable it, the system property ro.hwui.text_gamma_shader must be
set to true. For testing, DEBUG_FONT_RENDERER_FORCE_SHADER_GAMMA
can be set to 1 in libhwui/Debug.h.

Change-Id: If345c6b71b67ecf1ef2e8847b71f30f3ef251a27
2012-07-16 17:04:24 -07:00
Romain Guy
157bd5749f Add makefile flags for perf
Change-Id: Ibcb6e1c883551273c3392cdaa40cd0b71a3bfa70
2012-07-16 15:17:38 -07:00
Romain Guy
be6f9dc1e7 Don't copy paints for 9patches
Change-Id: I863100a0dc53fec1a3a1b2acbdeb76e6049ffe58
2012-07-16 12:41:17 -07:00
Romain Guy
b1d0a4ed21 Refactor GammaFontRenderer
This change is the first step to a shader-based text antialias
gamma correction.

Change-Id: I9eb02d4c56cb95d05219f712290c865b46141954
2012-07-13 18:25:35 -07:00
Romain Guy
c9cf9e5459 Merge "Improve rendering speed by disabling scissor tests" 2012-07-13 15:31:30 -07:00
Romain Guy
586cae3ac6 Improve rendering speed by disabling scissor tests
This change improves execution of display lists, particularly on
tiled renderers. The goal is to disable the scissor test as
often as possible. Drawing commands are rarely clipped by View
bounds so most of them can be drawn without doing a scissor test.

The speed improvements scale with the number of views and drawing
commands.

Change-Id: Ibd9b5e051a3e4300562463805acc4fd744ba6266
2012-07-13 15:28:31 -07:00
Romain Guy
01f03dc389 am 0a386ffa: Text shadow alpha handling incorrect DO NOT MERGE
* commit '0a386ffac026e259c408b77c2dd2cc5d2e22b5f8':
  Text shadow alpha handling incorrect DO NOT MERGE
2012-07-13 13:41:00 -07:00
Romain Guy
0a386ffac0 Text shadow alpha handling incorrect
DO NOT MERGE

External bug: http://code.google.com/p/android/issues/detail?id=34879
This is a regression from ICS.

This CL also fixes a bug where a View's alpha would be applied twice.

Change-Id: I13a1546228f44d4c169259414b6fa103a6e4a0fa
2012-07-13 12:24:09 -07:00
Romain Guy
489041dd41 Merge "Text shadow alpha handling incorrect" 2012-07-13 12:21:32 -07:00
Romain Guy
9c0b188e42 Text shadow alpha handling incorrect
External bug: http://code.google.com/p/android/issues/detail?id=34879

This CL also fixes a bug where a View's alpha would be applied twice.

Change-Id: I13a1546228f44d4c169259414b6fa103a6e4a0fa
2012-07-13 12:13:07 -07:00
Romain Guy
401b1f8574 Merge "Remove obsolete optimization" 2012-07-12 18:02:37 -07:00
Romain Guy
f877308f77 Remove obsolete optimization
Change-Id: I2d43c009c62a7f4a4a2e0a6303bdfa692c4b8c8c
2012-07-12 18:01:00 -07:00
Romain Guy
f0af1d5cb2 Remove unused View.flushLayer() API
Change-Id: I5d4c7388afb5265964ab6b769cc0abfee9745c84
2012-07-11 18:31:21 -07:00
Nick Kralevich
4b447b91de Add mode when open(O_CREAT) is used.
When creating a new file using open(..., O_CREAT), it is an error
to fail to specify a creation mode. If a mode is not specified, a
random stack provided value is used as the "mode".

This will become a compile error in a future Android change.

Change-Id: I8635e8b69587ed107253870d991c3fcf563ca876
2012-06-26 15:03:38 -07:00
Romain Guy
4930649d35 am 68cefd20: Merge "Textured text calls could be invisible Bug #6597730" into jb-dev
* commit '68cefd201809372a547257a273b805cabbd0da68':
  Textured text calls could be invisible Bug #6597730
2012-06-12 12:43:36 -07:00
Romain Guy
16c8808525 Textured text calls could be invisible
Bug #6597730

Text would sometimes not appear when rendered with textured content
(BitmapShader, LinearGradientShader, etc.) This was due to a misuse
of OpenGL texture unit in FontRenderer. Textured text normally uses
two texture units:
- texture unit 0 for the font cache
- texture unit 1 for the textured content (gradient, etc.)

Recent changes to the font renderer allow it to bind new textures
while processing the text's geometry (this happens when caches get
full or when switching font size for instance.) The bindings were
done without ensuring the texture unit was the correct one
(unit 0), thus replacing the content of another texture unit
(unit 1).

This lead to text being drawn using the font cache itself as the
content texture, making the text invisible.

Change-Id: I392b4c884f09223305f6cbc6253e2ef9a98944c9
2012-06-11 16:11:56 -07:00
Chet Haase
ca43c96127 am 44b2fe3f: Track canvas clearing for swap buffers logic.
* commit '44b2fe3fc114ee5f7273c6b0fee2cc999bf244a2':
  Track canvas clearing for swap buffers logic.
2012-06-07 09:45:16 -07:00
Chet Haase
44b2fe3fc1 Track canvas clearing for swap buffers logic.
A previous fix made it necessary for a frame to render something to GL
in order to cause a call to eglSwapBuffers(). Besides the calls being
tracked as part of issuing a DisplayList, there is also a potential call
to clear the canvas (via glClear()) on non-opaque surfaces. This call is also
good to track, since a surface that gets cleared without any other drawing operations
is worth flipping to the screen (to erase old contents on that surface).

This fix tracks the status of the pre-draw operations to find out whether
glClear() was called and then sets the drawing status appropriately.

Issue #6606422 QuickContact dismissal is janky again (Tracking)

Change-Id: I5fcaccfdc9293dd46b83f2fc279730a5d2740ebf
2012-06-07 06:25:04 -07:00
Chris Craik
6d99a02464 am 8f1f714f: Merge "Revert "Add more temporary logging for investigating detachFunctor"" into jb-dev
* commit '8f1f714f831bf8bf10f94211c42e36ef2851810d':
  Revert "Add more temporary logging for investigating detachFunctor"
2012-06-06 16:47:57 -07:00
Chris Craik
932b7f6765 Revert "Add more temporary logging for investigating detachFunctor"
bug:6608646

This reverts commit 8857b2f76abad1e4ec742dfd85d0c997880be376

Change-Id: I1563b5974c52b84201ae448298f804eb0dcc235d
2012-06-06 14:02:55 -07:00
Chris Craik
34e5f5a534 am 3676b137: Merge "Add more temporary logging for investigating detachFunctor" into jb-dev
* commit '3676b137ecf2f24e88e8a3567c11234e7d4416d2':
  Add more temporary logging for investigating detachFunctor
2012-06-05 12:31:31 -07:00
Chris Craik
8857b2f76a Add more temporary logging for investigating detachFunctor
bug:6596807
Change-Id: Ic9e34e323b12a887f2e8df0773a6155627b6a64f
2012-06-05 11:24:46 -07:00
Jeff Brown
78f04a364f am 51df04b9: Port the legacy velocity tracker strategy.
* commit '51df04b93e8e362edd867abd7efaf1659b8b8b82':
  Port the legacy velocity tracker strategy.
2012-06-04 13:13:34 -07:00
Jeff Brown
ba58221769 am a5b06982: Implement a second order integrating VT strategy.
* commit 'a5b0698231459ac5b54cf8e8952ac5c2b2b2198b':
  Implement a second order integrating VT strategy.
2012-06-04 13:13:30 -07:00
Jeff Brown
2fd6baef59 am 18f329e9: Implement a weighted least squares VelocityTracker strategy.
* commit '18f329e9480fca75210bb7496e5b4bc987b4ad8f':
  Implement a weighted least squares VelocityTracker strategy.
2012-06-04 13:13:27 -07:00
Jeff Brown
51df04b93e Port the legacy velocity tracker strategy.
For comparison purposes, port the legacy velocity tracker
algorithm as it behaved prior to ICS.

Bug: 6413587
Change-Id: I7e8e56584dcdb1a3c660ca9d8f9c5bd5d868e449
2012-06-04 12:34:03 -07:00
Jeff Brown
a5b0698231 Implement a second order integrating VT strategy.
Bug: 6413587
Change-Id: I51bc7b8cbff22b10b728fc84ee15370e9984dd55
2012-06-04 12:34:03 -07:00
Jeff Brown
18f329e948 Implement a weighted least squares VelocityTracker strategy.
No change to the default strategy.

Bug: 6413587
Change-Id: I08eb6f9a511e65ad637359b55b5993c26ba93b40
2012-06-04 12:34:03 -07:00
Jeff Brown
767bc6d26c am 1fbbc071: Merge "Implement an integrating VelocityTracker strategy." into jb-dev
* commit '1fbbc0716f9b70c6dcee00c4550757077ef7f7b5':
  Implement an integrating VelocityTracker strategy.
2012-06-03 21:19:16 -07:00
Jeff Brown
7d3fa093bb am f47e76e2: Merge "Make velocity tracker strategy configurable." into jb-dev
* commit 'f47e76e2c78e78e26110786e99548d718d177c32':
  Make velocity tracker strategy configurable.
2012-06-03 21:19:13 -07:00
Jeff Brown
1fbbc0716f Merge "Implement an integrating VelocityTracker strategy." into jb-dev 2012-06-03 21:16:38 -07:00
Jeff Brown
f47e76e2c7 Merge "Make velocity tracker strategy configurable." into jb-dev 2012-06-03 21:16:18 -07:00
Jeff Brown
53dd12a668 Implement an integrating VelocityTracker strategy.
This algorithm better tolerates certain kinds of errors in the
touch input than the least squares strategy but it may underestimate
the velocity of accelerating movements.  This algorithm is
mainly of interest as a baseline for testing and comparison with the
least squares algorithm, which remains the default.

Bug: 6413587
Change-Id: I8ddb50084e44875e234717907e5b06d03f59788c
2012-06-03 19:23:58 -07:00
Jeff Brown
9eb7d86181 Make velocity tracker strategy configurable.
This change is very useful for testing purposes because it makes it
easy to compare different implementations to see how they behave.

There is no change to the current default strategy.

Bug: 6413587
Change-Id: I4d8567aa4160571ba9fa397ce419882cd9366749
2012-06-03 19:21:49 -07:00
Chet Haase
d0140062db am 561ff8a7: Merge "Skip eglSwapBuffers() call when we do not draw to GL" into jb-dev
* commit '561ff8a74e3d9ea15f58d9b6534da9ea5a63d84b':
  Skip eglSwapBuffers() call when we do not draw to GL
2012-06-01 07:32:39 -07:00