Commit Graph

3222 Commits

Author SHA1 Message Date
Tobias Thierer
07efe116b1 Merge "Framework: Prefer android.system.Os over libcore.io.Libcore.os"
am: 5f04db96b3

Change-Id: If85216d03022708787a7218e494434453d5548e3
2017-10-19 14:25:12 +00:00
Tobias Thierer
6217e37d30 Framework: Prefer android.system.Os over libcore.io.Libcore.os
This is a pure refactoring with no a behavior change other than
that these calls now go through android.system.Os, which immediately
delegates to Libcore.os.

This is a first step towards separating framework (via
android.system.Os) vs. libcore (via Libcore.os) clients of these
low level APIs. Separating these is a prerequisite towards moving
the API parts of android.system into framework, and moving the
rest into a different package in libcore.

Test: Treehugger
Bug: 67901714

Change-Id: Ifd8349ec5416e5693f40dba48fdf2bef651b7d81
Merged-In: Ifd8349ec5416e5693f40dba48fdf2bef651b7d81
2017-10-18 14:53:57 +01:00
Selim Cinek
15733d1f85 Reducing bitmap sizes in notifications
Bitmap sizes could be arbitrary large when they were sent
over to the system. We're now reducing them to reasonable
sizes.s

Also fixed that notification bitmaps were not put into
ashmem anymore since it got lost in a refactor.

Test: code inspection
Bug: 62319200
Merged-In: I87db7656e749666b9eab1f67fd497f155c407e18
Change-Id: I87db7656e749666b9eab1f67fd497f155c407e18
2017-07-19 18:06:09 +00:00
Selim Cinek
fdc84a13a2 Merge "Fixed an issue where the shelf could be hidden" into oc-dr1-dev 2017-07-03 10:46:35 +00:00
Selim Cinek
707e2072c8 Fixed an issue where the shelf could be hidden
During reinflation, the panel could be stuck in
a bad state where qs edit mode was on but not
visible. QS edit now persists through reinflations.

Test: manual
Change-Id: I6e7a20fda2db2184a26a11093064a1367469ab45
Fixes: 62807612
2017-06-30 18:40:53 +02:00
Hyunyoung Song
dba9934fb7 AdaptiveIconDrawable should not update layer bounds when bound is empty
Test: build succeeds. Also, setting tint mode does not result in error.

Bug: 37682281
Change-Id: I5991b8e58514a2130a793a5edb90baeafae9b148
2017-06-28 00:13:15 +00:00
Chris Craik
f65e92d9f9 Use NativeAllocationRegistry for ColorFilter
Bug: 62994689
Test: bit CtsGraphicsTestCases:*

Change-Id: Icea01fa7d4c6e78f3a93434de64bc8ddfe0c7a0e
2017-06-26 21:33:47 +00:00
Doris Liu
7bbb50e21d Merge "Better error message for AVD" into oc-dev
am: cabf9cdc2e

Change-Id: I6e63b81fd2168780d23a88d7340812b55db98497
2017-06-07 19:40:53 +00:00
Doris Liu
cabf9cdc2e Merge "Better error message for AVD" into oc-dev 2017-06-07 19:31:14 +00:00
John Reck
4ee3fb4c54 Merge "Clear native shader when Paint shader changes" into oc-dev
am: d3e78478aa

Change-Id: I7d96db34b1894e1064116b830a8fb159ad4c57b0
2017-06-07 16:49:12 +00:00
John Reck
fbff7117ab Clear native shader when Paint shader changes
Since Recents never goes away that means TaskViewThumbnail
never goes away which in turn means mDrawPaint never goes away.

mDrawPaint has a setShader(null) called on it to release
the BitmapShader it was previously drawn with, but that
change didn't push down to native until the next time the
paint was used. As a result, the Paint held on to a
reference to the bitmap.

The fix is simple, when the shader is changed simply
push down an immediate clear of the native shader. Since
the bitmap of a BitmapShader isn't changeable we don't
need to worry about clearing references for shader mutation,
merely when Paint#setShader() happens.

Bug: 38258699
Test: Open & close recents, observe EGL memory immediately returns
to sub-5MB.

Change-Id: I6742efa8ae8dfca76b62a06bc1a1a00646feba64
2017-06-06 12:14:04 -07:00
Roozbeh Pournader
fd8c22d513 Move underline thickness and position computation to Paint
Also, in TextLine, fix underline color and thickness to come from the
underline info rather than the TextPaint object.

Bug: 32907446
Bug: 62353930
Test: Manual
Test: cts-tradefed run cts-dev --module CtsTextTestCases
Test: cts-tradefed run cts-dev --module CtsWidgetTestCases
Change-Id: I259e9cf635a7056ccd367baa77c03100c69e3b98
2017-06-05 15:57:14 -07:00
Doris Liu
03f2fcbd88 Better error message for AVD
Moved the error checking to an earlier stage of the AVD, so that
the error message can contain more information.

BUG: 36571432
Test: Follow the repro step in b/36244835, the error message
      is much clear now.

Change-Id: Ibc6a0e666cc4c23c3dfa589755a77a015da2db1c
2017-06-05 15:51:18 -07:00
Roozbeh Pournader
cc4f086c94 Merge "Make underlining spans independent of actual class" 2017-06-05 17:30:27 +00:00
Roozbeh Pournader
538de5bb3b Make underlining spans independent of actual class
Previously, we had singled out UnderlineSpan for special treatment
for proper kerning at span boundaries. That had the limitation that
any other span that used underlining, or even subclasses of
UnderlineSpan were not getting the fix.

With this CL, we actually look at all the effects of applying a
span's updateDrawState() and if the changes were only in underlining,
we merge the pieces and call handleText() on the merged chunk of
text.

Change-Id: I829162c758192b80594f164d1105699224b627ba
Bug: 32907446
Test: cts-tradefed run cts-dev --module CtsTextTestCases
Test: cts-tradefed run cts-dev --module CtsWidgetTestCases
Test: manual
2017-06-01 16:45:33 -07:00
TreeHugger Robot
2a3220b247 Merge "graphics: Icon: use Arrays#equals for byte array comparison" 2017-06-01 20:31:50 +00:00
Peter Qiu
335a6e0f74 graphics: Icon: use Arrays#equals for byte array comparison
Bug: 62258815
Test: build

Change-Id: I95b7b7b663a8067aea40f36944003901afd8988c
2017-06-01 10:45:56 -07:00
Seigo Nonaka
0ee11e3f7e Merge "Fix NPE and wrong behavior of Typeface.isSupportedAxes" into oc-dev am: 633b32be55
am: bc790383d2

Change-Id: Ie308baed43bf39394949e2fa9fc1ebab1dc98e65
2017-05-31 00:27:12 +00:00
TreeHugger Robot
633b32be55 Merge "Fix NPE and wrong behavior of Typeface.isSupportedAxes" into oc-dev 2017-05-30 23:58:11 +00:00
Roozbeh Pournader
a63794c9cc Merge "Update Paint#mFontVariationSettings in set() and reset()" into oc-dev am: d865c624bd
am: 1ee4894e6c

Change-Id: I6c9bff56660ec6b6bddc48da9f629a571c7fe2d6
2017-05-30 21:35:50 +00:00
TreeHugger Robot
d865c624bd Merge "Update Paint#mFontVariationSettings in set() and reset()" into oc-dev 2017-05-30 21:15:20 +00:00
Seigo Nonaka
ffae6c7f71 Fix NPE and wrong behavior of Typeface.isSupportedAxes
The Typeface kept by Paint object can be null if nobody calls
setTypeface. The null typeface is equivalent to the Typeface.DEFAULT.
To check whether the passed axis is usable for Typeface.DEFAULT, we
need to pass Typeface.DEFAULT to isSupportedAxes if no typeface was set
on the Paint.

At the same time this CL fixes an issue in isSupportedAxes.
If the requested axis is listed in the first element of axes list,
isSupportedAxes returned false due to wrong handling of binarySearch
result.

Bug: 62146672
Bug: 62147012
Test: am instrument -w -e class android.graphics.cts.PaintTest
android.graphics.cts/android.support.test.runner.AndroidJUnitRunner

Change-Id: I7c154adfe8a19d6ed24ad645df7c10cee7880461
2017-05-30 13:40:49 -07:00
Hyunyoung Song
d04970da5d Merge "Merge "Fix safezone and getAlpha b/38361276 Test: frameworks/base/core/tests/coretests/src/android/graphics/drawable/IconTest.java" into oc-dev am: cca181bfbb" into oc-dev-plus-aosp
am: fa5f8fa8a8

Change-Id: I11d97f6c553882c0fb2423c1a62ee540378fcd25
2017-05-25 23:52:25 +00:00
TreeHugger Robot
cca181bfbb Merge "Fix safezone and getAlpha b/38361276 Test: frameworks/base/core/tests/coretests/src/android/graphics/drawable/IconTest.java" into oc-dev 2017-05-25 22:55:56 +00:00
Hyunyoung Song
ac2f74e80e Fix safezone and getAlpha
b/38361276
Test: frameworks/base/core/tests/coretests/src/android/graphics/drawable/IconTest.java

Change-Id: I3e1c73276968747249b053fd581f289c340d98af
2017-05-24 17:29:34 -07:00
Roozbeh Pournader
425e719c46 Update Paint#mFontVariationSettings in set() and reset()
Change-Id: I2dc41a998c940c4a4a98a06aaa6038cbca457186
Fixes: 62066408
Test: none
2017-05-24 15:16:55 -07:00
Tenghui Zhu
c495d8f1b5 Merge "Add documentation about 0 scale matrix to Shader" into oc-dev am: 52ca75011b
am: e7bc3d70b5

Change-Id: I1f659529a22072d329af949bedb3636400f0fde3
2017-05-24 21:36:45 +00:00
Tenghui Zhu
52ca75011b Merge "Add documentation about 0 scale matrix to Shader" into oc-dev 2017-05-24 21:06:56 +00:00
Andrew Solovay
591cccd2e7 Merge "docs: Fixing malformatted HTML escape" into oc-dev am: 1272847f1d
am: 670286ea89

Change-Id: I8f9acee143abd62b2d0599ad7ee866235916084d
2017-05-24 18:21:17 +00:00
Andrew Solovay
22ebb54e17 docs: Fixing malformatted HTML escape
Through the file's javadoc comments, the less-than character is
improperly coded as "&lt" instead of "<" (it's missing the
terminating semicolon). Chrome is clever enough to render that as <
, but I don't know if other browsers do, and in any event we
shouldn't count on that behavior.

Doc is staged to:

http://go/dac-stage/reference/android/graphics/drawable/RippleDrawable.html

Test: make ds-docs
Bug: 62028102
Change-Id: I81813fcb758349300f56ce10ccb0d03046ab4736
2017-05-23 12:24:12 -07:00
ztenghui
6f085f60e9 Add documentation about 0 scale matrix to Shader
fix:36989035

Test: build
Change-Id: Id1134d5d31ea6a17dc56f24d26eb5da9a78a2c2d
2017-05-22 14:56:50 -07:00
John Reck
3915e25d41 Convert Shader to NativeAllocationRegistry
Bug: 38258699
Test: manual
Change-Id: I1537dee3187ea0366f2c236f3e6825196d738a37
2017-05-22 13:30:00 -07:00
John Reck
8bde0be1b4 Convert Shader to NativeAllocationRegistry
Bug: 38258699
Test: manual
Change-Id: I1537dee3187ea0366f2c236f3e6825196d738a37
2017-05-19 10:55:20 -07:00
Chris Craik
68169d84d9 Merge "Update Bitmap#prepareToDraw doc" into oc-dev am: d4fff1565b
am: 27caadd2c4

Change-Id: I403d0a52958c7bf2720f078f5db140e3a3c3ebe7
2017-05-12 20:34:36 +00:00
TreeHugger Robot
d4fff1565b Merge "Update Bitmap#prepareToDraw doc" into oc-dev 2017-05-12 20:06:27 +00:00
Derek Sollenberger
ef16269e41 Merge "Add an O-release targetAPI check for Canvas.setBitmap. am: d70695ee34" into oc-dev-plus-aosp
am: 172bd07308

Change-Id: Iddc0babe08b2e1a9abe1bebe117fa66832417cff
2017-05-11 14:56:32 +00:00
Derek Sollenberger
d70695ee34 Add an O-release targetAPI check for Canvas.setBitmap.
For apps targeting releases earlier than O setBitmap will attempt
to preserve the matrix from the previous bitmap.  It does not however
attempt to reconstruct the save/restore stack or the clip.

Test: manual test of messenger app referenced in the bug
Bug: 37589964
Change-Id: I67f0928a3f84a8be41da38ef1868e79bdeb03e46
2017-05-11 09:28:02 -04:00
Sergey Vasilinets
4f2c7f88ac Merge "Fix npe due to strict mode in Bitmap.sameAs" into oc-dev am: 8d2b02bf08
am: 54b5a35cbf

Change-Id: I2cc440261656e5cbba5e0e24b7da22b7bc631106
2017-05-11 04:57:44 +00:00
Chris Craik
b1d2f0a1d0 Update Bitmap#prepareToDraw doc
Fixes: 38132750
Test: none

Change-Id: I95d4617c08c1aab23c322ec40ae15462766db3ba
2017-05-10 16:38:50 -07:00
sergeyv
e1fc36d197 Fix npe due to strict mode in Bitmap.sameAs
bug:38164234
Test: none
Change-Id: Ib267d1b06f86980202693fc1c330f73ed06411b0
2017-05-09 16:36:09 -07:00
Tenghui Zhu
dddc5c5418 Merge "Fix VectorDrawable size rounding issue" into oc-dev am: be030126fe
am: ca353e51ce

Change-Id: I41bb4065bb6684871f5d2edb8037d6d98b1f6d49
2017-05-09 18:54:29 +00:00
Tenghui Zhu
be030126fe Merge "Fix VectorDrawable size rounding issue" into oc-dev 2017-05-09 16:38:36 +00:00
Seigo Nonaka
373b15bda9 Fix double bolding
resolveStyle increases minikinStyle's weight value based on Skia's style
value. Since we compute Skia's style based on given weight value, we
should not add extra bold weight to minikinStyle.

This CL also fixes misunderstanding of base weight.
The base weight is only used for computing weight relative to the
weighted alias. Thus, base weight should not be updated except for
createWeightAlias method.

To be clear, this CL changes the function names but keeps the same
semantics as before.

Test: adb shell /data/nativetest/hwui_unit_tests/hwui_unit_tests
Test: am instrument -w -e class android.graphics.cts.TypefaceTest\
      android.graphics.cts/android.support.test.runner.AndroidJUnitRunner
Bug: 37880319
Merged-In: Ied73189b11792fb062da46f45afd2db664e6ecb4

Change-Id: I82350a1bfb99ce198b955f127949e21bccccb1cb
2017-05-09 04:10:07 +00:00
ztenghui
e2ec2e86ae Fix VectorDrawable size rounding issue
b/36668701
Test: Added new CTS test for this.
Change-Id: Ifcd74bc89e85841bf9f47eca8eb7d4eb401cf6ff
2017-05-08 13:54:58 -07:00
Seigo Nonaka
1f9c461e6a Fix double bolding
resolveStyle increases minikinStyle's weight value based on Skia's style
value. Since we compute Skia's style based on given weight value, we
should not add extra bold weight to minikinStyle.

This CL also fixes misunderstanding of base weight.
The base weight is only used for computing weight relative to the
weighted alias. Thus, base weight should not be updated except for
createWeightAlias method.

To be clear, this CL changes the function names but keeps the same
semantics as before.

Test: adb shell /data/nativetest/hwui_unit_tests/hwui_unit_tests
Test: am instrument -w -e class android.graphics.cts.TypefaceTest\
      android.graphics.cts/android.support.test.runner.AndroidJUnitRunner
Bug: 37880319

Change-Id: Ied73189b11792fb062da46f45afd2db664e6ecb4
2017-05-08 11:11:06 -07:00
Hyunyoung Song
eff12badb7 Merge "Fix issue in InsetDrawable where master inset attribute get ignored. Test: builds, and did manual test b/37752336" into oc-dev am: 52eba0ad70
am: 3c69ff323a

Change-Id: I146034df4aaf54d137897855f60133859deb45cc
2017-05-05 21:15:21 +00:00
Hyunyoung Song
52eba0ad70 Merge "Fix issue in InsetDrawable where master inset attribute get ignored. Test: builds, and did manual test b/37752336" into oc-dev 2017-05-05 20:52:55 +00:00
Sergey Vasilinets
de0c35decb Merge "Add StrictMode.noteSlowCall to calls that result in hw bitmap readback" into oc-dev am: 01a5cc9004
am: 9c29d93ee3

Change-Id: I85f853aee80cbe9659c646468d35fbd15a5a45d4
2017-05-05 19:56:10 +00:00
Sergey Vasilinets
01a5cc9004 Merge "Add StrictMode.noteSlowCall to calls that result in hw bitmap readback" into oc-dev 2017-05-05 19:31:53 +00:00
Seigo Nonaka
c7b291aad6 Merge "Resolve styles by font table if not specified." into oc-dev am: 1ea3a2600b
am: c000acd771

Change-Id: I7dc5268ddea18dfda560742b370388860dd87344
2017-05-05 19:15:24 +00:00