1616 Commits

Author SHA1 Message Date
John Reck
733bb3bc78 Merge "Fix memory corruption in test" into lmp-mr1-dev 2014-10-22 14:18:21 +00:00
John Reck
bb2d0cc7e1 Surface:lockHardwareCanvas
Bug: 17440886

Change-Id: I1f2d98c63ec1a2814c2258cf7e0096139263770a
2014-10-21 13:23:56 -07:00
John Reck
af608319f2 Fix memory corruption in test
Bug: 18012918
Change-Id: I8d69624e9be9f0399ddba10ce3903f93177d5930
2014-10-16 09:18:11 -07:00
John Reck
94c40fe921 CARD LAND!
Bug: 16712006

Initial work towards benchmarking HWUI systems
Currently this will just create a screen full of
"cards" to simulate a high load scenario for
shadows and clipping

Change-Id: Ie9f9a9570844e136db8053e8fc62fe06cb922a5f
2014-10-14 09:02:04 -07:00
Jorim Jaggi
786afcb3ee Trim graphics memory when closing the shade
Graphics memory usually gets trimmed in applications when the
activity goes into the background. We use quite a lot of graphics
memory when the shade/lockscreen is open, and some of them never gets
freed unless the recents activity is closed, because we don't have
these activity-trimming-heuristics for the shade. This change
proactively trims the graphics memory when the shade gets closed or
when the lockscreen is hidden, to emulate the same heuristics as for
activities.

This change also adds trimMemory on RenderThread to systrace to
verify that no jank is introduced with this change.

This change immediately saves around 10-30 MB on an xxhdpi device
after the shade is closed.

Bug: 17581375
Change-Id: I4fb622efb51815fe08187be97ba15d012d4de5d4
2014-10-08 18:30:54 +00:00
ztenghui
8cdb0bc087 Merge "Use float instead of double to increase spot shadow perf" into lmp-mr1-dev 2014-10-06 20:04:08 +00:00
John Reck
6a2296d856 am 9da6e743: am d988a45d: Merge "Cleanup DeferredLayerUpdater" into lmp-dev
* commit '9da6e7435945e34d05e0c8c5c9a324218480c6ff':
  Cleanup DeferredLayerUpdater
2014-10-03 23:57:30 +00:00
ztenghui
9122b1b168 Use float instead of double to increase spot shadow perf
This is helping spot shadow for 15%-20% increase.
With the new algorithm, we are less sensitive to the floating point error.

b/16712006

Change-Id: Ie30a6ce01e73d56054a0cf65a84549454339a7fd
2014-10-03 15:30:53 -07:00
John Reck
749906b468 Cleanup DeferredLayerUpdater
Bug: 17765082

DeferredLayerUpdater had fallen behind RT updates. Re-snap to
latest expectations, ensuring to call requireGlContext() prior
to detachSurfaceTexture to avoid leaking SurfaceTextures

Change-Id: Ic65fb9831e5284f658866da8da9ad5af1d227699
2014-10-03 15:02:19 -07:00
Chris Craik
497cb6c0a9 Merge "Avoid creating Caches instance with gfxinfo dump" into lmp-mr1-dev 2014-10-02 20:02:43 +00:00
Chris Craik
59e129fbc8 Merge "Account for colorfilter transparency in determining paint opacity" into lmp-mr1-dev 2014-10-02 19:28:09 +00:00
ztenghui
5f243860a7 am 9ad17521: am f9033048: Merge "+ correcting shadow visual appearance (b/17610926)" into lmp-dev
* commit '9ad17521ac073562991cddb78f14d6df8d5fd05a':
  + correcting shadow visual appearance (b/17610926)
2014-10-01 23:41:00 +00:00
Chris Craik
c5b5f0556b Account for colorfilter transparency in determining paint opacity
bug:17765601
Change-Id: I90d76ee199bb357c71fc8f537c1abfa20d848416
2014-10-01 16:40:16 -07:00
ztenghui
8def74de33 + correcting shadow visual appearance (b/17610926)
+ adjusting spot and ambient shadow opacity constants to achieve desired appearance
+ reducing ambient scale ratio back to 1.0 to address over-lightening at higher elevations
+ partially revert ag/546290

Change-Id: I9d7f664f73a7b9b83df73b739103c97054bd4f6e
2014-10-01 16:12:28 -07:00
Chris Craik
059476a245 Avoid creating Caches instance with gfxinfo dump
bug:17509891
Change-Id: I182851068ba04926d60226b3ace95efea59eac45
2014-10-01 11:14:55 -07:00
Chris Craik
a8bea8edde Add tracing for saveLayer
bug:17702227

Change-Id: Ia9cbf31b360c93f712e021bea406cb63e4cc4c2a
2014-09-29 17:19:05 -07:00
Chris Craik
bc341912b1 Reject transparent draws more conservatively
bug:17600162

Transparent draws are not safe to reject for all xfermodes other than
clear. Now, to be safe, only perform the rejection for SrcOver draws
since other modes are fairly uncommon.

We could specifically determine whether the xfermode could change the
output given a transparent input, but there's little to be gained from
the additional complexity.

Change-Id: Ia699ac4bdc4da3353955840b53f1922d3cb1d85d
2014-09-23 01:22:00 +00:00
Chris Craik
9e7c919191 Merge "Account for alpha in hasShadow()" into lmp-dev 2014-09-19 23:36:22 +00:00
Chris Craik
9fa364dc72 Account for alpha in hasShadow()
bug:17587220
Change-Id: Ic7f2dea95302b713dc93edb4a0193a7be77fb2eb
2014-09-19 16:04:45 -07:00
John Reck
6cc6219f6f Merge "glFinish to flush deletes" into lmp-dev 2014-09-19 17:22:17 +00:00
John Reck
4ced2620b7 glFinish to flush deletes
Bug: 17479800
Change-Id: I4d4a3eeda510e037f806052025184f3cde18c847
2014-09-19 10:10:19 -07:00
Chris Craik
651486d018 Merge "Fix garbage showing up beneath dialogs" into lmp-dev 2014-09-19 15:31:18 +00:00
Chris Craik
284b243584 Fix garbage showing up beneath dialogs
bug:17463894

Fixes the setViewport method to immediately affect the return values
of getViewportWidth/Height methods.

Also works around tiling extension issues observed on first frame
after window resize by disabling tiling for that frame.

Change-Id: Ie172d572d20d74a1be9cc58ad389af2cffa0e4b6
2014-09-18 16:05:35 -07:00
John Reck
f16b4940e6 Merge "Special case EGL_BAD_SURFACE" into lmp-dev 2014-09-17 23:30:44 +00:00
John Reck
2cdbc7d228 Special case EGL_BAD_SURFACE
Bug: 17516789

Change-Id: I3dcb10360c2aef6326f7dbbff6815866d4c143b6
2014-09-17 16:09:57 -07:00
John Reck
5083943ff8 Merge "Change default fbo cache size to 0" into lmp-dev 2014-09-17 21:35:02 +00:00
John Reck
e9cd97ee88 Change default fbo cache size to 0
Bug: 17479800

 FBO cache is very expensive and no longer necessary, disable
 it by just setting size to 0.

Change-Id: I664616f262c8339919e1d20baaafa5de2b628d7e
2014-09-17 14:09:26 -07:00
Chris Craik
73821c8d2b Handle premultiplication correctly for ColorMatrixColorFilters
bug:17405627

Previously, the input content to the color matrix computation was left
premultiplied. Since the color matrix could reduce the alpha channel,
the alpha was re-multiplied, but this was incomplete, and incorrect.

Instead, apply the color matrix in unpremultiplied space.

Change-Id: I87b8e03d2e228e6ded81f7bbfea952605d7a095c
2014-09-17 10:00:34 -07:00
Jorim Jaggi
072707dfad Use RenderThread for navigation bar ripples
Bug: 17506181
Change-Id: Icf3b80f8c4bc29fe85313381d4019dda3ef85ea9
2014-09-16 17:51:55 +00:00
Chris Craik
025207b3cf Merge "Force isolation of clip and matrix within layer" into lmp-dev 2014-09-15 15:59:57 +00:00
Chris Craik
4ace730560 Force isolation of clip and matrix within layer
bug:17379260

Unclipped save layers need to isolate their clips and matrices
so that the save time readout of background content matches clip and
position with the restore/compose step.

Change-Id: I2de474cda76e960d080852f1716d6ddfa8a512d4
2014-09-14 15:49:54 -07:00
Chris Craik
2f25901632 Merge "Correctly initialize animator asynchronousity" into lmp-dev 2014-09-13 00:46:11 +00:00
Chris Craik
572d9acd59 Correctly initialize animator asynchronousity
bug:17483792
Change-Id: Icb6b6e6318d4c79ee94228806cb60b275424b9c9
2014-09-12 17:40:20 -07:00
ztenghui
692737be4f Merge "Update the shadow strength" into lmp-dev 2014-09-12 23:02:32 +00:00
ztenghui
f7d76dffd8 Update the shadow strength
b/17486691

Change-Id: I8e8f0b64e757772c18f038f6b329ef91a4e155a5
2014-09-12 15:29:44 -07:00
Chris Craik
1aec711b2e Merge "Disable layer leak tracking" into lmp-dev 2014-09-12 17:41:13 +00:00
Chris Craik
21029ef131 Disable layer leak tracking
bug:17208461
Change-Id: Ibbdf3ec79c4fd19e1935a559d425d074b611e162
2014-09-12 09:29:31 -07:00
Chris Craik
4340c260c0 Snap outline clipping to integer coordinates correctly
bug:17403105
Change-Id: I65b5d7103aac58ba6feb4b021c276c67e9341716
2014-09-11 18:58:45 -07:00
ztenghui
24a95a10db Merge "Finer tessellation can draw better looking shadows for circles." into lmp-dev 2014-09-11 21:09:51 +00:00
Chris Craik
5be52c11d9 Merge "Update HWUI paint filter to understand new location of skia bitmap filter preference" into lmp-dev 2014-09-11 19:43:52 +00:00
Chris Craik
591be6c7af Update HWUI paint filter to understand new location of skia bitmap filter preference
bug:17455286
Change-Id: I3b0e04833f0c2699a1322fdd7e98c155841c0d93
2014-09-11 12:16:38 -07:00
ztenghui
25e5a02d1c Finer tessellation can draw better looking shadows for circles.
b/14976551

Change-Id: I4b9e320b025dbee37cd1893881ddbaad62e3a6e2
2014-09-11 10:10:25 -07:00
ztenghui
ca517b97e0 Merge "Re-triangulate the spot shadow." into lmp-dev 2014-09-11 16:32:05 +00:00
ztenghui
512e643ce8 Re-triangulate the spot shadow.
Fix the valid umbra detection.

This looks better b/c every vertex will have one ray shooting at it, such that
we don't miss the corner.

This performs better too, due to the polygon intersection is removed and less ray
intersection. 2x performance for rect and circle for spot shadow in test app.

    b/17288227
    b/15598793
    b/16712006

Change-Id: I4a5ee397b9e192e93c8e35e6260b499e3e38a6f4
2014-09-10 17:05:59 -07:00
Chris Craik
bfd1cd6209 Additional layer logging
bug:17208461

Track layer's last known state.

Change-Id: Ic1799191f5839a1d6cc56f598f2ac2671dc27a6f
2014-09-10 16:10:24 -07:00
Chris Craik
b2201151f3 Merge "hwui: Caches: use mBoundTextures only for GL_TEXTURE_2D" into lmp-dev 2014-09-09 20:03:09 +00:00
Fred Fettinger
70735bd5dd hwui: Caches: use mBoundTextures only for GL_TEXTURE_2D
bug:17441218

GLConsumer uses glBindTexture() directly instead of going through
Caches::bindTexture(). This can cause libhwui to draw with the wrong
texture bound in the following case which involves 2 TextureViews:

Frame 1:
GLConsumer::updateTexImage() calls glBindTexture(GL_TEXTURE_EXTERNAL_OES, 1)
HWUI renders TextureView A:
    calls Caches::bindTexture(GL_TEXTURE_EXTERNAL_OES, 1) and draws

Frame 2:
GLConsumer::updateTexImage() calls glBindTexture(GL_TEXTURE_EXTERNAL_OES, 1)
GLConsumer::updateTexImage() calls glBindTexture(GL_TEXTURE_EXTERNAL_OES, 2)
HWUI renders TextureView A:
    calls Caches::bindTexture(GL_TEXTURE_EXTERNAL_OES, 1) and draws
HWUI renders TextureView B:
    calls Caches::bindTexture(GL_TEXTURE_EXTERNAL_OES, 2) and draws

In this case, HWUI will incorrectly draw TextureView A using texture 2 on
frame 2, because mBoundTextures[0]=1, even though the texture currently
bound to GL_TEXTURE_EXTERNAL_OES is 2.

Since GLConsumer is always used with a target of GL_TEXTURE_EXTERNAL_OES,
work around this problem by having mBoundTextures[] store only the
textures bound to the target GL_TEXTURE_2D. This is the common case
where the extra performance is needed. Since it's legal to have
different textures bound to GL_TEXTURE_2D and GL_TEXTURE_EXTERNAL_OES
on one texture unit, Caches::bindTexture() does not need to clear
mBoundTextures[mTextureUnit] when target != GL_TEXTURE_2D.

Change-Id: I8bc54ab8adcfacad7f3ed17a31236dc7a86c967a
Signed-off-by: Fred Fettinger <fred.fettinger@motorola.com>
2014-09-09 20:00:52 +00:00
Chris Craik
69fb8a2399 Merge "Fix tessellation bounds computation" into lmp-dev 2014-09-09 18:34:08 +00:00
Chris Craik
21bcfc4ff8 Fix tessellation bounds computation
bug:17401066

Now correctly accounts for scale, both in hairline case (where scale
needs to be accounted for), and in standard case (where scale
shouldn't be applied, since bounds are in local space)

Change-Id: I597a20834dce42ddb741b46e4c1a4f3169a48ccc
2014-09-08 18:43:30 -07:00
Chris Craik
8a226d24b8 Don't track TextureLayer lifecycles in RenderState
bug:17208461

They are destroyed via finalizer-enqueued destroy method, so it's not
valid to check that they've been destroyed at gl context destruction
time.

Change-Id: I670f69825547facd5f31d44acb406418881fee00
2014-09-08 16:44:47 -07:00