1761 Commits

Author SHA1 Message Date
John Reck
a08f6a66e9 Merge "Fix GL_INVALID_OPERATION in font renderer when font cache is limited." 2015-04-10 15:32:01 +00:00
John Reck
d56e087b55 Merge "Fixing memory leak in RenderBufferCache" 2015-04-10 15:27:02 +00:00
Chris Craik
82f6b16e10 Merge "hwui : fix memory leak due to duplicate in shadow cache" 2015-03-25 16:15:12 +00:00
youngmin0822.lee
c80c9ad188 Don't create unnecessary RenderThread's instance when executing 'dumpsys gfxinfo'
To obtain the gfxinfo for each process, the static method of RenderProxy is used, which is named outputLogBuffer().
In there,
1. RenderTask is created for getting DisplayList Commands in RenderNode.
2. staticPostAndWait() is called
3. RenderThread's instance is created by 'RenderThread::getInstance()' in staticPostAndWait()

In case of the service, they don't use HW Acceleration, so don't need RenderThread.
But, by the process of No.3, RenderThread is created for all process.
As we know, RenderThread never be destroyed while the process is alive.
This patch checks RenderThread instance before the creation of RenderTask.
And, there is no one, just return to prevent the unnecessay creation of it.

Change-Id: I4fe29d83c9ced3e8b67177c0874c5d8ee62e1870
2015-03-20 21:22:32 +09:00
Mykola Kondratenko
b159633aa3 hwui : fix memory leak due to duplicate in shadow cache
New ShadowTask with the ShadowDescription key that already
exists in the shadow LruCache will leak as it is not being
added.

Fix adds check for the existing key that is common in the hwui
code but missing for the TessellationCache::precacheShadow
function.

Change-Id: I37fd5ec82f8b8da5d1ec0f2ab9fd04c5f8534367
2015-03-17 08:57:41 +01:00
John Reck
c7e6b93aba am af6eaf65: Merge "Fix ANR caused by hwuiTask thread" automerge: 5ad36d4
* commit 'af6eaf656ec0de5fcbea03968daffe2c845e2089':
  Fix ANR caused by hwuiTask thread
2015-02-04 22:08:27 +00:00
John Reck
5ad36d4591 Merge "Fix ANR caused by hwuiTask thread" 2015-02-04 21:53:48 +00:00
John Reck
fe5ac4fc31 am 5f3e21ce: am 6efc3ac6: Merge "Allow ~Layer() to happen after onGLContextDestroyed" into lmp-mr1-dev
* commit '5f3e21cebeecf042e8e18a5021b3965415d9ff60':
  Allow ~Layer() to happen after onGLContextDestroyed
2015-01-29 20:28:08 +00:00
John Reck
57998017ff Allow ~Layer() to happen after onGLContextDestroyed
Bug: 19146354
Change-Id: I9e885936168bd541bfbed4064ad67ab524f58e32
2015-01-29 10:17:57 -08:00
Yabin Cui
3a10a672f0 am f7049289: am 3812e68e: Merge "kill HAVE_PTHREADS."
* commit 'f70492898b3efa3c5f480f195062fa6f293bc764':
  kill HAVE_PTHREADS.
2015-01-27 07:04:55 +00:00
Yabin Cui
1610486d37 kill HAVE_PTHREADS.
Bug: 19083585
Change-Id: Ib466949bb6cd6d1bbc4680e989f0f9fae62ca564
2015-01-26 22:32:38 -08:00
Chris Craik
a2e1630b1e am 996d3974: am ed35f5c7: Merge "Fast loadInverse() implementation for the common case"
* commit '996d39743a73cc37fb888779d52323743f50c666':
  Fast loadInverse() implementation for the common case
2015-01-16 18:07:23 +00:00
Romain Guy
e4998e1ea9 Fast loadInverse() implementation for the common case
Most matrices used by the UI toolkit are translation matrices, whose
inverses can be quickly computed by using the negated translation
vector.

Change-Id: I54a28a634a586085779bfc26f3a4160cd5ab2b22
2015-01-15 16:49:18 -08:00
John Reck
cefeb34e48 am 2c9f86aa: am 53af1cd3: Merge "Vsyncs are hard" into lmp-mr1-dev
* commit '2c9f86aa21b8d7ea6a77eaca9a49ccdb31245129':
  Vsyncs are hard
2015-01-15 01:39:50 +00:00
John Reck
a22c9b2cd1 Vsyncs are hard
Bug: 18866485
Change-Id: I7d304df0f20a3296956cb6887a72adba9243f117
2015-01-14 10:40:15 -08:00
Sangkyu Lee
c3c58e015f Fix ANR caused by hwuiTask thread
If hwuiTask thread is exited while HWUI renders something,
some tasks can remain unfinished forever.
This can make ANR problem if RenderThread waits this kind of tasks.

According to the current implementation, hwuiTask threads are
exited when HWUI receives trimMemory() callback with level >= 20
and some applications such as SystemUI can receive trimMemory()
with level >= 20 even though they renders something yet.
(For instance, when RecentsActivity in SystemUI is finished,
HWUI receives trimMemory() callback with level >= 20
but SystemUI should still render the status bar and navigation bar.)

This patch prevents the tasks from remaining unfinished and
make the tasks executed immediately if they cannot be added
to their TaskProcessors.

Change-Id: I5bd26439aa5f183b1a7c1ce466362e27554b4d16
2015-01-12 13:10:52 +09:00
John Reck
ed3c2962be am 165fb8f5: am f89dac47: Merge "Tweak RT-animator scheduling" into lmp-mr1-dev
* commit '165fb8f5aa0709a8dc35f99a9b81f6906452a648':
  Tweak RT-animator scheduling
2014-12-19 23:21:44 +00:00
John Reck
a733f89c05 Tweak RT-animator scheduling
Bug: 18226391

The issue occurs as a result of a dispatchFrame itself
taking longer than 12ms, the alloted budget. The result
is that a vsync request (which occured at the end) would
miss the vsync that occured 1ms prior to the end of the frame.
As a result it would end up waiting for the following vsync,
essentially dropping to 30fps even though 60 could have been
sustained.

Fix this with a few tweaks.
First, adjust the UI thread's delay bias from (now + 4ms) to
(vsync + 4ms), this prevents RT animators from slowly drifting
if the vsync occurs mid-task.
Second, request a vsync preemptively prior to running callbacks.
This way if any callbacks needs the next vsync and it takes
"too long", we will catch that vsync.
Finally, fix an issue where the display event queue was always
drained & rejected at the end of a task loop. Instead, drain
and reject all stale vsyncs. This still prevents the issue of
both UI thread & RT thread trying to drive 2 frames in a single
pulse, but also allows RT to notice that it missed a vsync
pulse it needed and that it should speed-up a bit in response

Change-Id: I9d6be037737e9283297898cac2e3563453e797cd
2014-12-19 11:37:21 -08:00
Chris Craik
fd461edee0 am 93492d1a: am c748832f: Merge "Revert overdraw avoidance visualization change" into lmp-mr1-dev
* commit '93492d1a478770783abab764855c8d47e0264f71':
  Revert overdraw avoidance visualization change
2014-12-17 22:17:21 +00:00
Chris Craik
c748832f75 Merge "Revert overdraw avoidance visualization change" into lmp-mr1-dev 2014-12-17 22:07:04 +00:00
Chris Craik
ef8d6f272a Revert overdraw avoidance visualization change
bug:18787324

Partial revert of 23d307c8d88f4a3849163b9e5b7cd11d0d4f372c.

Change-Id: Ic8b91b046707fc5b8fa53c35ea7b37bb19c3c943
2014-12-17 11:21:02 -08:00
John Reck
f088c349df Fix style
Change-Id: I7227b0eac126bf470ed50249a7809b845872983b
2014-12-12 09:49:29 -08:00
John Reck
ec9b598c7b am b9a4d15d: Merge "Force-flush state sync on texid change" into lmp-mr1-dev
automerge: b21a7ad

* commit 'b21a7ad02e43900ea5480e796cb1518bd5829e3f':
  Force-flush state sync on texid change
2014-12-12 04:27:14 +00:00
Chris Craik
3f454e7d1c am 63c7b246: Merge "Correct layer size formatting in trace" into lmp-mr1-dev
automerge: 00905a9

* commit '00905a984c07ffc9960ce83548631c59aae37ec6':
  Correct layer size formatting in trace
2014-12-12 04:25:43 +00:00
John Reck
b9a4d15d09 Merge "Force-flush state sync on texid change" into lmp-mr1-dev 2014-12-11 22:44:19 +00:00
Chris Craik
63c7b24645 Merge "Correct layer size formatting in trace" into lmp-mr1-dev 2014-12-11 22:43:18 +00:00
Chris Craik
c2379070a4 Correct layer size formatting in trace
bug:18722704
Change-Id: Icef9aaa62633b2d86ad250f43d4c8fa5cc0b6842
2014-12-11 14:29:51 -08:00
John Reck
9a7fe1a034 Force-flush state sync on texid change
Bug: 18718646

Caused because the Texture object thought the GLES texture
was in a different state than it was as it persists across
EGL/GL contexts. Fix this by force-flushing the default
values when the texid has changed.

Change-Id: I264bac9a2beb08df8e2ba8a85ad15f0dd1fce22a
2014-12-11 14:27:39 -08:00
John Reck
d67bb5015f am eb2dcc79: Merge "Don\'t preload textures for AssetAtlas" into lmp-mr1-dev
automerge: e4a6ed9

* commit 'e4a6ed9d6d8721c9fad018b0d43dfe7daf4b24e7':
  Don't preload textures for AssetAtlas
2014-12-11 01:25:54 +00:00
John Reck
eb2dcc791e Merge "Don't preload textures for AssetAtlas" into lmp-mr1-dev 2014-12-11 01:12:31 +00:00
John Reck
ebd52610cf Don't preload textures for AssetAtlas
Bug: 18317479

RenderNode::prepareSubTree calls prefetchAndMarkInUse
on every bitmapResoruce in the DisplayList. However,
this resulted in textures being uploaded for bitmaps
that would be drawn from the AssetAtlas instead.

To fix this we teach TextureCache about the AssetAtlas
so that calls to TextureCache return the Texture from
AssetAtlas if it exists. Thus usage of AssetAtlas
is now purely to allow for further optimizations via
draw merging instead of a requirement to get
any benefit at all.

Change-Id: I65282fa05bac46f4e93822b3467ffa0261ccf200
2014-12-10 17:07:41 -08:00
Chris Craik
5369b76963 resolve merge conflicts of ed211b9 to lmp-mr1-dev-plus-aosp.
Change-Id: Ib9d6d301282bbaae6b23b9ce07b9e6a4e9075991
2014-12-10 15:23:54 -08:00
Chris Craik
4ac36f80be Fix frame-allocated path lifecycles
bug:18667472

Previously, we were allocating per-frame temporary paths within the
PlaybackStateStruct, but these are not safe as layers allocate these
transiently. Instead, move these to the OpenGLRenderer, which has
better define lifecycle.

Additionally, don't store SkPath objects directly in vector, since
they are then subject to relocation.

Change-Id: I8187ef542fcd5b030502bb75eb123ee26c0daa96
2014-12-10 12:27:08 -08:00
John Reck
3bae94d78e resolved conflicts for merge of fe11126d to lmp-mr1-dev-plus-aosp
Change-Id: I60bf82ff71d9af0d80e7da8856efb4641c85885b
2014-12-09 15:38:38 -08:00
John Reck
4f1942d999 Merge "Teach AssetAtlas about more drawables" into lmp-mr1-dev 2014-12-09 23:12:42 +00:00
John Reck
dad7d84c04 Teach AssetAtlas about more drawables
Bug: 18317479

Change-Id: I16868ee204d24af72af9a2efc987f7e9eb1d266b
2014-12-09 14:18:33 -08:00
Derek Sollenberger
1f78b3364f am 497499b1: am 04c2bf4f: Merge "Remove unnecessary/erroneous reference counting" into lmp-mr1-dev
* commit '497499b1eb76726090ea46dcfc5b8ab0221cd447':
  Remove unnecessary/erroneous reference counting
2014-12-09 22:18:33 +00:00
Derek Sollenberger
ee648e517f Remove unnecessary/erroneous reference counting
The SkBitmap* used by HWUI holds a reference to the PixelRef (which
in turn holds the colorTable) so keeping an additional ref is not
only unnecessary, but also potentially problematic.

If a bitmap changes its pixelRef after it has been added to a displayList,
then we end up with unbalanced ref/unref calls that cause the newly added
PixelRef to be unref'd and prematurely deleted, while the original PixelRef
is leaked.

bug: 18659976
Change-Id: I34a06152e7bb2d733249a207dafd36b9b5dc0712
2014-12-09 18:36:42 +00:00
John Reck
a75b0ad384 resolved conflicts for merge of a51a0901 to lmp-mr1-dev-plus-aosp
Change-Id: Id7df835f0bd3d5d276b162635ddfb7fe0918dfed
2014-12-04 13:41:04 -08:00
John Reck
01a5ea35fb Resume RT-animations after a pauseSurface
Bug: 18203577

The issue occurs as a result of performTraversals() both doing
a window relayout call *and* early-returning because it's not dirty.

To fix this pauseSurface() returns whether or not the RT-side is
"dirty" to force ViewRootImpl to do a draw even if mDirty is
otherwise empty.

Change-Id: I534f367e75d18d273ebf14df3927f5c464ef6bef
2014-12-03 13:03:59 -08:00
Chris Craik
a22ab0da6f am 9a04480e: am ef124887: Merge "Clip outline to View clip bounds for shadow computation" into lmp-mr1-dev
* commit '9a04480e36c42eb63d1d727221ba3ce6a6d533ef':
  Clip outline to View clip bounds for shadow computation
2014-12-02 01:39:20 +00:00
Chris Craik
ef124887c6 Merge "Clip outline to View clip bounds for shadow computation" into lmp-mr1-dev 2014-12-02 01:27:26 +00:00
Chris Craik
faa79ff9d9 Clip outline to View clip bounds for shadow computation
bug:18509823

This allows animations of View clipBounds (and other callers of
setClipBounds) to affect shadows, instead of leaving them floating.

Change-Id: I249fa4b371a170cb0c54001f5b0e0097e109b8b8
2014-12-01 15:47:10 -08:00
John Reck
76de89820c Merge "Prevent calling GL functions with an invalid surface" into lmp-mr1-dev 2014-12-01 22:39:31 +00:00
John Reck
d7af6eaace am d51205fd: am 6afc5cf3: Merge "Prevent calling GL functions with an invalid surface"
* commit 'd51205fda7351ca32e54ef34b32e72f6c7c79847':
  Prevent calling GL functions with an invalid surface
2014-12-01 21:40:32 +00:00
Sangkyu Lee
a12b2405df Prevent calling GL functions with an invalid surface
Bug: 18518580

When destroying CanvasContext, the surface can be invalid
state. So the surface should be updated to null prior to
destroying GL resources to ensure that GL functions
are not called with an invalid surface.
Some GL implementation makes an error if GL functions
are called with an invalid surface. (Adreno 3xx)

Cherry picked from AOSP: f76d36f96bf221672e98e440c9df7cbf0e02e84e

Change-Id: Ie6f6ea081ec931fc9df30b2c3ed066ec1ae9d294
2014-12-01 21:38:34 +00:00
John Reck
6afc5cf3d9 Merge "Prevent calling GL functions with an invalid surface" 2014-12-01 21:28:27 +00:00
Chris Craik
659de832b9 Merge "Enable stencil clipping within clearLayerRegions" into lmp-mr1-dev 2014-12-01 20:08:29 +00:00
Chris Craik
e986817a2d am 6eac26a4: am ca84c8b1: Merge "Revert "Force-use the pbuffer surface for destroy"" into lmp-mr1-dev
* commit '6eac26a49957eda233ad22ad75da43379f220bbc':
  Revert "Force-use the pbuffer surface for destroy"
2014-11-26 21:02:24 +00:00
Chris Craik
ca84c8b1b0 Merge "Revert "Force-use the pbuffer surface for destroy"" into lmp-mr1-dev 2014-11-26 20:50:10 +00:00