151 Commits

Author SHA1 Message Date
Doris Liu
14b56a514c DrawVectorDrawableOp for old rendering pipeline
Bug: 27371430
Change-Id: I068d8023812173526ac98d11b903f82e0a66d9c2
2016-02-26 11:39:12 -08:00
John Reck
7df9ff2a08 Fix all LA memory leaks forever!
Bug: 27072626

Or at least fix this one and make it harder to leak
going forward. static_asserts are cool, use them liberally

Also makes allocation via LA (slightly) faster by fixing create*
variants to use rvalue references & std::forward, preventing
an accidental pass-by-value

Change-Id: I18fd696a93dd6ea49c8d8c587d4c8bee56dbfdf5
2016-02-11 00:42:23 +00:00
John Reck
e537330ead Revert "Fix all LA memory leaks forever!"
This reverts commit 499d83f21e7ffb687788bba1668b05fe38f6ebaf.

Change-Id: Ia893ae16ebbeae68e49cd13a20587104b73d39a0
2016-02-11 00:36:34 +00:00
John Reck
499d83f21e Fix all LA memory leaks forever!
Bug: 27072626

Or at least fix this one and make it harder to leak
going forward. static_asserts are cool, use them liberally

Also makes allocation via LA (slightly) faster by fixing create*
variants to use rvalue references & std::forward, preventing
an accidental pass-by-value

Change-Id: I5e0e36e72c6dd93324194ebf9a95f8204f05f261
2016-02-10 16:11:26 -08:00
Chris Craik
e8c3c813b0 Fix TextDropShadowCacheTests and glyph_t everywhere
Change-Id: I943eae4e9408c77bdfba6304ba7ee3e862351a41
2016-02-08 22:45:22 +00: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
54fa17f667 Add ListView rendering benchmark
Also fixes a bug in DrawRenderNodeOp recording, which was triggered by
the new test.

Change-Id: I328f2ed908495eb95ca8ce87a365d02650e72cd5
2015-12-02 15:20:26 -08:00
Chris Craik
8d1f2120fe Support projection in OpReorderer
bug:22480459

Change-Id: Iceb71732dc50957cfb47fa1ba9b8e18e6fc51132
2015-11-25 14:09:24 -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
Chris Craik
161f54b2d4 Add z-reordering support to OpReorderer
Change-Id: I3fa969fe53cf648d145810f69fa7dada376c0b9a
2015-11-05 15:45:59 -08:00
Chris Craik
003cc3dec8 Rename DisplayListData to DisplayList
Change-Id: I25f6bb88ffdf9baf7e8e4e2a294aa8c9d2a4605b
2015-10-16 10:38:34 -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
Chris Craik
bf6f0f2608 Move more utils into paintutils
Change-Id: I1eb3fd52386bc61a592da235533e40b509eeec24
2015-10-01 15:26:06 -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
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
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
272a685f17 Replace most usages of utils/Vector.h
Change-Id: I540d1b3523244d6c71fc52d6fb30555271c25644
2015-07-30 09:51:52 -07: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
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
a766cb2bce Put WebViews with on a HW layer if stencil/shader clipping is needed
bug:17322378
Change-Id: I0de574bf116b30e2ad4194366e19d47d49708902
2015-06-12 13:34:58 -07:00
Chris Craik
031e69ff81 Fix rendernode flag logging
Change-Id: I978c54ab26ef6dc3f6caef8604ac77a883b8e913
2015-04-30 09:12:44 -07:00
Chris Craik
956f340aac Remove unused flags and dirty rects
bug:17209071

Also update DisplayList->RenderNode naming in Editor

Change-Id: I1d505640ba7388a0b0042d9c787f859e45a24da5
2015-04-28 09:40:01 -07:00
Chris Craik
db663fe83f Rename native DisplayListRenderer to DisplayListCanvas
Change-Id: I33e6f8cc85da1e7da7ff7bf18d4ebde64222067a
2015-04-20 14:20:47 -07:00
Chris Craik
ef2507439c Glop mesh reorg, support for drawBitmapMesh
Change-Id: Iaf5550bdd93da93e59a5b838234ab5612e067387
2015-02-26 10:56:07 -08:00
Chris Craik
03ae272459 Remove renderer abstract class
No longer needed, allowing vast majority of methods on
OpenGLRenderer to be non-virtual.

Change-Id: I8a6ee042b95050dc666887579ef4e1c7a8f9b33b
2015-02-25 15:51:58 -08:00
Chris Craik
14100ac9f8 Glop support for custom textured UVs, simplify drawBitmap(src,dst)
Front load the scaling-to-support-shaders to record time.

Change-Id: I861c82d9d16d3c5e063cf87230127eed0b3f9b54
2015-02-25 10:18:46 -08:00
Chris Craik
0519c810a5 Glop Bitmap and RoundRect clipping support
Change-Id: I4577546a5d2e5f084cc03f39a89db9231b8111ee
2015-02-12 12:30:59 -08:00
Chris Craik
65fe5eeb19 Move scissor state to RenderState
Change-Id: I1227a3886fb24e4d9fad79fca469794f06cfb15e
2015-01-27 17:12:39 -08:00
Derek Sollenberger
3d4eed7f1a Update HWUI to store its own SkBitmap objects
This enables us to...

1) simplify the lifecycle/ownership between Java and HWUI
2) remove DisplayListRenderer::drawBitmapData and associated logic
3) track pixel lifecycle using standard SkPixelRef refcounting
4) Remove uncessary calls to ref/unref the bitmap's pixels and colorTable

Change-Id: I3c95078da20995444f6388a029414280fd654318
2015-01-09 13:56:56 -05: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
Tom Hudson
8dfaa49042 Make DisplayListRenderer inherit from Canvas, merge JNI
Incrementally unify the upper layers for Skia and HWUI.
Remove redundant code from GLES20Canvas.java; instead
use inherited mNativeCanvasWrapper and superclass method
definitions.

Moves some unrelated SkPaint utility functions from Renderer
to new utils/PaintUtils.

bug: 15672762
Change-Id: I4ddd4214b8e9eeb95289d054ef423f2542bb5fa5
2015-01-05 15:25:41 -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
Yohann Roussel
59cf734f9e resolved conflicts for merge of d67bb501 to master
Change-Id: I40698ce1e382cb41eec7af5ea49ac0e2f997d555
2014-12-11 11:10:50 +01: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
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
Nick Kralevich
7668e78601 resolved conflicts for merge of 3bae94d7 to master
Change-Id: I381539b1494447d62290c492f2550840fe0b559c
2014-12-10 11:03:40 -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
dad7d84c04 Teach AssetAtlas about more drawables
Bug: 18317479

Change-Id: I16868ee204d24af72af9a2efc987f7e9eb1d266b
2014-12-09 14:18:33 -08:00
Andreas Gampe
64bb413a66 Revert "resolved conflicts for merge of 220c3f4f to master"
Reverted as hwui doesn't agree.

This reverts commit 8a902d9f24e83c87b054adb5836b4a5b8a257be9.

Change-Id: I109e7b02bee2921e2155ded6df36f52e6f574b5a
2014-11-22 00:35:09 +00:00
Andreas Gampe
8a902d9f24 resolved conflicts for merge of 220c3f4f to master
Change-Id: I37ecce8fddecdff82b0eace16f1ee75152f7171e
2014-11-21 15:51:04 -08:00
Andreas Gampe
2ab8298dc3 resolved conflicts for merge of 99377df1 to lmp-mr1-dev-plus-aosp
Change-Id: I3a98f55832ac447b1ed0dd129c7a93d088025943
2014-11-21 14:19:06 -08:00
Andreas Gampe
42ddc18d10 Frameworks/base: Unused parameters in hwui
Remove Clang cutout for unused parameters. Fix warnings.

Remove Clang cutout for deprecated Skia function usage. Has been
fixed in the L push.

Change-Id: I7ea073ff67127cc1e14e798b655e2c50615fe8e7
2014-11-21 10:39:21 -08:00
Tom Hudson
107843de45 Remove status return from all uirenderer::Renderer functions
This moves the interface closer to android::Canvas. The only use of
return values was in the OpenGLRenderer subclass; that is replaced
with an internal dirty flag: returned from finish(), checked by
CanvasContext.

This is part of a series of CLs to refactor the Graphics JNI bindings.

BUG:15672762
R=djsollen@google.com,ccraik@google.com

Change-Id: Ifd533eb8839a254b0d3a5d04fc5a2905afdfc89e
2014-11-04 15:49:44 -05:00
Derek Sollenberger
09c2d4fe15 Refactor HWUI to better handle Canvas DrawFilters.
First, this CL removes the need to decompose the DrawFilters
in Java and instead passes the SkDrawFilter to HWUI directly.
This also allows the removal of duplicated logic between HWUI
and other Canvas implementations regarding Paint filter levels.

Second, the DrawFilter is now stored in the DisplayListRenderer
where we apply it to every paint BEFORE it is stored in the
DisplayList.  This eliminates the need to filter all Paints on
playback and removes additional complexity at playback.

Finally, as a result of storing the filtered paint we can now
do a better job caching the paints.  This takes advantage of
recent changes in Skia to quickly enable quick hashing and
comparison of paint objects.

Change-Id: Iec507a2d894827975cc4f1d22241542bb0534b4e
2014-10-17 10:44:29 -04:00
Tom Hudson
2dc236b2ba Clean up physical coupling
Narrow the use of #include directives in hwui, replacing with forward
declarations where straightforward. Speeds compiles; doesn't do any
restructuring of code.

Change-Id: Icac2baffb5896f55d8c6718e9bd9d4bfa02d3ca0
2014-10-15 15:51:39 -04:00
Chris Craik
c5b5f0556b Account for colorfilter transparency in determining paint opacity
bug:17765601
Change-Id: I90d76ee199bb357c71fc8f537c1abfa20d848416
2014-10-01 16:40:16 -07:00