Commit Graph

8909 Commits

Author SHA1 Message Date
John Reck
d2080d52b3 Quick fix: Make incorrect animator usage a warning
Change-Id: I6d59033433a63d02be746bb8523b312d7c8fe9fa
Bug: 65160121
Test: Repro from bug doesn't repro anymore
2017-09-25 23:27:38 +00:00
TreeHugger Robot
a6aafa33ec Merge "Speculative fix for missing target crash" into oc-mr1-dev 2017-09-22 22:41:59 +00:00
Tenghui Zhu
dbe5afd90d Merge "Add systrace for VectorDrawable inflation and draw" into oc-mr1-dev 2017-09-22 19:45:17 +00:00
ztenghui
3d30ca1d3c Add systrace for VectorDrawable inflation and draw
We didn't trace the draw from cache.
Here we add trace for draw into bitmap, which is normally heavy.

fix: 65060698
Bug: 65060698
Test: run test app and get systrace and check

Change-Id: Ia81127c4aa285b3277e9c9edbdf356d85cb28b5e
(cherry picked from commit cf0c41dbc2)
2017-09-22 19:44:24 +00:00
Dake Gu
88dd458c9a Merge "hwuitest: added hwui test for TV application" into oc-mr1-dev 2017-09-22 19:26:42 +00:00
Chris Craik
89cd62c8f3 Speculative fix for missing target crash
Bug: 66451158
Test: manual app usage

Change-Id: I2db3aa73edcb80da25ead64205011705f0beef91
2017-09-22 10:00:14 -07:00
Dake Gu
bec4a06812 hwuitest: added hwui test for TV application
This is a test that simulates a standard TV application screen.

The UI elements:
A full screen background bitmap.
Few rows of cards.
Each card has a bitmap and an info area.
Info area has two lines text.
Each card is dimmed, implemented in two modes:
1. adding translucent color RenderNode on top of card
2. applying ColorFilter to bitmap.
Firt card of each row is scaled up and has shadow.

The animations:
Cards are updating translation Y and updating display list
and overlay color alpha or colorfilter.

Test: there are four tests:
tvapp: baseline test, with rounded corner, use Color RenderNode to dim
tvapp_norc: no rounded corner
tvapp_cf: use colorfilter to dim
tvapp_norc_cf: no rounded corner, use colorfilter to dim

Bug: 64990221

Change-Id: I385e349386c41e32b7313180db8c81b8f3e39f88
2017-09-20 17:42:03 -07:00
John Reck
5206a871dc Remove all FATAL_IFs from graphicsstats service
As graphicsstats can be subjected to data coming
from the disk and is in system_server we want
to bias towards best-effort instead of strict
no-errors that the rest of HWUI typically uses.

So treat any dump/merge of graphics stats as
best effort, ignoring any errors that occur.

Bug: 65652900
Test: verified 'dumpsys graphicsstats' still works

Change-Id: Ia9b91b745c2a9aedad2f22e3087e1d4bf37a1135
2017-09-18 12:55:17 -07:00
John Reck
f138b174fd Fix flicker from multiwindow resize
Move content bounds into DrawFrameTask. This ensures
that changes in bounds are synchronized with changes in
rendering commands, avoiding potential underdraw.

Bug: 64200212
Test: Repro steps in bug. Drag up/down on resize handle, verify
no flicker.

Change-Id: I3109acf262e23c2a7d8904f1dcbfc8273aaed65b
2017-09-08 11:00:42 -07:00
Chris Craik
01ed792ade Add test for first draw blend behavior in HWUI pipeline
Bug: 65077146
Test: BakedOpRendererTests
Change-Id: Ia3139a01fe25344a19f2b947069bd686303b9fd5
2017-09-01 14:39:18 -07:00
Chris Craik
e47aadd9b8 Fix blending behavior with first draw op
Bug: 65077146
Test: Manual - uirendering tests don't allow test draw content
to be displayed first.

It's not always valid to disable blending on the first draw to the framebuffer,
since some blend modes affect the framebuffer in different ways. We now only
disable blending if the op is SRC_OVER to be safe.

For example:

    canvas.drawColor(0xfeff0000, PorterDuff.Mode.CLEAR);
    canvas.drawColor(Color.BLUE, PorterDuff.Mode.DST_OVER);

The BLUE should always be seen - the other draw should just clear the buffer.
Prior to this fix, the above code (put in a window background) would draw black.

In addition, this removes the disable behavior in drawRects(), since that should
never benefit from the optimization - that decoration is always drawn at the end
of a frame.

Change-Id: I34e8d9d62d6e1dfa00e9301f44c277475f2940a8
2017-08-31 17:45:39 -07:00
Arun
530a2b44d9 Disable hwui blending for first draw to main FBO
bug:34809371

In some applications, the first draw is not opaque - either because the
application is misbehaved, or because hwui is not able to reliably tell
whether the layer is opaque or translucent. This is undefined behaviour
in OpenGL ES and has a significant performance and bandwidth impact on
some tiler GPUs as it requires loading the previous frame's color data.
This change disables blending in that case and also for effectively
opaque blend modes (SRC=GL_ONE, DST=GL_ZERO). It increases performance
by ~10% for Leanback CTS on some low-end GPUs (gradient layer that hwui
incorrectly believes to be translucent).

Test: manual - visual inspection on fugu (nexus player)

Change-Id: I2cbf1c76678acae1a36923e72fd18ed55cd89dc2
2017-08-18 16:52:55 -07:00
Seigo Nonaka
7cc3ee7091 Adjust font texture cache based on device density.
The main purpose of this CL is reducing font cache size of
low-density device.

The memory usage for the small RGBA texture will be
Nexus 6P: 7,928,856 bytes (1408x1408)
Nexus 5X: 4,734,976 bytes (1088x1088)
These used to be 4,194,304 bytes

Test: manually checked
Bug: 64400885
Change-Id: Ied064a6d59909ad7fbeff74332973206436fbd34
2017-08-15 10:53:20 -07:00
John Reck
642ebea6e1 Delete all ro.hwui.* props
Remove all ro.hwui.* tuning props and instead
calculate them from the screen resolution.

Or just hardcode them to what all devices
were hardcoding them to anyway.

Bug: 63741221
Test: Check cache size results on sailfish

Change-Id: I8b0d210572a246f4fefb076935cf5156a70c274c
Merged-In: I8b0d210572a246f4fefb076935cf5156a70c274c
(cherry picked from commit 8dc02f99d0)
2017-08-10 17:22:43 +00:00
John Reck
679e7f1dfc Add check that layer size <= maxTextureSize
Ensure that RenderNode fitsOnLayer() is true before assigning
it a layer.

Bug: 63814070
Test: repro steps in bug no longer crash
Change-Id: I28bb2cb173a5efde24e2384f2606fea85b394ac8
2017-08-02 16:15:24 -07:00
Seigo Nonaka
065c59beaf Revert "Implement family fallback." DO NOT MERGE
This reverts commit 0d253e46aa.

The original CL changed Typeface internal methods and broke
TypefaceCompatApi26Impl in support library which uses reflections.
Ideally, TypefaceCompatApi26Impl must fall back to public API
implementation but due to lack of method availability check, it ended up
crashing the application.

The original patch didn't change any behaviors in MR1, so reverting
that change is the best solution for MR1.

Bug: 64033594
Change-Id: Ie86afeb1b809e57915d62c1db5a70c8d210d2354
Test: N/A
2017-07-26 22:21:14 +00:00
TreeHugger Robot
25cefd1096 Merge "Fix use-after-free" 2017-07-19 21:56:47 +00:00
TreeHugger Robot
71b257b5f4 Merge "Fix Skia pipeline readback for non-portrait mode" 2017-07-19 13:37:19 +00:00
TreeHugger Robot
8709b82c4d Merge "Improve color correctness for drawing bitmaps with Skia pipeline" 2017-07-19 13:25:27 +00:00
Stan Iliev
0a3ff952a6 Improve color correctness for drawing bitmaps with Skia pipeline
Fix drawing of bitmaps with color profiles. This CL is making
ColorSpaceTests and Rgba16fTests CTS tests to pass with Skia
pipeline. Drawing bitmaps withs pixels outside SRGB range
may need more work (ColorSpaceTests#testDrawDisplayP3 test use a
a wider gamut, but the actual pixels fall into the SRGB range).

Test: Ran CtsUiRenderingTestCases with HWUI and Skia pipeline.
Bug: 62347704
Change-Id: I8d318076bb38f7d32bfde7e5492ae7a61f4731a5
2017-07-19 09:22:39 -04:00
TreeHugger Robot
5c936fcfd3 Merge "Fix incorrect asserts" 2017-07-19 12:44:52 +00:00
TreeHugger Robot
ebb1121573 Merge "Appease the static analyzer" 2017-07-19 02:36:04 +00:00
TreeHugger Robot
62302c1fa4 Merge "Remove references to (unused) colortables" 2017-07-19 02:18:58 +00:00
TreeHugger Robot
3a15f392ae Merge "Cache VectorDrawables in an atlas" 2017-07-19 01:02:32 +00:00
George Burgess IV
fa4eaa63ca Appease the static analyzer
Since the static analyzer assumes that
`head == blockToRemove && blockToRemove->prevBlock == nullptr` may be
true, it complains that we're deleting `head` and returning `head`
shortly afterward.

Assert (without assertions, since -DNDEBUG is passed) that this isn't
the case.

Bug: 27101951
Test: mma. Warning is gone.
Change-Id: I33e98eec7b293fcf0d8826f89c287a3b870758f2
2017-07-18 17:21:28 -07:00
George Burgess IV
09c00f25af Fix use-after-free
Since putOrDelete may delete the layer, we shouldn't be accessing its
member after calling it.

Caught by the static analyzer:

frameworks/base/libs/hwui/renderstate/OffscreenBufferPool.cpp:183:44:
warning: Use of memory after it is freed

Bug: 27101951
Test: mma. Static analyzer warning is gone.
Change-Id: I25ee8b45ede608da52bf58d1d9f52ce3bb60d4cb
2017-07-18 17:00:06 -07:00
Stan Iliev
3310fb1b24 Cache VectorDrawables in an atlas
Optimize VectorDrawables for Skia pipeline: draw small VectorDrawables
in a GPU atlas instead of seprate offscreen buffers.
This implementation is using CacheManger and allows for the atlas to
be released if there is a memory pressure.

Test: A new unit test for VectorDrawableAtlas is passing. Systrace shows
0.5ms faster DrawFrame for fling in Settings app main screen.
Change-Id: Ide3884eefae777e1547f1dfdb67b807185839fb4
2017-07-18 19:00:15 -04:00
Stan Iliev
df6520efd7 Fix Skia pipeline readback for non-portrait mode
Apply correctly the image transform matrix passed to
SkiaOpenGLReadback::copyImageInto.
This is fixing 13 of 14 failing android.view.cts.PixelCopyTest
tests (the last failing test is caused by missing wide gamut
support).

Test: Ran CtsViewTestCases CTS tests for Skia and HWUI pipelines.
Bug: 63629735
Change-Id: I67fb06968e21f9aa88973c076870b5557f15d483
2017-07-18 17:25:55 -04:00
Mike Reed
81397c4787 Remove references to (unused) colortables
Test: make

Change-Id: Ia1b20b3229bdad8c2dcc8594c9dd22f44c8f529e
2017-07-18 17:04:20 -04:00
Stan Iliev
18b388d67b Fix incorrect asserts
Fix a few Skia asserts, which prevent HWUI from compiling and
running when SkDebug is defined.

Test: Built and ran Android on device.
Change-Id: Ie7f16016ba105e1d376c266c5b030e4bc04629d9
2017-07-18 16:41:48 -04:00
Roozbeh Pournader
e2393ae726 Merge "Make strike-through respect kerning at boundaries" 2017-07-14 02:17:43 +00:00
Roozbeh Pournader
1378a9d72c Make strike-through respect kerning at boundaries
Also clean up lower-level drawing of strike-through in Cavas.cpp.

We still cannot use the strike-through information from the font
since Skia doesn't provide it, so we are going with the default
values.

Test: Manual
Test: bit CtsTextTestCases:*
Test: adb shell am instrument -w -e package android.text com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Bug: 32907446
Change-Id: Iee6f8102a35eba0ff4127dbbef189529ab573e6d
2017-07-13 13:21:00 -07:00
Seigo Nonaka
6fef520af5 Merge "Implement family fallback." 2017-07-13 20:02:29 +00:00
Seigo Nonaka
0d253e46aa Implement family fallback.
Introduce new attribute "fallbackFor" to font element.
By specifying name of the family to this attribute, that font is used
when the developer specifies the font family.
For example, if fonts.xml has the following family entry,
  <family lang="ja">
    <font fallbackFor="serif">NotoSerifJP-Regular.ttf</font>
    <font>NotoSansJP-Regular.ttf</font>
  </family>
the Japanese text is rendered by NotoSansJP-Regular.ttf by default.
Then, if developer specifies fontFamily="serif" in TextView, the Japanese
text is rendered by NotoSerifJP-Regular.ttf.

Bug: 37328609
Bug: 31491668
Test: bit FrameworksCoreTests:android.graphics.TypefaceSystemFallbackTest

Change-Id: I2744db7384c8056795e841c88b387545434131f4
2017-07-13 10:47:48 -07:00
TreeHugger Robot
3542ec3724 Merge "Revert "AAPT2: Auto-version adaptive-icon XML"" 2017-07-12 19:52:13 +00:00
Greg Daniel
1f01222bfe Merge "Update to use GrBackendTexture/RT instead of Descriptors" 2017-07-12 18:30:37 +00:00
Greg Daniel
ac2d232f21 Update to use GrBackendTexture/RT instead of Descriptors
Test: manual testing

Change-Id: Ide727a39e2c49f226c8d432608e0072214249451
2017-07-12 11:48:00 -04:00
Leon Scroggins III
f51a80d2b0 Remove more references to kIndex_8
Test: Covered by existing tests. No actual change in behavior, since
kIndex_8 is not being used anyway.

Bug: 62483967

Change-Id: I317e3a814dbd102925fe412d2e19111b0af3af38
2017-07-12 11:27:19 -04:00
Adam Lesinski
bb94f32a00 Revert "AAPT2: Auto-version adaptive-icon XML"
This reverts commit 5b7337f77c.

Bug: 63579299
Test: none
Change-Id: Ib617c4edfc16eeae3507b59b2debeae4f8bbf9a5
2017-07-12 07:42:01 -07:00
Romain Guy
26b6a64953 Use EGL_EXT_gl_colorspace_scrgb instead of *_linear
Since hwui output non-linear scRGB data in wide-gamut, use
the scRGB-nl extension instead of scRGB.

Bug: 62951776
Test: Manual, CtsGraphicsTestCases
Change-Id: Ifdb288e777d12b790b93624ccea9b4f1f6966e52
2017-07-11 09:48:28 -07:00
Adam Lesinski
fba0cf2950 AAPT2: Fix processing of quotes in XML
When processing attributes in XML, quotes can't be used to mark a
section as whitespace preserving, so the assumption should be that the
entire string is whitespace preserving, which makes quote characters
literals.

Bug: 62840718
Bug: 62840406
Test: make aapt2_tests
Change-Id: I4afff02148b5b8e78833abf1f323c2f5325d6155
2017-07-07 13:23:55 -07:00
TreeHugger Robot
3a38fb3e5c Merge "Add missing notifyPixelsChanged" 2017-07-07 03:07:26 +00:00
John Reck
abbedfc84f Add missing notifyPixelsChanged
Fixes: 63400947
Test: CTS test PixelCopyTest#testReuseBitmap
Change-Id: Iad6fe331f84415528c1858a1fdbf26bce784cd53
2017-07-06 23:01:39 +00:00
John Reck
f211cc462e Update LeakChecker debug log
Test: manual
Change-Id: I3c2f8c77dba2955d5cebb1c3d511411350e18850
2017-07-06 12:52:51 -07:00
John Reck
34781b2530 Move frame history into jank tracker
Test: hwui_unit_tests & manual
Change-Id: If761947652750640268217cd8cd97c8382441b44
2017-07-05 16:48:09 -07:00
John Reck
7075c79209 Split out jank data from policy
Move ProfileData out to its own file with helper
accessors. This keeps policy (what is/isn't jank)
outside of the data storage.

Also use lambdas to iterate over the histogram
to make it nicer for dumping & proto-ifying.

Test: hwui_unit_tests pass & jank data still dumps

Change-Id: I88488369ec77590a2867f51128e65bb786aa34e6
2017-07-05 14:04:51 -07:00
Adam Lesinski
2fa4a346ec Merge "AAPT2: Auto-version adaptive-icon XML" 2017-06-30 01:12:35 +00:00
John Reck
0fb794b13e Merge "Merge "Selectively disable filtering if estimated safe" into oc-dev am: 38c97237e3 am: dfce81961d" into oc-dr1-dev-plus-aosp
am: 2b17d4d4c0

Change-Id: Ie041acbd829b618e3a6d69de0462165c334816f7
2017-06-29 02:34:40 +00:00
John Reck
d814ac8e70 Merge "Selectively disable filtering if estimated safe" into oc-dev am: 38c97237e3
am: dfce81961d

Change-Id: I8bf7663f2f5aecf22fc83304e09dc7d7f5cc1028
2017-06-29 02:20:55 +00:00
John Reck
dfce81961d Merge "Selectively disable filtering if estimated safe" into oc-dev
am: 38c97237e3

Change-Id: Ic3be7167429e8cd6a291ac0465e883522afcf9e3
2017-06-29 02:13:18 +00:00