84 Commits

Author SHA1 Message Date
sergeyv
3e9999bd86 Explicitly destroy Layer in DeferredLayerUpdater on destroyHardwareResources()
Change-Id: I0987104eabda9a2a302b9e765213aad48f93aea4
Test: refactoring CL. Existing tests still pass
bug:33753499
2017-01-30 16:42:41 -08:00
Greg Daniel
8cd3edfa15 Break Layer class into Gl and Vulkan subclasses
Test: manual testing
Change-Id: Ibd2beed39de3ac6da7448e96496253cfe427dfbb
2017-01-10 15:05:07 -05:00
sergeyv
2a38c42e92 Add target to texture
Test: refactoring cl.
bug:32413624

Change-Id: I94b1c31cd4e0712dfcfd7777a0012424c1bf0dca
2016-10-26 14:01:09 -07: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
Derek Sollenberger
8556ab87bc Remove unused code from HWUI Layer
Change-Id: If9046add5ca5a647351187c5809841edcf0bfa9b
2016-07-08 09:57:56 -04:00
Chris Craik
5e00c7ce06 Delete old rendering pipeline
fixes: 30002246

Change-Id: I45df0e924708526cee045b14c291bd23aa1a92db
2016-07-07 15:53:50 -07:00
John Reck
db009173f8 Fix NPE in clearTexture()
Change-Id: I38d261968506ab8b312584c7e688e2b148fadd1f
Fixes: 25928378
2016-03-17 11:02:07 -07:00
John Reck
2de7771740 Normalize GL_UNPACK_ALIGNMENT
Several places were setting GL_UNPACK_ALIGNMENT
unneccessarily, whereas other places were assuming an
unpack alignment of 1. Since we never actually
do explicit row-alignment, set GL_UNPACK_ALIGNMENT
to 1 at context creation time and never change it

Bug: 26584230

Also turns on aggressive glGetError checking to
better catch potential problem zones

Change-Id: I190c8f0f0494a7f046d5ed769405c75d363be59a
2016-01-20 13:16:24 -08:00
John Reck
a55b5d6c65 Fix "leak" in FrameBuilder.textureLayer test
DeferredLayerUpdater always did a post to delete itself, which
would result in the test thinking it had leaked an object since
it wasn't deleted when it returned. Fix this by deleting immediately
if we're already on the right thread.

Remove RenderState's requireGlContext assert as it's now
covered by GpuMemoryTracker, which is also more test friendly.
RenderState's assert required an actual EGL context, which we
don't mock away in unit tests.

Change-Id: Ic23eb54e7151355f7acca483d7464350c9d6a87f
2016-01-14 15:09:10 -08:00
John Reck
38e0c32852 Track texture memory globally
Also mostly consolidates texture creation

Change-Id: Ifea01303afda531dcec99b8fe2a0f64cf2f24420
2016-01-14 13:42:12 -08:00
John Reck
89add11bb4 resolve merge conflicts of f1df0f59c1 to master.
Change-Id: Ia0ae0f753541f5203a4a3683721361c5e90ddae8
2015-12-11 14:47:40 -08:00
Sangkyu Lee
441cc421b5 Fix memory leak in HWUI
std::unique_ptr::release just releases the ownership of the
managed object. To delete the object, std::unique_ptr::reset
function should be called.

Change-Id: If65f74085b1fc2be3a9fffc433326e0bcdb40ff3
2015-12-11 16:05:10 +09:00
Chris Craik
818c9fbf1d Initial version of clipped saveLayer in new pipeline
Additionally disables usage of FBO cache, so FBO destruction safely
interacts with renderstate caching.

Change-Id: I25c277cb7afec2ca33bf226445d6c8867a15a915
2015-10-26 15:51:48 -07:00
Chris Craik
bf6f0f2608 Move more utils into paintutils
Change-Id: I1eb3fd52386bc61a592da235533e40b509eeec24
2015-10-01 15:26:06 -07:00
Chris Craik
64e445bf74 CanvasState frame init refactor
bug:23760482

Change-Id: Idc0802b4b8a6a3cebd20797350f4eb01bcc3fe77
2015-09-02 15:15:56 -07:00
Chris Craik
b9ce116dac Switch several enums to enum classes
Change-Id: I00ecd0b61657196b51704f70ca31a9d1c1ac254e
2015-08-21 23:05:44 +00:00
Chris Craik
5a4690bf26 Clean up unncessary defines
LOG_TAG and TRACE_TAG are already defined in the makefile

Change-Id: I9e53e3dacbe018441edd74cb7c8c90846defee74
2015-07-14 13:25:38 -07:00
Alan Viverette
50210d9129 Adjust light source for window position
Bug: 16523629
Change-Id: I2f3fed1edcac0a3cfd5034aded45e08ececfebaf
2015-05-14 18:05:36 -07:00
Chris Craik
e5c6584a40 Constructor cleanup
Change-Id: Ic39911d08f44c3174de91fb92fcd4cab73fe4654
2015-03-02 17:56:06 -08:00
Chris Craik
44eb2c0086 Refactor blending and texture gl state
Change-Id: Ia6b3c8b2afd3dfcee7f3ce401d846b789612054a
2015-01-30 10:49:05 -08:00
John Reck
49bc4acfad resolved conflicts for merge of fe5ac4fc to master
Change-Id: I6c0cc82db14b56297586469f940e408c0e218b3b
2015-01-29 12:53:38 -08:00
John Reck
57998017ff Allow ~Layer() to happen after onGLContextDestroyed
Bug: 19146354
Change-Id: I9e885936168bd541bfbed4064ad67ab524f58e32
2015-01-29 10:17:57 -08:00
Chris Craik
65fe5eeb19 Move scissor state to RenderState
Change-Id: I1227a3886fb24e4d9fad79fca469794f06cfb15e
2015-01-27 17:12:39 -08:00
Chris Craik
d41c4d8c73 Add overrides and switch to nullptr keyword for all files
Adds remaining missing overrides and nullptr usages, missed due to
an extreme failure in tool usage.

Change-Id: I56abd72975a3999ad13330003c348db40f59aebf
2015-01-05 16:49:13 -08:00
Chris Craik
51d6a3db97 Cleanup various clang warnings, use unique_ptrs in several places
Change-Id: I347904b25e51fcc7de14b1e72f1acd0f6ba26f3f
2014-12-23 16:53:56 -08:00
Chris Craik
70850ea258 Improve logging around performance critical events
bug:17702227

Add details useful to developers (such as layer size/View name), and
switch away from logging implementation names/details, since they
are generally not relevant to developers.

Change-Id: Iee605d182f241450f7e75a6d0c283d51fa1312f5
2014-11-19 17:24:30 -08:00
John Reck
0e89e2b7bc Layer changes
Bug: 17208461

* Switch Layer to be VirtualLightRefBase instead of
  Caches' side-channel ref-counting
* Include active layers in gfxinfo dump
* Run gfxinfo dump on the correct thread
* Dump gfxinfo on Layer creation failure

Change-Id: I28d195699e2334518e215ab28c7a17355aee9678
2014-10-31 15:30:10 -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
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
John Reck
443a714fa7 Yet more layer tracking logging
Bug: 17208461

Change-Id: I55e7d0921eb565867e966d68b798b7b92c391b55
2014-09-04 17:40:05 -07:00
Chris Craik
1d47742333 Crash instead of leaking layers/textures between GL contexts
bug:17208461
Change-Id: I4d58f301cf0f5e8145e808a5d6ade4de7801970b
2014-08-26 17:30:15 -07:00
Chris Craik
69e5adffb1 Define shadow casting behavior within layers
bug:15860114

Savelayers and HW layers both now support shadow casting.

For save layers, the light source should always be correct, for HW
layers, the light source position is set when the layer is created,
and updated when it is resized.

Change-Id: Ie85567dd43c2bb0a0b08fd0bd4db41efa793ac2b
2014-08-15 00:59:44 +00:00
John Reck
ec4cefc152 Add layer/texture creation tracing
Change-Id: I0af6a36c97a9f5f35d28e0e36539ba8d8011ea7c
2014-07-29 10:04:01 -07:00
John Reck
3b20251a35 No-fail invokeFunctor
Bug: 15513308
 Bug: 15449247

Change-Id: I13a29f9c8d4975cdda6dcb33b6332c2555ff0f7c
2014-06-23 15:26:49 -07:00
Chris Craik
a7090e0cfd Update 'DisplayList' vs 'RenderNode' naming in several places
Change-Id: I635c6627d098b661fb9b0ba1bd42fa6d7277d287
2014-06-23 09:57:07 -07:00
Chris Craik
3281442aa7 Merge "Wrap ViewGroup content in save/restore to protect composited children" 2014-06-20 02:09:17 +00:00
Chris Craik
80d4902196 Wrap ViewGroup content in save/restore to protect composited children
bug:15570351

Pos Z composited children are drawn before the primary restore for a
RenderNode. This means that without an additional save/restore (which
wraps the content) they aren't protected from transformations/clips
that happen within the ViewGroup's DisplayList.

Also changes RenderNode to use OpenGLRenderer tag for displaylist
dumping consistency, and simplifies the entry points into RenderNode
drawing, since the distinction between tree root vs tree internal is
no longer important.

Change-Id: I2621eba0592c74d71f85a91a4ab3d0da2d7468d3
2014-06-20 16:18:58 -07:00
Chris Craik
0732ba5756 am 88b1c9ad: am e709d53f: am 0d28bb47: Merge "Fix the texture ID reuse issue in HWUI."
* commit '88b1c9ad87ca6d6faaf824bff4ee9d3c799362e5':
  Fix the texture ID reuse issue in HWUI.
2014-06-17 01:31:21 +00:00
jiayuanr
4a473c7d94 Fix the texture ID reuse issue in HWUI.
Issue: When the layer of previous frame is destroyed, it doesn't clear the
texture id in mBoundTextures[mTextureUnit], so in the next frame, if
glGenTexture returns same texture ID of the previous frame,
the new texture is not bound.

CRs-fixed: 671736

Change-Id: Ifc5fd2115fb1863b3c006ab14b0faabeaeb4eab4
2014-06-16 09:29:22 +05:30
Chris Craik
797b95b26b Define light position (using new lighting spec) in Java
Also updates the relative shadow strengths.

Change-Id: I6cac7275d38df98aea9f0dda463cd7207102986a
2014-05-21 13:50:29 -07:00
Chris Craik
a64a2bef10 Combine projection matrix, and viewport management
Merge management of ortho projection matrix with the viewport size,
since they should always be changed together.

Change-Id: Iccb8f30828f4fb7848999ac54852e7ed2d6f2eb1
2014-05-14 17:27:52 -07:00
Chris Craik
3f085429fd Clip TouchFeedbackDrawable effect to receiver Outline
Projected RenderNodes are now wrapped with a ClipRect or masked
SaveLayer, so that they are clipped to the outline of the projection
receiver surface.

Change-Id: I1d4afc1bb5d638d650bc0b1dac51a498f216773e
2014-04-23 16:15:11 -07:00
John Reck
087bc0c14b Refcount RenderNode
Change-Id: I7a86db8acc2b78ef33d987a43a119f5933d7d752
2014-04-07 14:53:08 -07:00
Chris Craik
b265e2ca50 Support shadows on the root RenderNode
bug:13211941

Cleans up some of the RenderNode method naming

Also removes unnecessary clip/save/restores, clipping shadows
predictably, as drawn by the parent, before drawing (and clipping,
etc.) the shadow casting child.

Change-Id: I795115e1fb869bbbdd7be43e279b97490fecc7e0
2014-03-28 14:43:22 -07:00
John Reck
668f0e38ef Async drawing!
Change-Id: I7e728356f58af88174328a8c0b90d27b128bfe01
2014-03-27 10:00:04 -07:00
John Reck
bfb07a0377 Move where updateProperties is called
Change-Id: I27da448996019094c44487ce28c5689d098d6535
2014-03-24 21:00:18 -07:00
John Reck
d0a0b2a314 Add stagingProperties
Change-Id: Ic7de551f8843fd70a77f738e33028e25c020bb3c
2014-03-24 15:31:34 -07:00
John Reck
113e0824d6 Move RenderNode to own file
Change-Id: I9380d161fd3ddd7b569c262dd8e7aa0c96151b1e
2014-03-19 16:40:04 -07:00
John Reck
e18264b079 Rename DisplayList->RenderNode
Change-Id: Id42e23c9a1a6eb6eaeafef707ced7fa6887b03d0
2014-03-12 13:56:30 -07:00
Chris Craik
9757ac0b9d Fix TextureView texture filtering.
bug:11748993

TextureView should always be drawn with linear filtering if drawing a
buffer sized differently from the layer.

This fixes a bug where TextureViews that were sized differently from
their contents wouldn't be drawn with texture filtering, causing
visible scaling artifacts.

Change-Id: I8a5d27452fe7269ec53896992f37cff51e3ce15a
2014-02-25 18:50:17 -08:00