8703 Commits

Author SHA1 Message Date
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
Mike Reed
871cd2dd60 use SkVertices::Builder in drawBitmapLattice
override new virtual onDrawVerticesObject

Test:  CtsGraphicsTestCases

Change-Id: I38e3ee0aa2a1ee9c11474c2c5d648ee5fca20d78
2017-03-20 08:40:12 -04:00
Adam Lesinski
10eb1455b9 Merge changes from topic 'configForSplit'
* changes:
  libandroidfw: Search all packages for an identifier
  AAPT2: Finish support for feature splits
  Add support for configForSplit
2017-03-17 23:19:13 +00:00
Ben Wagner
3aeda5c5c4 Use access directly instead of sk_exists.
Skia would like to move SkOSFile and make it private spi. This appears
to be the only place SkOSFile is used outside Skia, and using access
here directly is more apropriate.

Test: Simple inline refactor, built and ran. Changes test code only.
Change-Id: Ib76c180bb3bccc54c20dcadc842837e3e8270929
2017-03-17 17:22:01 -04:00
Derek Sollenberger
08153e655a Merge "Remove usage of deprecated makeImageSnapshot parameter Test: Does it compile?" 2017-03-17 00:41:16 +00:00
Adam Lesinski
0e25d9ae77 libandroidfw: Search all packages for an identifier
In order to allow multiple packages with the same package name, but
different package ID, we need to keep searching packages until the
resource is found.

Bug: 30999713
Test: make libandroidfw_tests
Change-Id: If4540e12731ca18a18e9e550a9bf248606a586c5
2017-03-16 15:45:16 -07:00
TreeHugger Robot
f596ba9375 Merge "Bowing my head in shame, going back to gamma interpolated gradients" 2017-03-16 21:15:15 +00:00
Romain Guy
6183c97e5f Bowing my head in shame, going back to gamma interpolated gradients
Frankengradients (linearly interpolated RGB, gamma interpolated alpha) look
fantastic but unfortunately create sligh compatibility issues. For instance,
a gradient from 0xffea1030 to 0x00ea1030 (opaque to alpha, with a single
color) blended on top of 0xff101010 would not look the same as a single
opaque gradient from 0xffea1030 to 0xff101010. The difference is hardly
noticeable on simple gradients but it could cause confusion amongst app
developers. Their life is hard enough as it is, let's be good to them.

My crusade against the gamma world is not over and one day I shall
be the victor. I am patience.

Bug: 35485208
Test: UiRendering.ShaderTests, UiRendering.GradientTests, manual testing
Change-Id: I8204e60cdf0a6b12dfe22638d30ca9622687000e
2017-03-16 12:29:03 -07:00
Robert Phillips
cd2eb91c40 Remove usage of deprecated makeImageSnapshot parameter
Test: Does it compile?

Change-Id: Ia51ad621daa3409f65b2f3e4d5691891271918a2
2017-03-16 19:13:39 +00:00
TreeHugger Robot
9e8f05f77d Merge "Improve dithering of alpha gradients" 2017-03-16 17:41:43 +00:00
Romain Guy
0d86d7ebc2 Improve dithering of alpha gradients
Bug: 32984164
Test: CtsUiRenderingTestCases
Change-Id: Ic728725845befd3c52cc7b043d5c6f8e33fcfcd2
2017-03-15 20:38:11 -07:00
Mathias Agopian
26fddcd742 Get rid of LinearTransform
A copy of LinearTransform is moved here.

This reverts commit b80f086f69a4bc2e51d1f94ae58d7ba6b20514c4.

Test: compile/run
Bug: treble cleanup
Change-Id: I435cac1f57ded10d434e4354985ad1a1bd3841f3
2017-03-15 14:19:40 -07:00
TreeHugger Robot
402a384ac8 Merge "Pass FontCollection to doLayout's argument instead of ctor" 2017-03-15 17:34:21 +00:00
Seigo Nonaka
51218e80f7 Pass FontCollection to doLayout's argument instead of ctor
Test: minikin_unit_tests
Test: minikin_stress_tests
Bug: 36223724
Change-Id: I55aca62eab4df0c138fec764d616984b50bd73f1
2017-03-14 16:56:10 -07:00
Chris Craik
95e8afbb5e Merge "Revert "Change behavior of setBitmap to cleanly reset the canvas - identity matrix - no save stack - wide-open clip"" 2017-03-14 23:35:29 +00:00
Tony Mantler
4f641d1e45 Revert "Change behavior of setBitmap to cleanly reset the canvas - identity matrix - no save stack - wide-open clip"
https://buganizer.corp.google.com/issues/36218535

This reverts commit 269f989fbf198b17994baf9141c4640aeaf34b4e.

Change-Id: Ib2473e4fce90c9abaa39eea2b77082ae26197b80
2017-03-14 22:40:31 +00:00
Ian Pedowitz
b73ea72723 Merge "Revert "remove LinearTransform from libutils"" 2017-03-14 08:15:42 +00:00
Ian Pedowitz
b80f086f69 Revert "remove LinearTransform from libutils"
This reverts commit d4d6167f614a9001d9827a8634a26b5e9445a22c.

Bug: 36206160
Test:  Fugu compiles, didn't before the revert
Change-Id: I2b0d3a05546ee2605555a9aa7ae028f2baeaf439
2017-03-14 08:11:32 +00:00
TreeHugger Robot
a813413a6e Merge "remove LinearTransform from libutils" 2017-03-13 22:06:15 +00:00
Mathias Agopian
d4d6167f61 remove LinearTransform from libutils
this was the only client.

Test: compile
Bug: cleanup for treble
Change-Id: Ibe2308d5fffb18c398db47e27d0123d629f675fe
2017-03-13 13:36:52 -07:00
TreeHugger Robot
9b0a5d1919 Merge "use _deprecated suffix for deprecated clipops" 2017-03-13 19:19:34 +00:00
Mike Reed
a0a74d5f8e use _deprecated suffix for deprecated clipops
Allows skia to remove legacy flag for older names
- SK_SUPPORT_EXOTIC_CLIPOPS
- SK_SUPPORT_LEGACY_CLIPOP_EXOTIC_NAMES

Test: CtsGraphicsTestCases

Change-Id: I78478d94d059641a9381579cae6d28f9f0685ad1
2017-03-13 17:38:16 +00:00
TreeHugger Robot
1965d2898c Merge "Change behavior of setBitmap to cleanly reset the canvas - identity matrix - no save stack - wide-open clip" 2017-03-13 17:33:05 +00:00