8665 Commits

Author SHA1 Message Date
John Reck
2de950d5a8 Overhaul RenderNode's DisplayList management
* Move mValid to native
* Have destroyHardwareResources destroy everything
* Remove flaky mParentCount checks in setStaging
* All tree updates have an internal observer to
  ensure onRemovedFromTree() is a reliable signal
* onRemovedFromTree() immediately releases resources
  to avoid displaylist "leaks"

Test: Unit tests for validity added & pass, manually
verified that b/34072929 doesn't repro

Bug: 34072929

Change-Id: I856534b4ed1b7f009fc4b7cd13209b97fa42a71c
2017-01-25 12:24:40 -08:00
TreeHugger Robot
f54c76399a Merge "use new clipbounds api" 2017-01-25 16:40:37 +00:00
Mike Reed
5e43898231 use new clipbounds api
Allows us to remove SK_SUPPORT_LEGACY_GETCLIPBOUNDS flag

Change-Id: I7c6665b4eb67c58fe747c07b8b87d58fe9b10120
2017-01-25 13:26:41 +00:00
TreeHugger Robot
68eb1ac342 Merge "Follow minikin::FontFamily constructor signature change." 2017-01-25 07:05:50 +00:00
Mårten Kongstad
6bb13da278 Fix memory leak during idmap creation
Plug a memory leak in AssetManager::createIdmap.

Bug: 31052947
Test: use Valgrind and dummy native app
Change-Id: I83af3a40516ed2d50d5a7c8ee175ed960fde9933
2017-01-24 20:26:51 -08:00
TreeHugger Robot
e84ad491c8 Merge "Add color mode to activity/window" 2017-01-25 01:20:28 +00:00
Romain Guy
4832745b84 Add color mode to activity/window
The color mode lets an application request a wide color gamut for
a specific window. This will also be used in the future to request
HDR. The color mode is currently either default (sRGB) or an undefined
wide gamut color space chosen by the platform. These attributes could
later be used to choose a specific color space if we deem this important
or useful.

This change also renames the various "colorimetry" attributes and
constants to "color mode" for consistency. These symbols were
added in O and can be safely renamed.

Test: CtsColorModeTestCases
Bug: 32984164
Change-Id: I4d4691dd12dbe3f3aa6a5cf893cff39aa16c739e
2017-01-24 15:55:09 -08:00
Matt Sarett
02b0d40547 Merge "Fix renderOverdraw() test" 2017-01-24 22:49:43 +00:00
TreeHugger Robot
4f2a40ac9f Merge "Revert "Workaround libmemunreachable lockup"" 2017-01-24 19:49:55 +00:00
John Reck
efa38e38fb Revert "Workaround libmemunreachable lockup"
This reverts commit 553ae6ab071b1db5e783c8c02f9311b4969729f6.

Change-Id: I593b78f7073d84a5e16372849d27e943af65694c
Fixes: 34586922
2017-01-24 18:13:03 +00:00
Matt Sarett
341480bef5 Fix renderOverdraw() test
I'm not sure why this test was modifies, but this
restores the test to the original version, which passes.

Test: Passes unit test

BUG:34467659

Change-Id: I6699cf13d4b69301d57fa0cec9b24093e8263ba7
2017-01-24 09:05:39 -05:00
Seigo Nonaka
8b48e62445 Follow minikin::FontFamily constructor signature change.
This is 2nd attempt of Id10ca97f6f6f5bbe4999c1ad2736423a204d6e87.
The root caus of crash is due touching null pointer in nUnrefFamily.
After above change, native object may not be created on error case.
In that case, nUnrefFamily can not be called. In addition to this issue
there is also memory leak on error case. This fixes it by introducing
abortCreation method.

Also this contains fix of layout lib breakage done by jgaillard@.
Originally submitted by Ic8872a43993bcb0a157c5e3f0ce423af9b47f606

Here is original commit message of reverted change.

minikin::FontFamily no longer has addFont function, instead it accept
vector of Fonts in its constructor. To follow this signature change,
holding minikin::Font instance in native and build minikin::FontFamily
instance in FontFamily.freeze() method.

Bug: 34042446
Bug: 28119474
Bug: 34378805
Test: hwui test has passed
Test: m layoutlib layoutlib-tests
Change-Id: Ic34ebaa8191273d4c9f49c43124f15a1da5f7b78
2017-01-24 15:10:29 +09:00
TreeHugger Robot
2ba96eced0 Merge "Add tests for b/34598346" 2017-01-23 23:46:00 +00:00
John Reck
47aa8d1477 Add tests for b/34598346
Test: unit test passes
Bug: 34598346
Change-Id: I7e5144aa875e42487718059cc06b86e32db28702
2017-01-23 14:07:53 -08:00
TreeHugger Robot
65e8f0adf3 Merge "Workaround libmemunreachable lockup" 2017-01-23 21:16:55 +00:00
TreeHugger Robot
2d31375d94 Merge "Remove all calls to SkCanvas::getClipStack from HWUI unit tests" 2017-01-23 20:37:16 +00:00
John Reck
553ae6ab07 Workaround libmemunreachable lockup
Bug: 34586922
Test: hwui_unit_tests completes
Change-Id: Ia55f7bc49faf8a32624e2f16e2477eb12a261b07
2017-01-23 11:06:46 -08:00
Stan Iliev
c1db0e0ff7 Remove all calls to SkCanvas::getClipStack from HWUI unit tests
Refactor HWUI unit tests to not invoke SkCanvas::getClipStack,
because this Skia API is going to be deprecated.

Test: Build and ran sailfish-eng. Ran HWUI unit tests.
Change-Id: Iac277aa26fbe9e2a0860cde2dd43732ed1c4c4e3
2017-01-23 13:47:35 -05:00
John Reck
51c51df46c Add missing nothingToDraw() check
Fixes: 34598346

Prior to 2874daa4d38bddd3a5f0edb3774d5e5884dd9554 we
never freed the resources of root nodes. Now that this is being
done we need to ensure that the backdrop has content before
we try to draw that content. All other nodes passed in
deferRenderNodeScene check that nothingToDraw() returns false
before drawing them, but that check was missed on the backdrop
node.

Test: manual. open calculator then long-press on recents
Change-Id: I495749161b38b57278bdb60d5f872eeeb2b218d0
2017-01-23 10:26:28 -08:00
TreeHugger Robot
27be018934 Merge "Refactor GLFunctorDrawable to use new SkCanvas API for clip region" 2017-01-20 14:31:41 +00:00
TreeHugger Robot
a9da39cb64 Merge "Add wide color gamut and HDR resource qualifiers" 2017-01-20 04:10:04 +00:00
Romain Guy
c9ba559021 Add wide color gamut and HDR resource qualifiers
Bug: 32984164
Test: Config_test, AaptConfig_test and aapt2_tests
Change-Id: Ie9c82bfe2d36b1d6180ee223250ab5bb2ce90dd4
2017-01-19 18:44:00 -08:00
Siyamed Sinir
c0d685b87a Revert "Follow minikin::FontFamily constructor signature change."
This reverts commit a0a4828614edfd633ab86f04408e7f4e55b491dd.

Bug: 34378805
Change-Id: Icbdbfbde2efe8eaebbe4334a679e3b3247057388
2017-01-20 02:01:25 +00:00
Siyamed Sinir
24fac986ec Merge "Revert "Introduce set/getFontVariationSettings."" 2017-01-20 01:59:52 +00:00
Siyamed Sinir
a3b9f2e3c6 Revert "Introduce set/getFontVariationSettings."
This reverts commit ba3028c1fc9fca2d45acc841557da2c9a83923bf.

Bug: 34378805
Change-Id: I8250c87af5d65fb45789632580be4ae1b8711372
2017-01-20 01:13:23 +00:00
TreeHugger Robot
1f9f11007d Merge "Move StringPiece to libandroidfw" 2017-01-19 23:40:06 +00:00
Stan Iliev
98d251b10e Refactor GLFunctorDrawable to use new SkCanvas API for clip region
Refactor GLFunctorDrawable::onDraw to get SkCanvas clip region
with new Skia API (getClipStack is going to be deprecated).

Test: Built and ran angler-userdebug. Ran CTS WebView clip tests.
Change-Id: Ia11e3f3d64d5c33802b7a8f296f213ef39a69905
2017-01-19 18:08:38 -05:00
Roozbeh Pournader
2d00c0952e Merge "Update locale data from in-tree ICU" 2017-01-18 17:03:35 +00:00
Greg Daniel
57b8eb3da0 Merge "Update hwui_unit_tests to support running with Vulkan backend." 2017-01-18 16:13:04 +00:00
Greg Daniel
98c78dad19 Update hwui_unit_tests to support running with Vulkan backend.
Added Macros for RENDERTHREAD_TESTS which run these tests using specific backends.
RENDERTHREAD_TESTS - Runs OpenGL, SkiaGL, and SkiaVulkan
RENDERTHREAD_SKIA_TESTS - Runs SkiaGL and SkiaVulkan
RENDERTHREAD_OPENGL_TESTS - Runs OpenGL

Test: manual running of hwui_unit_tests

Change-Id: Ia7420ee7a38803a15e2d58394d14b38cae8208d3
2017-01-18 09:12:31 -05:00
Adam Lesinski
d5083f6f6b Move StringPiece to libandroidfw
libandroidfw needs to make use of StringPiece, so
move it to libandroidfw and update all code referencing
StringPiece in aapt2.

Test: make libandroidfw_tests libaapt2_tests
Change-Id: I68d7f0fc7c651b048d9d1f5e7971f10ef5349fa1
2017-01-17 18:55:51 -08:00
Adam Lesinski
fdaa9c58c9 Merge "New implementation of AssetManager/ResTable" 2017-01-17 23:58:36 +00:00
Ben Wagner
1a6cd84d64 Merge "Remove SkDevice.h includes." 2017-01-17 17:10:05 +00:00
Roozbeh Pournader
9bddb48413 Update locale data from in-tree ICU
Also add back script information for Yiddish old code (ji) that was
removed in ICU.

Bug: 26756576
Test: none
Change-Id: Ia785f86bf0407aeed6134ef9d44e504494256da2
2017-01-13 17:37:04 -08:00
Roozbeh Pournader
4115c64313 Treat Latin American locales specially
am: cf246af30d

Change-Id: I98ff3b1774e6cc3511fcd296d9cec5ccfce03c40
2017-01-14 01:10:25 +00:00
Zak Cohen
9013325c3a Merge changes from topic 'vrmode'
* changes:
  Set ui mode in UiModeManagerService to vrheadset when VR mode is enabled.
  Introduce new UI_MODE_TYPE_VR_HEADSET and qualifier.
2017-01-13 23:15:00 +00:00
Ben Wagner
c2d9470aa9 Remove SkDevice.h includes.
SkDevice.h is being removed from Skia. This removes these already unused
includes which mention this file.

Test: refactoring CL. Existing unit tests still pass.

Change-Id: I8340a5822ad2b75c54fe0dca1303ceab9bbee805
2017-01-13 17:03:13 -05:00
Roozbeh Pournader
cf246af30d Treat Latin American locales specially
Due to legacy reasons, Android translations of European Spanish were
kept under 'es', while Latin American Spanish translations were kept
under 'es-US'. The combination of this, and the new locale
preference rules in Nougat, resulted in 'es' winning over 'es-US' for
all Latin American locales, since 'es' was a direct ancestor, while
'es-US' was just a fallback.

The changes in Nougat had assumed that app developers would put Latin
American Spanish translations under 'es-419', but that could create a
backward-compatibility problem under older Android versions that did
not support three-digit region codes properly.

This CL keeps the Nougat logic and its locale parent tree, but
special-cases es-US and es-MX to be treated as equivalents of es-419
in cases where they are present and es-419 is not.

Bug: 31545805
Bug: 34126460
Test: unit tests are included
Change-Id: Iab26f41294587ee044685a5a6560520c7cbb06f7
(cherry picked from commit a192a8ced65ceea8bfe44f0eac6a394cbf80d936)
2017-01-13 01:54:01 +00:00
Roozbeh Pournader
383ac409df Merge "Treat Latin American locales specially" 2017-01-13 01:53:15 +00:00
Mark Salyzyn
6f773a0d87 Replace cutils/log.h and android/log.h with log/log.h
Test: compile
Bug: 34250038
Change-Id: I42185a879beaa9bb244f53a968800392b854ac45
2017-01-12 20:29:11 +00:00
Ben Wagner
610fbb3afd Merge "Use FatVector instead of SkAutoMalloc in VulkanManager." 2017-01-12 18:41:51 +00:00
Mark Salyzyn
22221f6981 Merge "resolve merge conflicts of ec7e2a164c37 to master" 2017-01-12 17:23:01 +00:00
Ben Wagner
eec27d51d2 Use FatVector instead of SkAutoMalloc in VulkanManager.
Skia is looking to make SkAutoMalloc private and will be moving it.
Using FatVector instead will make this code both less dependent on Skia
internals and more performant.

Test: refactoring CL. Existing unit tests still pass.

Change-Id: If9de10059775b75e1ab89078eacede2e20e91299
2017-01-12 11:52:31 -05:00
Mark Salyzyn
173215d1b2 resolve merge conflicts of ec7e2a164c37 to master
Test: compile
Bug: 26552300
Bug: 31289077
Change-Id: I49c6e41b79061e2b3c0352e3ac8fa5ebb152b6f5
2017-01-12 08:28:30 -08:00
Mark Salyzyn
ec7e2a164c Merge "Replace cutils/log.h and log/logger.h with android/log.h or log/log.h (part deux)" am: 2225a0640b am: d1740f0f5b
am: 6dacea63d9

Change-Id: Ife229cc450dbbb5f43941fcd1b08b86f0e41a779
2017-01-12 15:59:48 +00:00
Mark Salyzyn
6dacea63d9 Merge "Replace cutils/log.h and log/logger.h with android/log.h or log/log.h (part deux)" am: 2225a0640b
am: d1740f0f5b

Change-Id: I78430cd21cf1186ccc2b48ee4ee8a9b07decde5e
2017-01-12 15:46:20 +00:00
Seigo Nonaka
ba3028c1fc Introduce set/getFontVariationSettings.
This CL enables developers to specify axis values to the underlying
font collection. The specification of the font variation settings is
the same as the CSS font-variation-settings attribute in CSS working
draft as of 2016-11-30.

Code example: Here is an example to set width 100 and weight 1.5.

  TextView tv = (TextView) findViewById(R.id.textView);
  tv.setFontVariationSettings("'wdth' 100, 'wght' 1.5");

Bug: 33062398
Test: Manually done. Ran FrameworksGraphicsTests, CtsGraphicsTestCases
      and CtsWidgetTestCases
Change-Id: I249d464f8cdaa56017a987588b94ed685aadeb58
2017-01-12 18:11:03 +09:00
TreeHugger Robot
e4e375c749 Merge "Follow minikin::FontFamily constructor signature change." 2017-01-12 07:43:53 +00:00
Adam Lesinski
da431a22da libandroidfw: Add new support for shared libraries
This adds support for shared resource libraries in the new
ResTable/AssetManager implementation.

The dynamic package map encoded in resources.arsc is parsed
and stored with LoadedArsc, and combined to form a resolved table
in AssetManager2.

Benchmarks show that this implementation is an order of magnitude
faster on angler-userdebug (make libandroidfw_benchmarks).

Test: libandroidfw_tests
Change-Id: I57c80248728b63b162bf8269ac9495b53c3e7fa0
2017-01-11 17:20:36 -08:00
Roozbeh Pournader
a192a8ced6 Treat Latin American locales specially
Due to legacy reasons, Android translations of European Spanish were
kept under 'es', while Latin American Spanish translations were kept
under 'es-US'. The combination of this, and the new locale
preference rules in Nougat, resulted in 'es' winning over 'es-US' for
all Latin American locales, since 'es' was a direct ancestor, while
'es-US' was just a fallback.

The changes in Nougat had assumed that app developers would put Latin
American Spanish translations under 'es-419', but that could create a
backward-compatibility problem under older Android versions that did
not support three-digit region codes properly.

This CL keeps the Nougat logic and its locale parent tree, but
special-cases es-US and es-MX to be treated as equivalents of es-419
in cases where they are present and es-419 is not.

Bug: 31545805
Bug: 34126460
Test: unit tests are included
Change-Id: Iab26f41294587ee044685a5a6560520c7cbb06f7
2017-01-11 15:52:08 -08:00