6613 Commits

Author SHA1 Message Date
Chris Craik
e688bf7203 Constrain drawBitmap matrix-to-rect optimization
bug:22962165

Optimization is not valid if matrix would flip image.

Change-Id: Ieee42390517bd3466b7d94596f0fbbe192ab757e
2015-08-18 14:53:47 -07:00
John Reck
95cd24bb9d Fix crash in kModeProcessNoContext
Bug: 22931143
Change-Id: I9897a28b1edd006aee67ae2343874ad92bbd15a0
2015-08-04 18:19:11 +00:00
John Reck
6d4d0db312 Disable skipping frames on empty damage
Bug: 22592975

Optimization added in MNC is not quite correct, occasionally
it will fail to repaint when it was supposed to leading
to buffer corruption. Disable the optimization for now.

Change-Id: I34dfdfb357eda298198043ded7335d4588a003fd
2015-08-03 22:47:49 +00:00
Chris Craik
730c0f6591 Merge "Fix stencil mask usage in HWUI" into mnc-dev 2015-07-30 19:30:58 +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
Adam Lesinski
5b0f1be0a2 AAPT: Fix printing of resource configurations
Print out proper, copied configuration. We add fields to ResTable_config
and if we don't copy and fill in defaults when reading old configurations,
we end up with garbage values. This can potentially cause a crash as well.

Bug:22773426
Change-Id: I64f5ebe73ee72453bcdad3a19e48f8e7ad58e9c2
2015-07-27 17:04:43 -07:00
John Reck
49dec430e8 Move updateMatrix() call to animateCommon
Bug: 22667315

HWUI internally always assumes that RenderNode->properties()
has a fully-baked matrix. However, RenderThread animations violate
this and will perform an update of that matrix after they run. This
was missing in the fallback scenario where an animation was
running on a View that is detached from the tree.

If a RenderThread animation is started on an attached view, it becomes
detached, and is then re-attached it will crash in the staging
properties push. The fix for this is to move the call to updateMatrix
from animate() to animateCommon() so that the animateNoDamage()
path will similarly perform the necessary matrix update.

Change-Id: I4c899a6f68659342a6515f1d7f20d3c4af65caf0
2015-07-23 22:37:21 +00:00
John Reck
2abf0f24af Fix a race condition that could cause lockup
Bug: 22676664

If a task is queued on a worker thread that is busy
processing a task AND a trim memory signal comes along
prior to the initial task being completed then the
tasks that were queued prior to the exit request will
never be processed.

This is bad, as when those futures are used later on, such
as in trying to delete them from the cache, they will block
waiting for the orphaned task to be finished.

Simple fix is to just never stop the worker threads. Increase
RAM usage slightly as we won't reclaim that stack space, but
this cost is fairly small

Change-Id: I818b011f9bc6ba06942fdad81c27656bd97b42d4
2015-07-23 17:34:14 +00:00
John Reck
00e79c9947 Mark isInUse per-window
Bug: 22509159
Change-Id: I0ae0f1fa582ee38dcb9f24ca20f0b4d0c57ccb32
2015-07-21 10:46:54 -07:00
Chris Craik
0bb5c26bce Merge "Fix AssetAtlas usage in BitmapShaders" into mnc-dev 2015-07-17 23:59:17 +00:00
Chris Craik
6ad690e16f Fix AssetAtlas usage in BitmapShaders
bug:22521999

Change-Id: I60859748ceee19ebc89ec98845e550ea26e36ecd
2015-07-17 15:53:24 -07:00
Chris Craik
8ce8f3f4d6 Fix clip area behavior for REPLACE op
bug:22291400

Work around clippath-clipped-to-view-bounds behavior by
implementing REPLACE op fast path, avoiding the transition to
SkRegion/SkPath.

Change-Id: I63c1cf961db2d6e3759d83914de1036c9ac7497a
2015-07-16 13:31:41 -07:00
John Reck
f2dcc2aecb Don't crash on makeCurrent fail
Bug: 22444755

WindowManager may decide to yank the surface at any point, so
attempt to kinda handle this

Change-Id: Id2f665d2f0f93bccd4ec977fbf52dca4dc1ec891
2015-07-16 09:17:59 -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
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
127b478ac6 Merge "Remove all usage of fmin and fmax" into mnc-dev 2015-07-08 01:53:57 +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
54d1f0439e Merge "Simplify matrix copy constructor/load" into mnc-dev 2015-07-07 19:09:43 +00:00
Chris Craik
d2bfcc74fc Simplify matrix copy constructor/load
bug:22208220

Change-Id: Id096eb8de8da0dd1687d6af9456b16ce2a1a589b
2015-07-07 10:09:35 -07:00
John Reck
be3fba05e8 Adjust for pipeline stalls
Bug: 20853441

Calculating duration that crosses the UI-RT
sync point will now subtract out the time spent waiting
in queue under the assumption that this time will be
accounted for in the previous frame's metrics

Change-Id: Ia8213f4410638840613f5ae439e98dfb77532a6a
2015-07-06 16:12:46 -07:00
John Reck
f70a5a78bb Merge "Set go-faster arguments" into mnc-dev 2015-07-01 23:52:20 +00:00
John Reck
d758033368 Merge "Use std::sort instead of quickSortX" into mnc-dev 2015-07-01 20:55:23 +00:00
John Reck
5600d579b9 Set go-faster arguments
Bug: 22208220

Increases performance of shadows by yet another
15% by using more aggressive math optimizations

Change-Id: Ie3fabeae3647632a19ff573bf6b2d7f7a7cef555
2015-07-01 13:51:44 -07:00
Chris Craik
d3ecb3e6f0 Merge "Switch from fminf/fmaxf to std::min/max" into mnc-dev 2015-07-01 18:10:33 +00:00
John Reck
1e4209e387 Use std::sort instead of quickSortX
Bug: 22208220

Libcxx has a really good sort algorithm, use that
instead. This speeds up shadow tesellation by about 10%.

Also less code

Change-Id: Iaad424187121d7644076f94ba8a3cf4c110da2f2
2015-07-01 09:54:47 -07: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
de25a672b1 Saturate alpha values when overlaying glyphs
bug:19062769

Glyphs were stored to the output buffer with the assumption of
non-overlap, which is incorrect for certain fonts/strings. Instead,
blend src into dst, so new glyphs don't clobber existing content.

Change-Id: I6e22037500e67d5348ee2a43d939416c23c4d1ea
2015-06-30 13:24:18 -07:00
Chris Craik
f8d25ea8eb Merge "Don't promote functors onto layers due to outline rect clipping" into mnc-dev 2015-06-26 20:28:36 +00:00
Chris Craik
b60d3e7856 Don't promote functors onto layers due to outline rect clipping
bug:21320333

Change-Id: Ie70982c88498395148dab6eaca861de66e6207ed
2015-06-25 17:15:17 -07:00
Tenghui Zhu
5daee1dc27 Merge "Limit dotProduct value to 1.0f, so acosf would not return NaN." into mnc-dev 2015-06-25 21:45:32 +00:00
Lazar Trsic
1240752c44 Limit dotProduct value to 1.0f, so acosf would not return NaN.
Cherry pick of b561f39d01c211425bfefaaa7b31ebe097e7ba79 from AOSP master.

Due to precision loss of float math, we sometimes get 1.000001f for
dotProduct. This causes NaN result from acosf() and floor() funcs.

At the moment, this does not cause any problems on ARM, as casting
NaN to int results in 0. On mips however (possibly on x86), such cast
gives INT_MAX, so crash occurs when trying to use the resulting value.

Change-Id: I8e0285a0306a65b8469d9f4885c19665066fc4c8
2015-06-25 14:22:13 -07:00
Yusuke Sato
0f61c7dcc4 Merge "Let findSupportedAbi and hasRenderscriptBitcode scan only relevant files" into mnc-dev 2015-06-25 17:34:01 +00:00
Chris Craik
6659ac77ed Merge "Avoid over-damaging layer area for multidraws" into mnc-dev 2015-06-24 17:58:01 +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
Tom Hudson
a81a0c8647 Merge "Sync canvas proxy CTM (b/21945972)" into mnc-dev 2015-06-24 14:53:58 +00:00
Tom Hudson
90fb1f6732 Sync canvas proxy CTM (b/21945972)
SkiaCanvasProxy was being created with an identity transform, ignoring
any transform that may have been applied in Java (or C++) to the
android graphics Canvas it was proxy for. This CL makes sure the
DisplayListCanvas transform is propagated to the Proxy every time
asSkCanvas() is called.

We could instead move the code to the SkiaCanvasProxy constructor
if we got rid of the cached proxy on DisplayListCanvas; nobody's
using the proxy heavily enough that that should be a performance
hit at this time.

BUG:21945972
R=djsollen@google.com

Change-Id: I99ed1563802a2449bb9939cb67976cd60dd8611c
2015-06-24 10:43:16 -04:00
Chris Craik
c686757a18 Merge "Unify clipping return value behavior - true if not empty" into mnc-dev 2015-06-24 00:12:51 +00:00
Chris Craik
5ec6a2878b Unify clipping return value behavior - true if not empty
bug:22035484

Change-Id: I23ecca38554a60c590181290900deb0e2c48cea1
2015-06-23 15:42:43 -07:00
Chris Craik
0d99d43e81 Merge "Dump GL errors and crash on failure to allocate texture for layer" into mnc-dev 2015-06-23 18:01:02 +00:00
Chris Craik
5686bae289 Dump GL errors and crash on failure to allocate texture for layer
bug:22029728

Change-Id: Ib6f778975225b36567b12e30967955640ec185b3
2015-06-23 10:34:54 -07:00
Yusuke Sato
34fe3df851 Let findSupportedAbi and hasRenderscriptBitcode scan only relevant files
for better performance. Without the optimization, these two functions
may check more than 100k file names in the pre-installed APK files,
which can take a few seconds to finish even on a recent device.

Bug: 21957428
Change-Id: I315fd3c6d5aa1076b993752525de449a9933de12
2015-06-22 16:11:32 -07:00
Chris Craik
772687d242 Avoid flushing DisplayListCanvas state for noop calls
bug:22006795

Change-Id: I2eceee69772b08f5319ea882be429a5b36860b7d
2015-06-22 14:51:18 -07:00
Narayan Kamath
4600dd053d ZipFileRO: Use precise widths for zip file types.
getEntryInfo crashes on 64-bit devices because "long" types
were being passed int pointers (that pointed to a stack frame)
that were reinterpret_cast'ed to long* (sigh.). To fix this issue
once and for all, use types with explicitly defined widths.

This change also removes some dead invariant checking from
Asset.cpp instead of cleaning it up.

Note that we've introduced a wart in NativeLibraryHelper, where
we need to deal with zlib's uLong type, which is "at least 32 bits
wide".

bug: 21622286

Change-Id: Iae675a9601db7aae03a8b80b40321d2cc1d97f50
2015-06-17 08:40:25 +00:00
John Reck
3f725f0a5a Fix null deref
Bug: 21857172

willHaveFunctor was assuming that either mStagingDisplayList
or mDisplayList would be non-null but this isn't true. Both
can be null in some scenarios (notably after a trimMemory)

Change-Id: Ia2915b84cfc907ec9c7cbec54ed6dc26283ec998
2015-06-16 10:29:31 -07:00
Chris Craik
4c9dafbfec Merge "Put WebViews with on a HW layer if stencil/shader clipping is needed" into mnc-dev 2015-06-12 22:46:21 +00:00
Chris Craik
eaef7b6cb1 Merge "Fix roundrect clipping / blending ordering" into mnc-dev 2015-06-12 21:23:23 +00: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
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
4e9d9b2a59 Revert to save-layer based alpha if layer would be too large
bug:21011574
Change-Id: I323f2398188ffc2bbed6a98578d25d7e5f6c337d
2015-06-12 11:07:23 -07:00