8675 Commits

Author SHA1 Message Date
Stan Iliev
9b21b970bc Merge "Fix pop-up shadow drawn in the wrong place with Skia pipeline" into oc-dev am: a5c6ba3473
am: 563c5d3643

Change-Id: I8a24e8d642d49cb4822db50bbf3b2fe6e5ec9122
2017-04-04 22:34:40 +00:00
TreeHugger Robot
9d64a418bb Merge "Optimize Canvas::drawGlyphs" 2017-04-04 21:36:10 +00:00
Stan Iliev
d7410f7829 Fix pop-up shadow drawn in the wrong place with Skia pipeline
Fix a bug in DrawShadow matrix calculation. Recorded matrix does
not need to be applied, because parent display lists have already
replayed matrix transformations.

Test: added a new HWUI unit test that is passing only after this fix
Bug: 33103723
Change-Id: I7a47dbe879df6b9e5920a47c0e1168d9902a3e70
2017-04-04 16:24:55 -04:00
Stan Iliev
0b58d99283 Optimize Canvas::drawGlyphs
Avoid one memcpy in Canvas::drawGlyphs for all pipelines.

Test: CTS passed with exception of SweepTests#testBasicDraws
shadowtext, which fails with and without this CL.
Change-Id: I0841232dc7a6173eb3b03f939dbde15a84186296
2017-04-04 15:43:12 -04:00
Derek Sollenberger
4d6141c297 Merge "Fix HWUI/Skia Gradients to premultiply the colors prior to interpolation" into oc-dev am: f9340ca491
am: d75510ab6f

Change-Id: Iffb6644220b68790553ca9fa08ab2e4b532e50cb
2017-04-04 19:33:52 +00:00
TreeHugger Robot
f9340ca491 Merge "Fix HWUI/Skia Gradients to premultiply the colors prior to interpolation" into oc-dev 2017-04-04 19:06:32 +00:00
Chris Craik
5d2e064ebf Merge "Revert "Switch libplatformproto to sharedlib"" into oc-dev am: eabb5621dd
am: f497ca5a2e

Change-Id: I0a7bf55e5614b5b8f380332c2cd43d7d14df4e66
2017-04-04 17:35:53 +00:00
Chris Craik
eabb5621dd Merge "Revert "Switch libplatformproto to sharedlib"" into oc-dev 2017-04-04 17:16:43 +00:00
Derek Sollenberger
669b15a935 Fix HWUI/Skia Gradients to premultiply the colors prior to interpolation
This is fixed in Skia by passing the appropriate flag when the shader is
generated.  The fix in HWUI is to reverse the premultiplication and
interpolation steps.

Test: bit CtsUiRenderingTestCases:.testclasses.ShaderTests
Bug: 34323783
Change-Id: I3417141949f62fcc696b6d8213a4b446d7d0cbf8
2017-04-04 12:07:28 -04:00
TreeHugger Robot
29e77fe359 Merge "Don't use deprecated canvas methods" 2017-04-04 15:09:45 +00:00
Mike Reed
6c9bb2408f Don't use deprecated canvas methods
Allows skia to remove SK_SUPPORT_LEGACY_CANVAS_HELPERS

Test: Existing tests cover the change.

Change-Id: I764c11f7a9bd7b87fba8563968160ee7dc9a99a2
2017-04-04 13:19:38 +00:00
Chris Craik
817b494739 Revert "Switch libplatformproto to sharedlib"
Bug:36847782

This reverts commit e5549d414c7231ee0037cf413dad17e28b8905ba.

Change-Id: I38f1c501b7e40be11ba5f0a7a50651e0c3e41fc5
2017-04-03 21:46:44 +00:00
TreeHugger Robot
7a41511805 Merge "Fix error in RenderNode unit test with Skia pipeline" 2017-04-03 20:56:48 +00:00
Mike Reed
6813635aea add temporary cast to allow Skia roll
Test: refactoring CL. Existing unit tests still pass.

Change-Id: I2e2a647bfad76af313db70d196566e01bf909fc8
2017-04-03 13:14:35 -04:00
Stan Iliev
25912c78f5 Fix error in RenderNode unit test with Skia pipeline
Fix failing RenderNode unit tests with Skia pipeline, caused by
TestUtils::syncHierarchyPropertiesAndDisplayList not walking past
root node.

Test: ran HWUI unit tests.
bug: 32507847
Change-Id: I7e64fb02fd8f4874eadacafcac7e9f1ae4e56365
2017-03-31 14:00:20 -04:00
TreeHugger Robot
62027f69c0 Merge "Add test configs to hwui tests" 2017-03-31 17:04:33 +00:00
John Reck
3c9c29ee38 Merge "Switch libplatformproto to sharedlib" into oc-dev am: 72c2760943
am: af39ba5d49

Change-Id: I73d9035f13f83c80045004867b4470779095d603
2017-03-30 17:32:00 +00:00
TreeHugger Robot
72c2760943 Merge "Switch libplatformproto to sharedlib" into oc-dev 2017-03-30 16:42:36 +00:00
TreeHugger Robot
b7a10e6b4a Merge "Add comments to clarify how SkDrawable dtor is called" 2017-03-30 15:14:53 +00:00
Romain Guy
427bb80ea8 Merge "Convert bitmaps to sRGB/scRGB when they have a color profile" into oc-dev am: 33813bd439
am: 6869c55106

Change-Id: I69b4e1ba160032255891fbb2656445badd5b936e
2017-03-30 01:53:07 +00:00
Romain Guy
33813bd439 Merge "Convert bitmaps to sRGB/scRGB when they have a color profile" into oc-dev 2017-03-30 01:42:32 +00:00
John Reck
e5549d414c Switch libplatformproto to sharedlib
libplatformprotos is really really unhappy if it gets
loaded twice into the same process which trivially happens
if it's a static library. Switch it to a shared library
instead to fix this.

Change-Id: I90297d076d0739bab683fbd9607d7fc0884a002d
Fixes: 36272398
Test: Ran hwui_unit_test, didn't crash
2017-03-29 18:41:27 -07:00
Adam Lesinski
93e8fa3fdc Merge "AAPT2: Parse an ID encoded as a map" into oc-dev am: c26ace0754
am: 719349cdb3

Change-Id: Icab08b15c92a8b88b7348e0caf61dba2f025de1b
2017-03-30 00:41:25 +00:00
Stan Iliev
f7aa6cdca1 Add comments to clarify how SkDrawable dtor is called
Document the 3 variants of SkDrawable object lifetime in
SkiaRecordingCanvas:
- The only drawable that is using ref couting to delete itself is
"LayerDrawable"
- 2 other drawables (RenderNodeDrawable and GLFunctorDrawable) are
deleted by std::deque
- the rest are deleted by ~LinearAllocator

bug: 36717955
Test: built and ran on device
Change-Id: I16f7f6573f6e4dc8d665f58d051255d40b1b690d
2017-03-29 18:25:12 -04:00
Adam Lesinski
33af6c730f AAPT2: Parse an ID encoded as a map
ID types should not be encoded as a map. AAPT and AAPT2 emit
IDs as boolean types.

Some apps exist that for some reason have their ID types encoded
as empty maps. This is the case only for the auto generated IDs
from enum values in <attr> tags.

Allow IDs as maps and ignore their content when processing an APK
for optimizing.

Also fixes an issue with expected size of the ResTable_package struct.

Bug: 35861796
Test: tested against the APK in b/35861796
Change-Id: I29a19cd9777bb10bed6766cd42e35e50e098797b
2017-03-29 20:11:04 +00:00
Romain Guy
caaaa66e57 Convert bitmaps to sRGB/scRGB when they have a color profile
This change also fixes an issue with RGBA16F bitmaps when modulated
with a color (for instance by setting an alpha on the Paint object).

The color space conversion is currently done entirely in the shader,
by doing these operations in order:

1. Sample the texture
2. Un-premultiply alpha
3. Apply the EOTF
4. Multiply by the 3x3 color space matrix
5. Apply the OETF
6. Premultiply alpha

Optimizations:
- Steps 2 & 6 are skipped for opaque (common) bitmaps
- Step 3 is skipped when the color space's EOTF is close
  to sRGB (Display P3 for instance). Instead, we use
  a hardware sRGB fetch (when the GPU supports it)
- When step 3 is necessary, we use one of four standard
  EOTF implementations, to save cycles when possible:
  + Linear (doesn't do anything)
  + Full parametric (ICC parametric curve type 4 as defined
    in ICC.1:2004-10, section 10.15)
  + Limited parametric (ICC parametric curve type 3)
  + Gamma (ICC parametric curve type 0)

Color space conversion could be done using texture samplers
instead, for instance 3D LUTs, with or without transfer
functions baked in, or 1D LUTs for transfer functions. This
would result in dependent texture fetches which may or may
not be an advantage over an ALU based implementation. The
current solution favor the use of ALUs to save precious
bandwidth.

Test: CtsUiRenderingTests, CtsGraphicsTests
Bug: 32984164
Change-Id: I10bc3db515e13973b45220f129c66b23f0f7f8fe
2017-03-28 18:35:49 -07:00
Dan Shi
6619d61697 Add test configs to hwui tests
Details about test configs changes are tracked in doc
https://docs.google.com/document/d/1EWUjJ7fjy8ge_Nk0YQbFdRp8DSHo3z6GU0R8jLgrAcw/edit#

The 3 tests are in the same folder, have to be built together then run.

Bug: 35882476
Test: local test
make -j32 hwui_unit_tests
make -j32 hwuimicro
make -j32 hwuimacro
tradefed.sh run template/local --template:map test=hwuimacro

Change-Id: I13f785d8e3215c61776a1beecaa121c7dc30bfec
2017-03-28 14:26:55 -07:00
Matt Sarett
7771386256 Merge "Add SkiaBehaviorTest for SkBlurDrawLooper" 2017-03-28 17:37:13 +00:00
TreeHugger Robot
cd56408bd9 Merge "Update VectorDrawables cache at frame start" 2017-03-28 13:35:53 +00:00
TreeHugger Robot
2c6ac0ead0 Merge "Add missing assert that task isn't queued" 2017-03-28 00:41:11 +00:00
TreeHugger Robot
55bea5e308 Merge "Add a few asserts for possible corruption cases" 2017-03-27 23:30:22 +00:00
Stan Iliev
23c38a9ed9 Update VectorDrawables cache at frame start
Draw VectorDrawables in GPU backed surface. Render VD cache
at the beginning of the frame to avoid context switching.

Test: CTS graphics tests pass.
Change-Id: Ia14e0ec4049c3fa87f03547fbda44043bf8dd793
2017-03-27 18:43:34 -04:00
John Reck
1b7184f8d2 Add a few asserts for possible corruption cases
Bug: 36502346
Test: builds & boots
Change-Id: Id96a26a30e4a8c6f51a68bf07cfe6bd6d07c244e
2017-03-27 14:47:46 -07:00
John Reck
2f944482ec Add missing assert that task isn't queued
Probably won't fix anything but this assert is in queue()
but not queueAtFront() and inserting a task twice is Really Bad.

Bug: 36139852
Test:  ¯\_(ツ)_/¯
Change-Id: Ida0f829eecfdd46c17c36b816528c49d12b7cf29
2017-03-27 21:38:09 +00:00
TreeHugger Robot
81ff6ee47a Merge "Register functor draw correctly" 2017-03-27 18:36:28 +00:00
Chris Craik
48f9bb6254 Register functor draw correctly
Bug: 36602041
Test: existing tests still pass

Change-Id: I9f385da89e9e49e562031578a02f13a68697e0df
2017-03-24 17:12:19 -07:00
TreeHugger Robot
bbf038bc5e Merge "Remove "Allow persistent changes to the vendor overlay theme"" 2017-03-24 22:25:20 +00:00
Matt Sarett
3d2135931c Add SkiaBehaviorTest for SkBlurDrawLooper
Test: This is a test.

Change-Id: Ib14087168300eea97b9188f134b1cea6c35b3858
2017-03-24 16:18:55 -04:00
Robert Phillips
3c01a07fff Update RenderNodeDrawableTests to new onNewImageSnapshot API
Test: does it compiles

Change-Id: I55e3d7e2e59bfde88357fd455fe567d07c8a26b7
2017-03-23 12:29:39 -04:00
Jason Monk
cc5a731fd7 Remove "Allow persistent changes to the vendor overlay theme"
This reverts commit 2dc804be11444565e3d1d151c2a693db3ade94c0.
It also removes the related calls from UiModeManager.

Fixes: 32721178
Test: make & flash
Change-Id: Id371bccec611155cc6910e46b3277c3d27fc1c79
2017-03-23 11:25:59 -04:00
Yunlian Jiang
442c8226aa Merge "Fix warning: Potential leak of memory pointed to by 'set'" am: 58ba53bd53 am: 0889a8a070
am: 2b53748a21

Change-Id: Icec70d3e3efef0eea9c117911821dfd05bcb2ced
2017-03-22 00:36:30 +00:00
Yunlian Jiang
0889a8a070 Merge "Fix warning: Potential leak of memory pointed to by 'set'"
am: 58ba53bd53

Change-Id: I7186dc35fb7f4a3c226e35447ce9c748164e7bf8
2017-03-22 00:21:57 +00:00
Treehugger Robot
58ba53bd53 Merge "Fix warning: Potential leak of memory pointed to by 'set'" 2017-03-22 00:17:33 +00:00
Robert Phillips
d9770c3c6c Update SkiaPipelineTests.cpp to use new onNewImageSnapshot signature
Test: code compiles & test continues to succeed

https://skia-review.googlesource.com/c/9882/ (Remove budgeted parameter 
from SkSurface::makeImageSnapshot (take 2)) seems to have stuck so this 
should be safe to land.

Change-Id: I9e6fdcc8debe7964e9522f7acd8829b54bc90986
2017-03-21 15:33:33 +00:00
TreeHugger Robot
2c64d5739b Merge "Modify VectorDrawable to scale path through canvas matrix" 2017-03-21 13:29:24 +00:00
Adam Lesinski
1f4497c9c0 Merge changes I8c710af6,Iedf30212
* changes:
  libandroidfw: Fix mass logspam of ResourceTypes warnings
  NativeActivity JNI: Retain VM reference to AssetManager
2017-03-21 03:54:16 +00:00
Adam Lesinski
ed69ce84bd libandroidfw: Fix mass logspam of ResourceTypes warnings
An overlay was incorrectly leaking its own resources into the
framework resource package, which caused warnings for every app
that tried to access framework resources (all of them).

This change skips including any resources that are not overlaying
anything (not present in IDMAP).

Bug: 36256974
Test: make libandroidfw_tests
Change-Id: I8c710af6849bb848938825aacca02799ee96c003
2017-03-20 14:51:13 -07:00
TreeHugger Robot
da3ab1a2dd Merge "use SkVertices::Builder in drawBitmapLattice override new virtual onDrawVerticesObject" 2017-03-20 19:23:08 +00:00
Stan Iliev
cc29a5dde1 Modify VectorDrawable to scale path through canvas matrix
Apply the path matrix to the canvas instead of creating a new path.
Delete logic that scales the stroke, because this is done through
the matrix as well. Merge/delete some functions.

Bug: 36392701
Test: CTS graphics tests pass with minor changes in 6 golden images.
Quick settings and settings app drawables are OK. Vector icon app
draws identical paths.
Change-Id: If623bc0a535fad95a2839f79bd997c016bcd9d4d
2017-03-20 11:49:51 -04:00
Ben Wagner
95502300ef Merge "Use access directly instead of sk_exists." 2017-03-20 14:17:56 +00:00