754 Commits

Author SHA1 Message Date
Chris Craik
678ff81105 Clip projected ripples to outlines
bug:27343928

Also fixes positioning of ripples to a scrolled projection receiver.

Change-Id: I74b7233c46d7c15839ca8bf50e188ba6646d7432
2016-03-02 10:29:15 -08:00
Chris Craik
e8c3c813b0 Fix TextDropShadowCacheTests and glyph_t everywhere
Change-Id: I943eae4e9408c77bdfba6304ba7ee3e862351a41
2016-02-08 22:45:22 +00:00
John Reck
0b8d0677be Fix copyLayerInto
Bug: 26763945
Change-Id: I21ffbd56cf70bad0928416963e6fc254be435af9
2016-01-29 14:53:45 -08:00
Florin Malita
dd93728b46 Merge "Add internal Canvas save flags" 2016-01-26 17:00:37 +00: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
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
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
38e0c32852 Track texture memory globally
Also mostly consolidates texture creation

Change-Id: Ifea01303afda531dcec99b8fe2a0f64cf2f24420
2016-01-14 13:42:12 -08:00
Chris Craik
5430ab220b Avoid unneeded rect params
Change-Id: I2d8dcf6b09fdc554a403ac74763bf856b5f5d9fa
2015-12-10 16:29:01 -08:00
Chris Craik
386aa03179 Add more shape drawing to new reorderer/renderer
bug:22480459

Add support for outsetting final bounds based on stroke.

Change-Id: I659318ccec51882bba1906ce3c7042288ce35c30
2015-12-09 11:29:04 -08:00
Chris Craik
15c3f19a44 Merged op dispatch in OpReorderer
bug:22480459

Also switches std::functions to function pointers on OpReorderer, and
switches AssetAtlas' entry getter methods to using pixelRef pointers,
so it's clear they're the keys.

Change-Id: I3040ce5ff4e178a8364e0fd7ab0876ada7d4de05
2015-12-07 12:34:46 -08:00
Chris Craik
a1717271ca Initial text support in new reorderer/renderer
Removes obsolete drawPosText codepath, and unifies text decoration behavior.

Change-Id: I9c563249ab688a3394445a0e7fe1b9d0661f6f7c
2015-11-20 11:03:18 -08:00
John Reck
9557dcd53b Merge "Fix HWUI Path Cache dangling pointer" am: 37bf3ec9d2 am: 7516d4d866
am: 1b85ce17a3

* commit '1b85ce17a316973a170b3932f2d0a9b02063eaa3':
  Fix HWUI Path Cache dangling pointer
2015-11-10 23:36:27 +00:00
Digish Pandya
2e4f67c388 Fix HWUI Path Cache dangling pointer
When precache, PathTexture is added to PathCache, and it is released after drawn if we want to clean it.
But the PathCache LRU still holds the entry of the PathTexture object. When trim the cache in
the end of each frame, LRU finds that its mListener is not NULL and invoke the functor, however,
mListerer points to the released PathTexture object and is a dangling pointer, thus leads to crash.
Smart pointer don't help here since they only manage scopes, while PathTexture is also controled by
its cleanup field.
The fix is to also remove the LRU entry of PathTexture*, it will also release the texture object
and there won't be texture leaks.

Change-Id: Iaa0621df5dc71532e9e75b38ad94384353930b95
2015-11-09 14:22:25 +05:30
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
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
ac02eb9035 Remove confusing behavior of Rect::intersect() and rename
bug:24670525

Removes silly 'do nothing if rects do not intersect' behavior, and
changes the name to clarify the difference (contrasting against
SkRect::intersect())

bug:24670525

Change-Id: Id2ca1cfea1a9d720d4dc70b251f426d9916f8b53
2015-10-05 14:16:26 -07:00
Chris Craik
f6049a5c55 Merge "Move more utils into paintutils" 2015-10-02 17:28:36 +00:00
Chris Craik
56ce58ee6e Merge "Move ortho matrix out of glop" 2015-10-02 17:28:01 +00:00
Chris Craik
bf6f0f2608 Move more utils into paintutils
Change-Id: I1eb3fd52386bc61a592da235533e40b509eeec24
2015-10-01 15:26:06 -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
b45c6aa665 Simplify DeferredDisplayList construction
Change-Id: I385bd894fda097e35abb8f8d5eb8271f10bd163b
2015-09-28 15:41:27 -07:00
Chris Craik
c08820f587 Remove lookup3 gamma code
Also clean up gamma / glyph cache properties

Change-Id: I75b1ac0cb55638bf787ffd3cf457483ae314f03b
2015-09-22 14:40:35 -07:00
Chris Craik
64e445bf74 CanvasState frame init refactor
bug:23760482

Change-Id: Idc0802b4b8a6a3cebd20797350f4eb01bcc3fe77
2015-09-02 15:15:56 -07: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
Bart Sears
3b1c32eb5d Merge "Revert "Simplify TextureView draw path"" 2015-08-20 02:25:30 +00:00
Bart Sears
d35dcb1311 Revert "Simplify TextureView draw path"
This reverts commit 20a248934c67b19c8734362dba76a5cc94254686.

Change-Id: Iaa3ebb1d868acbe184080087aec312b43e87e3c7
2015-08-20 02:23:39 +00:00
Chris Craik
87f9c42f54 Merge "Simplify TextureView draw path" 2015-08-20 00:02:09 +00:00
Chris Craik
20a248934c Simplify TextureView draw path
bug:20461288

Change-Id: I239fbd26ab2177481c84feb62a1da68faeb634ac
2015-08-19 16:59:45 -07:00
Chris Craik
e5e6f4837b Merge "Change setMatrix behavior to only affect canvas-local matrix" 2015-08-19 22:38:07 +00:00
Chris Craik
7c85c54499 Remove Matrix4::load(Matrix4&)
bug:22320446

Change-Id: Id6d1cc9b4aea828b0cdf622ad672064d72671f8d
2015-08-19 15:10:25 -07:00
Chris Craik
6daa13c5fa Change setMatrix behavior to only affect canvas-local matrix
bug:22189925

This makes setMatrix(getMatrix()) work as expected, and makes setMatrix()
much more useful without changing behavior relative to a View's parent
hierarchy.

Change-Id: I608613bd27c1b9052ae583f8fd2119cf37a2f6d7
2015-08-19 13:32:15 -07:00
John Reck
149173d28c Support new EGL extensions
Bug: 21753739

Includes a revert of 13d1b4ab10fbee5e81a2ba1ac59cfae1e51d3ef0
as that only supported EGL_EXT_buffer_age

Change-Id: Ia86a47d19e3355c067934d7764c330b640c6958d
2015-08-12 14:26:05 -07:00
John Reck
272a685f17 Replace most usages of utils/Vector.h
Change-Id: I540d1b3523244d6c71fc52d6fb30555271c25644
2015-07-30 09:51:52 -07:00
Tom Hudson
0f6cb32c75 am a5e2946f: am b9d7bba5: am 434b577f: am 8ac76504: am 9613e9b7: Merge "New setLocalMatrix() operation for HWUI" into mnc-dev
* commit 'a5e2946f5ab7618997fb317ad9f5f56c160ebee5':
  New setLocalMatrix() operation for HWUI
2015-07-10 13:35:27 +00:00
Tom Hudson
9613e9b764 Merge "New setLocalMatrix() operation for HWUI" into mnc-dev 2015-07-10 12:35:12 +00:00
Tom Hudson
ac7b6d33d2 New setLocalMatrix() operation for HWUI
Concats any matrix passed through from DisplayListCanvas with the
initialTransform of the containing RenderNode.

BUG:22189925

Change-Id: I5ea54a6e2a29520c79a8860bde7682694e8595d2
2015-07-09 16:15:31 -04:00
Chris Craik
43b42d8bdb am 41e4d8b3: am 0c218e43: am 9ca926ad: am fdb87b76: am 127b478a: Merge "Remove all usage of fmin and fmax" into mnc-dev
* commit '41e4d8b3ed044ed724bc340b77d3f9ca60105407':
  Remove all usage of fmin and fmax
2015-07-08 03:15:47 +00:00
Chris Craik
e6a15ee3d0 Remove all usage of fmin and fmax
bug:22208220

Removes needless call, and upconversion to doubles in multiple places.

Change-Id: I1b949fa5f206446ac34de800154c0147d6bd8034
2015-07-07 18:42:42 -07:00
Chris Craik
7b293b5556 am c3988e0a: am b4c02e8f: am d3ecb3e6: Merge "Switch from fminf/fmaxf to std::min/max" into mnc-dev
* commit 'c3988e0aa337b74693feb0abb898eb87fbb61b58':
  Switch from fminf/fmaxf to std::min/max
2015-07-03 20:35:50 +00:00
Chris Craik
df72b63928 Switch from fminf/fmaxf to std::min/max
bug:22208220

Shows considerable improvement in performance, especially in tight
loops.

Change-Id: I4bcf6584a3c145bfc55e73c9c73dcf6199290b3c
2015-06-30 17:58:21 -07:00
Chris Craik
d739b5f39c am ee6d943b: am 46de9f56: am 6659ac77: Merge "Avoid over-damaging layer area for multidraws" into mnc-dev
* commit 'ee6d943b9e13cde263ccb622dd529922dfa1f3b3':
  Avoid over-damaging layer area for multidraws
2015-06-24 18:40:14 +00:00
Tom Hudson
02a26300fb Switch framework to new Skia enums
Allow Skia to finish deprecating old path operation enumerations.

Change-Id: I61e4489e639043acb78d47994ab62a31f18bd878
2015-06-24 16:56:43 +00:00
Chris Craik
3375f8ad30 Avoid over-damaging layer area for multidraws
bug:19608961

Change-Id: Ib7495f155da62a352e9a010a362fd40ec0acad21
2015-06-24 09:43:54 -07:00
Chris Craik
b1f990de40 Fix roundrect clipping / blending ordering
bug:21803918

Also, don't consider rr clipped ops opaque, and put stage
checking behind a debug flag.

Change-Id: I9304ae571337a7cf835524682d1a590a21d30fa4
2015-06-12 13:20:37 -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
1cd7e4c3d0 Merge "Use path intersection instead of saveLayer+mesh to mask projected ripples" into mnc-dev 2015-05-28 22:03:08 +00:00
Chris Craik
fca52b7583 Use path intersection instead of saveLayer+mesh to mask projected ripples
bug:14297149

SaveLayer's performance cost is high, and proportional to the surface
being projected onto. Since ripples (even unbounded ones) are now
always projected to the arbitrary background content behind them, this
cost is especially important to avoid.

This removes the last semi-secret, saveLayer from the projected
ripple implementation.

Also fixes the HW test app to correctly demonstrate this projection
masking behavior.

Additionaly, alters PathTessellator to gracefully handle
counter-clockwise paths, and simplifies the work done by
ShadowTessellator to ensure all of its paths are counterclockwise.

Change-Id: Ibe9e12812bd10a774e20b1d444a140c368cbba8c
2015-05-26 17:53:16 -07:00