Commit Graph

9210 Commits

Author SHA1 Message Date
Leon Scroggins III
671cce2605 Make ImageDecoder return animated Drawables
Bug: 63909536
Bug: 63908092
Test: TODO

If ImageDecoder.decodeDrawable is called with an animated image Source
(currently GIF or WebP), return an object of a new (hidden) Drawable
subclass. The new Drawable animates, and it implements Animatable (TODO:
implement Animatable2) so users have some control over the animation.

In addition to the normal features of Drawable, this new one supports
many of the features of ImageDecoder, including scaling, cropping and
PostProcess, which enables circle masks/rounded corners and other
arbitrary after-effects. It does *not* support decoding directly to a
Hardware Bitmap, since it cycles through frames and reuses the same
bitmap memory. But it could be made to use shared memory (TODO?).

TODO: Use a better number for the native allocation registry
TODO: Use the RenderThread to drive the animation, and remove decoding
on the UI thread.
TODO: Add support for modifying the loop count

Android.bp:
- build new AnimatedImageDrawable.cpp

AndroidRuntime.cpp:
- register new native methods

AnimatedImageDrawable.java
AnimatedImageDrawable.cpp:
- new Drawable that handles animated images

Canvas.h, SkiaCanvas.h/.cpp
- New virtual method and implementation for drawing SkAnimatedImages

RecordingCanvas.h/.cpp
- Stub implementation of drawing SkAnimatedImages

ImageDecoder.h/cpp
- Allow code sharing with AnimatedImageDrawable.cpp
  - postProcess
  - access the ImageDecoder struct

Depends on https://skia-review.googlesource.com/c/skia/+/94660 in Skia.

Change-Id: Ie2ec98d9c52deda4d439c6ef8e5dea2861bb93a3
2018-01-17 17:06:57 -05:00
TreeHugger Robot
600ebac26b Merge "Create an empty stub for Vulkan readback" 2018-01-12 21:03:24 +00:00
Stan Iliev
a31973fe3a Create an empty stub for Vulkan readback
Create a stub for Vulkan readback. This avoids crashing,
because OpenGL readback does not work for Vulkan.

Test: Ran calc and gmail apps with skiavk pipeline.
Change-Id: I11cddde0a1efae1aa549e7a47d01051ec975f470
2018-01-12 11:50:29 -05:00
Sami Kyostila
682a4e75f8 Merge "base: Convert libs/services/Android.mk into a blueprint" 2018-01-12 11:03:23 +00:00
Stan Iliev
c6c96dd86d Improve correctness of SkiaCanvas::drawLayoutOnPath
Align glyph to a tangent touching SkPath in the midle of the
symbol. Previously wrong tangent crossing the path at the
beginning of the glyph was used.

Test: Ran the test app attached to the bug
Bug: 71525360
Change-Id: I310394d11e185de314f66a6b332f804188e42ed9
2018-01-11 14:44:51 -05:00
Sami Kyostila
4389e6bc2d base: Convert libs/services/Android.mk into a blueprint
Convert libs/services/Android.mk into a blueprint module so it can be
linked by other blueprint modules.

Test: mmm frameworks/base
Change-Id: I7acf9aa084d262a5aba5a58e45d9647e15c6dffb
2018-01-11 11:53:15 +00:00
TreeHugger Robot
d53121899c Merge "Remove error log messages when skia shader cache is disabled" 2018-01-09 23:05:48 +00:00
Stan Iliev
ba72f9a288 Remove error log messages when skia shader cache is disabled
Ideally processes with a render thread, would turn on shader
caching, but system_server is an exception.

Test: checked logcat for ShaderCache not initialized messages
Bug: 71718344
Change-Id: I5d4df6ae912a6fec3f019c9c831a1177937ea53b
2018-01-09 15:59:35 -05:00
Yi Jin
3c034c987e Implement a new type of section which reads from logd and dumps proto.
And implement a file section which reads from event-log-tags for
decoding binary logs.

Bug: 70936599
Test: atest incidentd_test && atest incident_helper_test and flush on
device and test log sections and event_log_tag_map
Change-Id: Ib3d35e317f355de69f01ded012482486e9a43da6
2018-01-06 20:33:14 -08:00
Stan Iliev
ec08381261 Refactor TestUtils::drawUtf8ToCanvas usage in macrobench tests
Set text encoding inside TestUtils::drawUtf8ToCanvas and use
TestUtils::drawUtf8ToCanvas instead Canvas::drawText.
This CL is a follow-up of ag/3287411.

Test: Ran macrobench tests
Change-Id: I1b2f014d17f26ccc8fbdae9cfeea4ac25fd4c51f
2018-01-03 15:30:37 +00:00
Ivan Lozano
0e603f03e6 Merge "Fix doFadingAnimationLocked in sanitized builds." 2017-12-21 18:29:00 +00:00
Adam Lesinski
c243f23e25 Merge "IDMAP: Warn when RROs overlay non-overlayable resources" 2017-12-20 00:50:58 +00:00
Adam Lesinski
5c693f2b82 Merge "AAPT2: Propagate SPEC_OVERLAYABLE flag to final APK" 2017-12-19 22:42:53 +00:00
Ivan Lozano
7ee0dba095 Fix doFadingAnimationLocked in sanitized builds.
The loop as constructed causes i to overflow twice when i = 0 on integer
overflow sanitized builds.

 runtime error: unsigned integer overflow: 0 - 1 cannot be represented
 in type 'size_t' (aka 'unsigned long')

 runtime error: unsigned integer overflow: 18446744073709551615 + 1
 cannot be represented in type 'size_t' (aka 'unsigned long')

This refactors the loop to avoid the overflows.

Bug: 30969751
Test: Compiles, device boots, enabled pointer location overlay.
Change-Id: I844bb3b84b1f536c50d06fb489fcc22590d4aa98
2017-12-19 08:17:31 -08:00
TreeHugger Robot
81bfe137d0 Merge "Remove IIncidentReportCompleted and gmscore WW module would listen to android.intent.action.DROPBOX_ENTRY_ADDED and look up incident tag then upload the report." 2017-12-19 02:30:28 +00:00
Adam Lesinski
a9743826bd IDMAP: Warn when RROs overlay non-overlayable resources
First pass at getting overlays to respect which resources should be
overlaid. First step is to call it out but not enforce.

Bug: 64980941
Test: manual (inspect the warnings at boot)
Change-Id: I40baee1110d4bc1e54e7f2f9d3b73ffabb067f90
2017-12-18 17:25:27 -08:00
Elliott Hughes
d2cafca090 Merge "Private API became public..." am: eb44ebbfcd am: 85fc4d6dd6
am: 746a738276

Change-Id: Ifb1fd8dc812d160cd998ba23371e0cfff0c43adb
2017-12-19 00:50:31 +00:00
Adam Lesinski
71be70507d AAPT2: Propagate SPEC_OVERLAYABLE flag to final APK
Resources can be marked as overlayable, which means they can
be overlaid by runtime resource overlays.

This change propagates this state to the final resource table that
is installed on device.

Future work:
- Have the idmap tool respect the overlayable state and ignore
  entries that overlay anything else.

Bug: 64980941
Test: make aapt2_tests
Change-Id: Id45b1e141a281be2ee32a4ac3096fcf1114d523b
2017-12-18 14:16:02 -08:00
John Reck
0e89ca2088 Log daveys
Bug: 70339576
Test: Checked that it logged with a lower threshold
Change-Id: I271f8af2a3ee63769edc71291b70f19512974d78
2017-12-15 17:00:58 -08:00
Elliott Hughes
7c2107b1fa Private API became public...
...but is now automatically called by the Context constructor.

Bug: N/A
Test: builds
Change-Id: Ic78bc4561adfec5047ed45589b8b936c506bd2b2
2017-12-15 16:24:25 -08:00
Yi Jin
26ac0306ad Remove IIncidentReportCompleted and gmscore WW module would
listen to android.intent.action.DROPBOX_ENTRY_ADDED and look up
incident tag then upload the report.

Bug: 69860192
Test: N/A
Change-Id: I7f60ad631e8b3243e209aba9408f18bf0bfd4750
2017-12-15 15:35:34 -08:00
Elliott Hughes
ceb1fa2284 Minimal reformat to match internal master.
Internal master SHA 1bcacfdcab reformats
this entire project. To be able to update google-benchmark I need to
make a small change to this file. This is the minimal change that avoids
merge conflicts.

Bug: N/A
Test: builds
Change-Id: If3568a0f59a7c007858435953e127167f5862825
2017-12-15 10:37:01 -08:00
Joe Onorato
c9f1a9e3dd Merge "Fix how we build the statsd protos." 2017-12-14 05:33:33 +00:00
Joe Onorato
62c220b20b Fix how we build the statsd protos.
This lets us include frameworks protos, and use the constants
and messages from them.

Change-Id: I609d6e524f780e6a5beea543a68561bede47813e
Test: make
2017-12-13 18:26:45 -08:00
TreeHugger Robot
7129b1ef83 Merge "SkPixelSerialize is deprecated (and unneeded in this case)" 2017-12-13 20:50:13 +00:00
Dan Albert
3fe9d790df Merge "Include what we use." am: b0efcc1f68 am: afa15b0846
am: 83a1241e5a

Change-Id: I829bad9fe74620b40599eeba745743679e04eba6
2017-12-13 20:18:57 +00:00
Treehugger Robot
b0efcc1f68 Merge "Include what we use." 2017-12-13 19:38:38 +00:00
Mike Reed
ebf96fbed7 SkPixelSerialize is deprecated (and unneeded in this case)
Test: make

Change-Id: Icc421586de82a516cb5e32b60949315d1108a9a3
2017-12-13 13:44:13 -05:00
Rob Herring
4ee4d20908 renderthread: relax error handling for wide gamut EGL configs
It is valid to advertise EGL_EXT_pixel_format_float, but not have a
the requested EGL config. Instead of aborting, fallback to the default
behavior.

Change-Id: I6c602233b627dc2070364434fece57d3d0aab435
Cc: Romain Guy <romainguy@google.com>
Signed-off-by: Rob Herring <robh@kernel.org>
2017-12-13 14:30:21 +00:00
Rob Herring
74883abde3 renderthread: relax error handling for wide gamut EGL configs
It is valid to advertise EGL_EXT_pixel_format_float, but not have a
the requested EGL config. Instead of aborting, fallback to the default
behavior.

Change-Id: I6c602233b627dc2070364434fece57d3d0aab435
Cc: Romain Guy <romainguy@google.com>
Signed-off-by: Rob Herring <robh@kernel.org>
2017-12-12 16:41:27 -08:00
Dan Albert
9b6a62f94c Include what we use.
Test: mma
Bug: None
Change-Id: I9458aedad9a84f1660d3a2b08717b111dc8e3b74
Exempt-From-Owner-Approval: trivial cleanup
2017-12-12 16:08:11 -08:00
TreeHugger Robot
6295c422a2 Merge "Update graphics stats to use long version codes." 2017-12-12 04:20:46 +00:00
Dianne Hackborn
73453e49d5 Update graphics stats to use long version codes.
Bug: 64459786
Test: manual
Change-Id: Iab84727e0ac486f505c10aacdb5ec8871aaf121e
2017-12-11 16:30:36 -08:00
Stan Iliev
e12d7315dd Enable fast drawing for solid color nine patch rectangles
Pass a hint to Skia, about which lattice rectangles are solid
color rectangles.

Bug: 69796044
Test: Measured ninepatch performance using sample app from the bug
Change-Id: Ib07b1b64c78ab16195f9af88a989d28682084565
2017-12-11 18:22:17 +00:00
Greg Daniel
1f397705eb Merge "Update GrContext creation calls to use sk_sp" 2017-12-11 18:03:36 +00:00
Greg Daniel
660d6eca99 Update GrContext creation calls to use sk_sp
Test: manual testing

Change-Id: I68d8706ffa7bc7c6622ea0b8c45d7297a131f6bf
2017-12-11 09:39:16 -05:00
TreeHugger Robot
7ccbd94cbf Merge "Turn on PGO for hwui" 2017-12-08 23:19:39 +00:00
TreeHugger Robot
e8b7642ff4 Merge "Optimize Outline::setRoundRect" 2017-12-08 18:35:02 +00:00
Stan Iliev
f563833993 Optimize Outline::setRoundRect
Reuse Outline internal memory if the new shape has the same
memory requirement as the previous outline.

Bug: 69849202
Test: Ran APCT, setOutline_mean decreased from ~1400 to ~1000
Change-Id: Ie0185d22122c3c17cb001316ff5a19a833f18f05
2017-12-08 11:38:35 -05:00
Doris Liu
ad6c1ed8bc Merge "Private API to turn off anti-aliasing for VectorDrawable" 2017-12-07 21:11:49 +00:00
TreeHugger Robot
a232b53975 Merge "Update VectorDrawables to use Skia's drawArc implementation." 2017-12-07 18:57:13 +00:00
Zhizhou Yang
58e1b782be Turn on PGO for hwui
This patch is to turn on PGO for hwui. PGO for hwui was turned off for
now because skia, a very important dependency of hwui, was not compiled
with PGO at that time. This patch will be committed along with the patch
to turn on PGO for skia, so that we could get the best performance
improvement.

According to our test, turning on PGO for hwui only introduces an
performance improvement of 5.5%, while with skia PGO turned on, the
improvement increases to 7.6%, both on hwui benchmarks.

Bug: http://b/63768402
Test: None
Change-Id: I17af2cce8e7991aeb89d8bd14ef2e40e6d1049b6
2017-12-06 16:59:06 -08:00
John Reck
9f51644abf Extreme battery saver: Allow lowering framerate for experiments.
Bug: 68769804
Test: manual
Change-Id: Ic0c95f32c7ba6d86a997997e480e6d8a5f228f25
2017-12-06 13:59:19 -08:00
Derek Sollenberger
12f9b06642 Update VectorDrawables to use Skia's drawArc implementation.
Using Skia enables drawArc to issue conic draw calls as well as
fixes some of the issues around a scaled path containing a drawArc
being reported as concave.

Bug: 69622768
Test: hwui_unit_tests
Change-Id: I4faab5403ec4ee34e1ad6fae256ae9ad3c6bb05b
2017-12-05 15:39:30 -05:00
TreeHugger Robot
af807e02d0 Merge "Allocate textures in multiples of LAYER_SIZE." 2017-12-05 17:17:33 +00:00
Derek Sollenberger
03e6cff7a6 Allocate textures in multiples of LAYER_SIZE.
This matches the behavior of the old HWUI renderer and avoids
jank when trying to release a series of small textures.

Test: UiBenchJankTests #testResizeHwLayer
Bug: 69566781
Change-Id: Idc01f8438e85d4810032fd30a141132a6cdd47a1
2017-12-05 10:41:07 -05:00
Doris Liu
6b184d7a43 Private API to turn off anti-aliasing for VectorDrawable
Bug: 69322344
Test: visual inspection on VectorDrawableTest with AA off. Jagged edges
      that are otherwise smooth were spotted.

Change-Id: Ib2dfbd3a941be0b4ff92b8458346f8c8f5015a4b
2017-12-04 16:31:07 -08:00
Adam Lesinski
498f6053da libandroidfw: Remove pre-verification
This added more up-front cost to loading an APK and didn't provide
a significant benefit to resource retrieval.

Test: make libandroidfw_tests
Change-Id: Idbf993abc433fa8c8950d106c66469b310b66f7f
2017-12-05 00:29:38 +00:00
Adam Lesinski
62b4ddd524 Merge "libandroidfw: Add SparseEntry support for LoadedArsc" 2017-12-05 00:11:43 +00:00
TreeHugger Robot
a18d357251 Merge "Switch RenderThread to a Java daemon thread" 2017-12-04 19:43:44 +00:00