191 Commits

Author SHA1 Message Date
John Reck
3afd63778e Switch how destroyHardwareResources works
destroyHardwareResources will now only force-destroy
the specific node it was called on, which are only
ever the root nodes. Rely on onRemovedFromTree()
to clean up resources for all other nodes.

Bug: 34736819

Test: RenderNode.multiTreeValidity passes, manually
verified fixes b/34736819

Change-Id: I1c275ad6a98b63bf50f265602f09bffe3e1f169b
2017-01-30 13:29:26 -08:00
John Reck
2de950d5a8 Overhaul RenderNode's DisplayList management
* Move mValid to native
* Have destroyHardwareResources destroy everything
* Remove flaky mParentCount checks in setStaging
* All tree updates have an internal observer to
  ensure onRemovedFromTree() is a reliable signal
* onRemovedFromTree() immediately releases resources
  to avoid displaylist "leaks"

Test: Unit tests for validity added & pass, manually
verified that b/34072929 doesn't repro

Bug: 34072929

Change-Id: I856534b4ed1b7f009fc4b7cd13209b97fa42a71c
2017-01-25 12:24:40 -08:00
Matt Sarett
f58cc92066 Add overdraw debugging feature to Skia pipelines
Test: Compared to OpenGL pipeline and sanity checked
with understanding of the drawing pipeline.  Also
wrote a unit test.

BUG:32370375

Change-Id: Iab397d21f0def725fa89551d48c764c67fd2bda8
2016-11-29 18:03:40 -05:00
Derek Sollenberger
0df6209a02 Initial refactoring to enable the addition of the SkiaOpenGLPipeline.
Test: existing and new HWUI unit tests all pass.
Change-Id: I4f5c1dc839a2ed15d8b0f6245fe030684501b083
2016-10-05 15:28:27 -04:00
Derek Sollenberger
6a21ca5a4c Move Layer creation/deletion into the RenderPipeline.
Test: refactoring. existing tests still pass.
Change-Id: I032c33896a0cb74c91e2a913a584373518466b88
2016-10-03 16:30:19 -04:00
sergeyv
c3849aa786 HWUI: reimplement rendernode ouput for single stream
bug: 26565102
Change-Id: I90b449b2dce52683c50b48091354104d76a5e44a
2016-08-09 16:29:44 -07:00
Doris Liu
eba351df16 Ensure layer update include the dirty rect from AVD am: b51b2864e8 am: c0dccb9597
am: 334d32137f

Change-Id: I20bf02209a269d6bef3085ae07caade7680b065d
2016-08-03 19:46:26 +00:00
Doris Liu
b51b2864e8 Ensure layer update include the dirty rect from AVD
BUG: 30166063
Change-Id: Ia14a2fe3c653e0172a28b4ef22f5171ccf7390c1
2016-08-02 03:01:48 +00:00
Derek Sollenberger
56ad6ec42f Remove LayerRenderer.
There is only one caller each for the static functions here so this
CL moves the logic to the caller.  Also by moving some of the code
into the pipeline it makes it easier for future changes to configure
how a pipeline handles a layer.

Change-Id: Ib735b5154325cbb658fd151f7a19dbf434ab44b7
2016-07-26 13:05:13 -04:00
Chris Craik
52c4eba143 Merge \\"Avoid throwing when 0 size layer requested\\" into nyc-mr1-dev am: 272b827925
am: ec83bd15c8

Change-Id: If585ade667c888d2f5f8e90a76125971178a7ba5
2016-07-12 02:16:05 +00:00
Chris Craik
e3e481df76 Avoid throwing when 0 size layer requested
bug:30032790

Change-Id: I8553af0d0b0d59fea6535d03479c4e7134a9f4f9
2016-07-11 19:26:18 +00:00
Chris Craik
5e00c7ce06 Delete old rendering pipeline
fixes: 30002246

Change-Id: I45df0e924708526cee045b14c291bd23aa1a92db
2016-07-07 15:53:50 -07:00
John Reck
aa6e84f21d Move SurfaceView offscreen if the app stops drawing it
Bug: 29360411
Change-Id: Iefb9d7a9dafb34a2b4f79130a2a8b5a7cf7de906
2016-06-17 10:23:54 -07:00
Doris Liu
07c056d627 Chcek for valid render content before damaging RenderNode for dirty VD
BUG: 29320878
Change-Id: I847d76467bad92c956a4bb7617627983d64e90f9
2016-06-13 12:52:44 -07:00
Chris Craik
bc640cb016 Merge \"Fix framebuffer incomplete errors\" into nyc-dev
am: 4bcf66030d

Change-Id: If578de7d7ea10cceb0e19eb68e305432e4177d04
2016-06-10 16:08:44 +00:00
Chris Craik
d4fe4d3b30 Fix framebuffer incomplete errors
bug:29127615

Primarily fixes case where 0 dimensioned layers could be
created/updated. Additionally, adds more logging in incomplete
framebuffer cases, if they still occur.

Change-Id: Ib90dbbafd6905aca3c8f46e64064e13a308f713d
2016-06-09 17:05:27 -07:00
Doris Liu
718cd3eb70 Handle hidden RT VectorDrawable animators
This CL changes the target of VD specific animators to VectorDrawable,
instead of RenderNode. The benefit of doing so is that animators can
now detect whether the animation is meaningful by checking whether
their VD target is in the display list. If not, that means the VD is
not drawing for the current frame, in which case we can be smarter
and more power efficient by removing the animator from the list and
posting a delayed onFinished listener callback.

By setting VD as the animation target, when an ImageView decides to
update its drawable from one AVD to something else, we'll be able
to detect that the previous AVD is no longer in the display list,
and stop providing animation pulse to the stale AVD, which is
something we couldn't do previously.  This change also
handles the case where one AVD instance could be drawn in two
different views.

Bug: 27441375
Change-Id: Iaad1ed09cfd526276b95db0dd695275c28e074e8
2016-06-09 10:27:59 -07:00
John Reck
cd1c3eba69 Add a callback for when a gl functor is released
Bug: 27709981

Change-Id: Id5be3e8f88d6d84a9c59c7ed23e7e8862feefbe8
2016-04-15 10:56:53 -07:00
John Reck
51f2d606dc Fix some edge cases
Bug: 27709981

This desperately needs a refactor, but to keep
the current (really needed & nice) behavior of
dispatching after sync finishes would be difficult
to handle cleanly without lots of ripping so... #yolo

Change-Id: I831a06c6ae7412a062720d68ecbe3085190f0258
2016-04-07 14:10:43 -07:00
Doris Liu
1d8e194661 Make AVD thread safe
This CL introduces staging properties to VectorDrawable, which holds
properties coming from UI thread. When staging properties are changed,
they are marked dirty, and the staging properties then get pushed to
RenderThread at sync point. In cases where no staging property has
been changed, at sync point we sync the render thread properties back
to staging properties to reflect the latest render thread animation
value change.

Also, update Vector Drawable bitmap only when it's dirty

Bug: 27343970
Bug: 27385912
Bug: 27263667
Bug: 27927674
Bug: 27774383

Change-Id: Ia864f5400a53a08dbfb284fae581fb1aac4fff87
2016-04-04 14:40:17 -07:00
John Reck
44b49f070a Add a callback for rendernode parentcount=0
Bug: 27709981
Fixes: 22565656

Change-Id: I1cb4461baf9069dc4e7ca6de10d5862578c107f4
2016-03-31 08:36:50 -07:00
Chris Craik
91eff22b5d Support op dumping in new pipeline
bug:26565102

Change-Id: I266e420a2f18ba9ad62942b8a0de295dfa3a2a88
2016-02-23 18:52:54 +00:00
Doris Liu
8b083206ae Revert "Revert "Check RenderNode's owning view before attaching animators""
This reverts commit eb40178af3b7c8d925eaf6c1aa0bef739c8ea47e.

Change-Id: I6838ecb35b50847746ee66ac204f14eb5f579b91
2016-02-19 13:52:41 -08:00
Doris Liu
eb40178af3 Revert "Check RenderNode's owning view before attaching animators"
This reverts commit 12abdeb3c7bffbc7c07b913595f6ea2cb66154d1.

Change-Id: I938deddf5f294127f87a0e70f940fe5b9a85e0b2
2016-02-18 18:34:59 +00:00
Doris Liu
12abdeb3c7 Check RenderNode's owning view before attaching animators
-Only add animators to a RenderNode when its owning view is attached
-When changing animator's target RenderNode, remove the animator from
 the old target RenderNode that it's currently running on, if any.
Bug: 27141983
Bug: 27145149
Change-Id: I9c9592382d64ecc0390f7ec743a59ce1ad7d9798
2016-02-16 14:25:48 -08:00
John Reck
f648108f83 Have RT drive window positioning
Bug: 22802885

Change-Id: I6beed5474d3a943b16e9097f7bd61ce3cbd37505
2016-02-04 11:23:49 -08:00
Florin Malita
eecff56fed Add internal Canvas save flags
Skia's SkCanvas::SaveFlags are being deprecated.  This CL introduces
the equivalent android::SaveFlags, converts all internal clients to
the new enum, and switches the saveLayer glue to the
SaveLayerRec-based API.

Change-Id: Icb1785f4e7c0f652b1f04b34a1e3ccb063c408f3
2016-01-25 15:48:00 -05:00
Chris Craik
8d1f2120fe Support projection in OpReorderer
bug:22480459

Change-Id: Iceb71732dc50957cfb47fa1ba9b8e18e6fc51132
2015-11-25 14:09:24 -08:00
Chris Craik
f559bd1e67 Fix layer create properties
bug:25753159

Change-Id: Ifa64dbfd8057ae5b390ba0c177627a5325cdd769
2015-11-18 14:42:00 -08:00
Chris Craik
8ecf41c61a Add temporary layer alpha fallback to OpReorderer
Also adds logic to clip temporary layers to viewport both for
efficiency and to allow large ones (such as the fallback case) to fit
in max texture size.

Change-Id: Iee51495220f5ca1dc7e6f5fd3615db2e896efd74
2015-11-17 14:50:49 -08:00
Chris Craik
98787e6c9b Finish shadow support in new reorderer/renderer
Now passes alphas and light radius, and correctly transforms light
center for layers.

Also fixes begin-frame/layer clears to be damage rect aware.

Change-Id: I3b1415cd7bf1518c510145ebebdb745f494a2542
2015-11-16 11:21:18 -08:00
Chris Craik
9fded232a9 Recycle OffscreenBuffers
Change-Id: Ia2e219026f211a5308ecf8209c5f986bb888aadd
2015-11-12 13:05:35 -08:00
Chris Craik
76caecf421 Add more RenderNode property support in OpReorderer path
Change-Id: I0163fe91d8145e33019739c191bbab0432a5f9aa
2015-11-05 15:25:12 -08:00
Chris Craik
8d2cf943d9 Add region-tracking to OffscreenBuffers
Change-Id: I024c7219c080b9a89888517f5a89d49dfe8065ba
2015-11-02 17:34:06 -08:00
Chris Craik
0b7e8245db Initial HW layer support in new reorderer/renderer
Shares vast majority of clipped savelayer code, with only minor
differences in lifecycle.

Doesn't yet handle fill region, resize, or window transform.

Change-Id: Iabdd71811590d2b937eb11e1b01ce556ade54a5a
2015-11-02 12:59:38 -08:00
Chris Craik
263e19bf46 Merge "Simplify TreeInfo" 2015-10-29 19:49:22 +00:00
Chris Craik
e2e53a7079 Simplify TreeInfo
Change-Id: I8f05e9046236d607016b6c2bb77a333cfb47ba47
2015-10-28 15:55:40 -07:00
John Reck
3398abb25b Merge "Cleanups" 2015-10-28 19:21:17 +00:00
John Reck
9dea0d53f5 Free DisplayListData for Views with GONE parents
Bug: 22565656
Change-Id: I06060e6ae473482ec79feb891f9123c85706237f
2015-10-28 12:20:20 -07:00
John Reck
77c40109cf Cleanups
Change-Id: I10001711afb2530c5dc19aebf2d055ae41f58c6a
2015-10-27 07:54:17 -07:00
Chris Craik
6fe991e5e7 Work to support saveLayer in new pipeline
clipped SaveLayers will now be pulled to the beginning of the frame,
prior to drawing FBO 0. This will remove the need for switching FBOs
mid-frame.

Change-Id: I4d8dc1f845e84e9b49d5acdf4f4703eef4a9cb06
2015-10-21 18:19:37 -07:00
Chris Craik
b36af87f82 Use LinearStdAllocator in DisplayList
bug:24300128

This removes most of the remaining calls to malloc when
recording DisplayLists.

Change-Id: If928bd53dac0f145aadc436a62759086b67da0ed
2015-10-19 11:32:28 -07:00
Chris Craik
003cc3dec8 Rename DisplayListData to DisplayList
Change-Id: I25f6bb88ffdf9baf7e8e4e2a294aa8c9d2a4605b
2015-10-16 10:38:34 -07:00
Chris Craik
10ed692118 Use typedefs to differentiate between flavors of DisplayLists
Change-Id: Id3b0a5aa045f2343fb046ca0889b375a7d00e03f
2015-10-15 10:55:15 -07:00
Chris Craik
b565df13a9 Initial commit of new Canvas operation recording / replay
Done:
- drawRect, drawBitmap, drawColor, drawPaint, drawRenderNode, drawRegion
- Recording with new DisplayList format
- batching & reordering
- Stateless op reorder
- Stateless op rendering
- Frame lifecycle (clear, geterror, cleanup)

Not done:
- SaveLayer (clipped and unclipped)
- HW layers
- Complex clipping
- Ripple projection
- Z reordering
- Z shadows
- onDefer prefetching (text + task kickoff)
- round rect clip
- linear allocation for std collections
- AssetAtlas support

Change-Id: Iaf98c1a3aeab5fa47cc8f9c6d964420abc0e7691
2015-10-14 16:10:40 -07:00
Teng-Hui Zhu
8d0ec38953 Early return when the scale is 0.
b/24534579

Change-Id: Ib3581ec99387ca70ca036026f64857a49657d94b
2015-10-02 10:23:32 -07:00
John Reck
e248bd1b2c Serializing display lists
This is a WIP prototype

Change-Id: Id4bfcf2b7bf905221c3734b7b6887c9b2efd37e6
2015-08-26 16:29:15 -07:00
Chris Craik
71c10ee8be Merge "Switch several enums to enum classes" 2015-08-21 23:08:39 +00:00
Chris Craik
b9ce116dac Switch several enums to enum classes
Change-Id: I00ecd0b61657196b51704f70ca31a9d1c1ac254e
2015-08-21 23:05:44 +00:00
Chris Craik
3aadd60521 Revert "Revert "Simplify TextureView draw path""
Fixed build breakage

This reverts commit d35dcb13115ca1dd8c07e397f43a186cd7fd1a01.

Change-Id: Id3a103fbaac15a05f558bce2161ce17b6e8d2ea3
2015-08-21 10:33:02 -07:00