120 Commits

Author SHA1 Message Date
Chris Craik
85bf1a85bd Merge "Add layer tracing tags in new pipeline" into nyc-dev
am: f8892359b0

* commit 'f8892359b0ae07031160a71cf3f7e3a86604c2b1':
  Add layer tracing tags in new pipeline

Change-Id: Id77f8234013d6bdbfd75b8fbc6a63b724820fd95
2016-05-05 20:10:42 +00:00
TreeHugger Robot
f8892359b0 Merge "Add layer tracing tags in new pipeline" into nyc-dev 2016-05-05 19:57:08 +00:00
Chris Craik
aff230f6f9 Add layer tracing tags in new pipeline
bug:28596354

Change-Id: I351cb50c8c9ddfc73be73d28a1af94d2a8f9992e
2016-05-04 16:27:29 -07:00
Chris Craik
92e7158f81 Merge "Use LUT for computing final shadow alpha" into nyc-dev
am: b2e36d7939

* commit 'b2e36d7939610de538a6ec95a821b61b365b3073':
  Use LUT for computing final shadow alpha

Change-Id: Ia17e3b93e9ade0633aee5a1e9edd60b92dd1e062
2016-05-04 01:11:15 +00:00
Chris Craik
138c21fbec Use LUT for computing final shadow alpha
bug:27415250

Significantly reduces shadow fragment shader computation.

Change-Id: Ie9b3c712700754b3734d0ae9cda8751c298fc59e
2016-05-03 14:36:29 -07:00
Chih-Hung Hsieh
85e0c89ba5 resolve merge conflicts of 1599b981 to nyc-dev-plus-aosp
Change-Id: I90807581e10b6a0024515ff634ac8b29eaa5fc9f
2016-04-28 12:08:15 -07:00
Chih-Hung Hsieh
c6baf563ba Fix google-explicit-constructor warnings.
Bug: 28341362
Change-Id: Ibdd6a210bb7ff228e3624cc319169f77aca3b51e
2016-04-27 11:38:12 -07:00
Chris Craik
74af6e282f Fix OffscreenBuffer leak
Fixes: 27941148

Make OffscreenBuffer lifecycle an explicit (and tested) contract between
FrameBuilder and BakedOpRenderer, entirely separate from dispatch. This
makes it safe to reject any rendering work via overdraw content
rejection (before it gets to a BakedOpDispatcher).

Adds a couple tests around OffscreenBuffer leaks, and switches
OffscreenBuffer tests to RENDERTHREAD_TEST macro, as appropriate.

Change-Id: Id114b835d042708ae921028fb4b17e5fa485fe64
2016-04-05 20:42:37 +00:00
Chris Craik
02806288d1 Fix flickering when layers resize in-place
bug:27248275
Change-Id: Ia11c93ebc1097f3735071204b6f14ca079bb9fc4
2016-03-14 13:26:25 -07:00
Chris Craik
64db2bf111 Clip buffer damage to viewport bounds
bug:27287946

Change-Id: Ief3ae9c2dd92196b7d09f1b9fadf009eb228d80a
2016-02-26 15:01:25 -08:00
Chris Craik
1b7db4000e Cleanup vertex attrib management
bug:27289007

Also removes unused code in MeshState

Change-Id: I46116631111cc82e1cdffb5706344bbb6d4c6600
2016-02-24 18:33:41 -08:00
John Reck
0b8d0677be Fix copyLayerInto
Bug: 26763945
Change-Id: I21ffbd56cf70bad0928416963e6fc254be435af9
2016-01-29 14:53:45 -08:00
John Reck
975591a7af Add fine-grained debug layer
Full GLES error checking layer via -include
trickery. Change DEBUG_OPENGL to a level system.

HIGH = every GL call is error checked
MODERATE = checkpointing at interesting spots
LOW = only asserts there are no errors at the end of a frame
 or when the FBO changes
NONE = AIN'T GOT NO TIME FOR ERRORS GOTTA GO FAST!

Change-Id: Ibe81aae93d942059c4ddf1cbb11c828b7ce4c10b
2016-01-25 16:15:14 -08:00
John Reck
bd41ded590 Fix accidental activateTexture(0)
Bug: 26584230

activateTexture(0) was accidentally refactored into
Texture::upload. Only OffscreenBuffer intended for the
texture unit to change

Change-Id: I5dbfc3eab8843733084ce1ce38a0a946abf0e05b
2016-01-22 09:31:28 -08:00
John Reck
e5530ec0b4 resolve merge conflicts of 32a95af029 to master.
Change-Id: I35b7cea1d34cb24f431ba2b76433a5b0ef1cb602
2016-01-21 16:45:31 -08:00
Dohyun Lee
c5a3efd286 libhwui: fix texture memory leak
When there is not enough space and we cannot delete any
Texture in TextureCache to secure space, a new Texture is
created over and over again for the same SkBitmap and
there is the case that it is not deleted.
This patch avoids such cases.

Change-Id: Ic5353995e6d0716c31fe3bb49c60ec1a71574643
Signed-off-by: Dohyun Lee <leedhyun11@gmail.com>
2016-01-21 13:46:21 +09: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
9372ac3621 Fix ordering of texture->upload arguments
Caught by scatter-shotting GL_CHECKPOINTS which
seem generally useful to have

Bug: 26609444

Change-Id: Ie31d9297d8dae56405126720f338b4256c8bae77
2016-01-19 12:58:48 -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
Chris Craik
7435eb148e Unclipped savelayer support in new renderer
bug:22480459

Change-Id: I89dd5de8d7d008a1e298d227d767aabff5c96e27
2016-01-08 16:05:35 -08:00
Chris Craik
e4db79de12 Stencil support in new recorder/reorderer
bug:22480459
bug:26358504

Adds complex (non-rectangular) clipping support, and overdraw
visualization. Doesn't support stencil clipping in layers.

Change-Id: I8d10c7f1d2769ab5756774ca672344cc09901f87
2016-01-04 17:00:03 -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
8d2cf943d9 Add region-tracking to OffscreenBuffers
Change-Id: I024c7219c080b9a89888517f5a89d49dfe8065ba
2015-11-02 17:34:06 -08:00
Chris Craik
5854b34881 Rework receiver/dispatcher design slightly, and replace Layer usage.
Switched from 'renderer/info' to 'dispatcher/renderer' to make their
interaction more natural. The new BakedOpRenderer is more similar in
responsibilities to the OpenGLRenderer, as it manages layer and frame
lifecycles, and performs the actual rendering.

However, it's still simpler because the BakedOpDispatcher handles
mapping Canvas drawing ops to Glops, and the OpReorderer handles almost
all canvas state operations.

Also switch BakedOpRenderer to use the new OffscreenBuffer, which
serves as a lightweight Layer replacement, with a much simpler
lifecycle.

Change-Id: Ie0e2e248503400041d49729d813d485d28c76eb3
2015-10-27 16:44:50 -07: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
12efe649d3 Move ortho matrix out of glop
It's fbo-global, so don't bother stashing/restoring it repeatedly.

Change-Id: Icb32e3eda5d2086aaae07140f8ff40e038dad5fe
2015-09-28 15:52:14 -07:00
Chris Craik
8e5ca2a990 Remove legacy enable/disable methods from Blend
Change-Id: I147f96d1fbdd34b9d056620e7259a9f96b13fea7
2015-09-21 16:00:14 -07:00
Chris Craik
68f5b8a781 Move texture upload behavior to TextureState
Change-Id: If1cb32bbc04f437fa0d079084de832de9fd777c2
2015-09-09 14:11:03 -07:00
Chris Craik
8adc30a805 Merge "Add static asserts around assumed-static skia enum values" 2015-08-21 23:09:24 +00:00
Chris Craik
b9ce116dac Switch several enums to enum classes
Change-Id: I00ecd0b61657196b51704f70ca31a9d1c1ac254e
2015-08-21 23:05:44 +00:00
Chris Craik
216048ffb0 Add static asserts around assumed-static skia enum values
Protects assumptions around enums value built into LUTs

Change-Id: Ica0692e4309d50b4d3897e0f3f47809d14f786fe
2015-08-21 15:32:58 -07:00
Chris Craik
9db58c031f Remove MathUtils::min/max
bug:22202895

Change-Id: Ia115d86871314e3819f684ea7307356aed13a28e
2015-08-19 15:53:01 -07:00
John Reck
9acd09d364 am 598b0123: am 67716c13: am e28c5d62: am a975a844: am 70e5db94: Merge "Fix crash in kModeProcessNoContext" into mnc-dev
* commit '598b0123d322b396e8bfc3d66f228cf0b7485eac':
  Fix crash in kModeProcessNoContext
2015-08-04 20:20:41 +00:00
John Reck
95cd24bb9d Fix crash in kModeProcessNoContext
Bug: 22931143
Change-Id: I9897a28b1edd006aee67ae2343874ad92bbd15a0
2015-08-04 18:19:11 +00:00
Chris Craik
9a579f58a6 am e375685a: am 9c458148: am 3d208671: am 7dfb1d99: am 730c0f65: Merge "Fix stencil mask usage in HWUI" into mnc-dev
* commit 'e375685aa4b8d7f31b2cbe08170c32bd4150468d':
  Fix stencil mask usage in HWUI
2015-07-30 20:07:06 +00:00
Chris Craik
fa51a0e1ce Fix stencil mask usage in HWUI
bug:21588246

Ensure we always set the mask before clearing, and removes
some unneeded optimizations around mask usage in
debug (overdraw) mode.

Change-Id: I71ed06c16f8d9f158953d5aa160098514f0f7f00
2015-07-30 11:06:53 -07:00
Chris Craik
1d5d34624b Merge "Clean up unncessary defines" 2015-07-16 20:11:05 +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
Chris Craik
e310f83d59 Fix unsafety in SkiaShader storage, and texture unit accounting
bug:22390304

Fixes two issues:

1) The max texture unit wasn't large enough to handle the most complex
ComposeShader case (1 for draw primitive, 2 for gradient shader, 1 for
bitmap shader).

2) If a shader isn't supported by SkiaShader::store, the shader data
needs to be explicitly disabled, so we won't read uninitilized data
from it when trying to read shader information out.

Change-Id: I29ee7b7c1e07f67db88c1707bdc857daa305e713
2015-07-13 13:34:07 -07:00
Chris Craik
53e51e4aa9 Handle shader matrix correctly when ignoring canvas transform
bug:20063841

Restores old SkShader matrix behavior from before the Glop refactor.

Many drawing operations draw without sending the canvas transform to
the GL shader. In such cases, we need to adapt the matrix sent to the
SkShader logic to invert the canvas transform that's built into
the mesh.

Change-Id: I42b6f59df36ce46436322b95bf9ad2140795ee58
2015-06-02 16:28:39 -07:00
Chris Craik
1e6d566c5f Merge "Fix GL texture binding for TextureViews" into mnc-dev 2015-05-27 19:22:44 +00:00
Chris Craik
5f1356c80a Fix GL texture binding for TextureViews
bug:21431334

Should be explicitly passing target through, to ensure
GL_EXTERNAL_OES textures are bound correctly.

Change-Id: I997672ae292ea7fc016c02a59a3c7c8358ecfe0b
2015-05-27 11:06:22 -07:00
John Reck
d7db4d7672 Eliminate requireGlContext
Bug: 20297820

Change-Id: I37c63bab6f6c0d2337c8c6002046d2ef17e74097
2015-05-20 11:24:57 -07:00
Chris Craik
2507c34d91 Cleanup properties
bug:19967854

Separate properties from Caches, into static, RenderThread-only class.

Also rewrites the means for java to set properties to correctly handle
threading, and adds an override for profile bars so that SysUi doesn't clutter
the screen with them.

Change-Id: I6e21a96065f52b9ecc49d1a126244804ba106fa9
2015-05-05 10:36:09 -07:00
Chris Craik
e145013153 Require minimum 4 bit stencil for layers.
bug:19270131
Change-Id: I81367179d268e7c1642259c456c1f3d0018f6c0d
2015-04-29 13:04:02 -07:00
Chris Craik
edacf22ca1 Merge "Glop based composeLayerRegion/Rect" 2015-03-10 16:29:14 +00:00
Chris Craik
182952f5ee Glop based composeLayerRegion/Rect
Change-Id: I69440cabca84948e8aaead9479d616ebc2496517
2015-03-09 18:06:32 -07:00
Chris Craik
eb911c2b0e Rewrite glop texture asserts
bug:19641517

Also switch Glop VertexAttribFlags to use int for group of flags.

Change-Id: Ib7b1934197a62206a55baa6ab484ac59f5bec816
2015-03-09 13:36:35 -07:00