Commit Graph

3125 Commits

Author SHA1 Message Date
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
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
TreeHugger Robot
d4fff1565b Merge "Update Bitmap#prepareToDraw doc" into oc-dev 2017-05-12 20:06:27 +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
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
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
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
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
a5fa9e8a63 Resolve styles by font table if not specified.
android:fontStyle and android:fontWeight is an optional attribute.
If they are missing, we are using non-italic 400 weight, but this is
not good idea. We should resolve these style value from font metadata.

Bug: 37988154
Test: am instrument -w -e class android.content.res.cts.ResourcesTest
      android.content.cts/android.support.test.runner.AndroidJUnitRunner

Change-Id: I80a436cd3632d8c58fa3d8bdaedac73b95f61a8c
2017-05-05 09:30:34 -07:00
Hyunyoung Song
f9fe6c11d3 Fix issue in InsetDrawable where master inset attribute get ignored.
Test: builds, and did manual test
b/37752336

Change-Id: I85182a4cf94fa5bcb7c2ac09c701496fb3e72f61
2017-05-04 12:19:35 -07:00
sergeyv
9fd259c9b0 Add StrictMode.noteSlowCall to calls that result in hw bitmap readback
bug:37748500
Test: BitmapTest:*inStrictMode
Change-Id: Ifea1c6f0c50ba2f409c96b7ccf7eb31c89ef81c8
2017-05-03 17:41:33 -07:00
Seigo Nonaka
5e0aed49a8 Fix NPE happens if no source was specified to font element.
This also fixes unexpected fallback to the old implemntation by calling
allowUnsupportedFont() which is only for backward compatibility.

This CL also remove getResourceId() method. Nobody uses this method.

Bug: 37865521
Bug: 37844248
Test: am instrument -w -e class android.content.res.cts.ResourcesTest\
      android.content.cts/android.support.test.runner.AndroidJUnitRunner
Change-Id: I987448add728c53c916f24a2ea8f337be417248f
2017-05-01 23:23:50 -07:00
TreeHugger Robot
1e8f451bbf Merge "Add @TestApi annotation to AdaptiveIconDrawable" into oc-dev 2017-05-01 23:18:41 +00:00
Hyunyoung Song
d2afdab226 Add @TestApi annotation to AdaptiveIconDrawable
Bug: 37779858
Bug: 37788590

Test: $ make -j31
Test: $ make update-api -j31

Change-Id: I459317e8b9f6db227a4bb567c17b212639454e9d
2017-04-28 15:40:50 -07:00
Seigo Nonaka
0f07dd5b14 Remove FontVariationAxis.InvalidFormatException.
Use IllegalArgumentException instead.

Bug: 37769084
Bug: 37765945
Test: am instrument -w -e class android.widget.cts.TextViewTest
      android.widget.cts/android.support.test.runner.AndroidJUnitRunner
Test: am instrument -w -e class android.graphics.cts.TypefaceTest
      android.graphics.cts/android.support.test.runner.AndroidJUnitRunner
Test: am instrument -w -e class android.graphics.cts.PaintTest
      android.graphics.cts/android.support.test.runner.AndroidJUnitRunner
Test: am instrument -w -e class android.graphics.cts.FontVariationAxisTest
      android.graphics.cts/android.support.test.runner.AndroidJUnitRunner
Test: am instrument -w -e class android.text.VariationParserTest
      com.android.frameworks.coretests/\
      android.support.test.runner.AndroidJUnitRunner

Change-Id: I50b70e3e7e37585c937dcce2416a83353de62a5d
2017-04-28 15:24:40 -07:00
TreeHugger Robot
ebd44d0076 Merge "Add conic support for Path#approximate" into oc-dev 2017-04-28 18:47:37 +00:00
Chris Craik
533538c96e Merge "Make SurfaceTexture#isReleased public API" into oc-dev 2017-04-28 17:09:55 +00:00
Chris Craik
96202d56ad Add conic support for Path#approximate
Fixes: 37722722
Test: bit CtsGraphicsTestCases:PathTest
Test: bit CtsUiRenderingTestCases:android.uirendering.cts.testclasses.PathTests

Also adds static asserts to path-walking code, to avoid this problem
in the future.

Also adds annotations, since this is public API now.

Change-Id: Ic39b167968b98fd8197be2d0f9aca79949717237
2017-04-27 16:24:18 -07:00
TreeHugger Robot
e6746726bc Merge "Revise method comment on setFontVariationSettings" into oc-dev 2017-04-27 17:34:48 +00:00
Seigo Nonaka
080b054bdd Font API clean up
- Move FontRequest from android.graphics.fonts to android.provider since
  this is only used by android.provider.FontsContract and never draw
  anything.
- FontRequest is no longer being Parcelable.
- Remove FontSpec.aidl which is not necessary.

Bug: 37326126
Test: am instrument -w -e class android.provider.FontsContractTest
      com.android.frameworks.coretests/\
      android.support.test.runner.AndroidJUnitRunner
Test: am instrument -w -e class android.provider.cts.FontProviderTest
      android.provider.cts/android.support.test.runner.AndroidJUnitRunner
Test: am instrument -w -e class android.provider.cts.FontRequestTest
      android.provider.cts/android.support.test.runner.AndroidJUnitRunner

Change-Id: I0eb501844247c2f07eaa1fc7a71f72e404888b5b
2017-04-26 18:00:17 +00:00
Seigo Nonaka
d9de8be233 Load font file from remote provider synchronously.
Since CancellationSignal is not guaranteed to be handled by remote
process, introduce threaded font loading mechanism.
At the same time, this fixes possible NPE issue in openFont.

Bug: 37552479
Test: am instrument -w -e class android.provider.FontsContractE2ETest
      com.android.frameworks.coretests/\
      android.support.test.runner.AndroidJUnitRunner

Change-Id: Ie235c5a57bd172b0882da5aa27a990d7c6686ff2
2017-04-25 21:19:22 -07:00
Chris Craik
f461219185 Make SurfaceTexture#isReleased public API
Bug: 36902442
Test: bit CtsUiRenderingTestCases:android.uirendering.cts.testclasses.TextureViewTests

This method is already tested in TextureViewTests in CtsUiRenderingTestCases.

Change-Id: Id2d186f966d5e2b7c50a8b2ecefcd66c8a87c1fd
2017-04-25 15:57:57 -07:00
Seigo Nonaka
54084b64b1 Font provider cleaning ups.
- Remove Columns.STYLE
- Decouple Context from Typeface.
- Make FontsContract constructor private since it is essentially static.
- Removed unused constants.

Bug: 37281200
Bug: 37268410
Test: am instrument -w -e class android.provider.FontsContractE2ETest
      com.android.frameworks.coretests/\
      android.support.test.runner.AndroidJUnitRunner
Test: am instrument -w -e class android.provider.FontsContractTest
      com.android.frameworks.coretests/\
      android.support.test.runner.AndroidJUnitRunner
Test: am instrument -w -e class android.graphics.cts.TypefaceTest
      android.graphics.cts/android.support.test.runner.AndroidJUnitRunner
Change-Id: Ic46c256141d27ca28f30023bcc40f4e1161d5338
2017-04-25 19:40:58 +00:00
Seigo Nonaka
5a09c64345 Remove Typeface.create
Test: Manually done
Bug: 37514611
Bug: 37463988
Bug: 37281200
Change-Id: Ida704af910e0ae195b96803de506fa1e1d66c9f5
2017-04-25 09:38:39 -07:00
Jeff Sharkey
6bc03748a7 Merge "More auto-doc work." into oc-dev 2017-04-22 19:11:34 +00:00
TreeHugger Robot
aec1fbeaa3 Merge "Fix @throws javadoc on SurfaceTexture ctors" into oc-dev 2017-04-21 23:25:54 +00:00
TreeHugger Robot
5be3647a9e Merge "Propagate density through AdaptiveIconDrawable and BitmapDrawable" into oc-dev 2017-04-21 22:35:57 +00:00
Jeff Sharkey
910e081216 More auto-doc work.
Add support for AnyThread, CallSuper, and UiThread.

Another related CL started documenting @RequiresPermission, so remove
duplicated information in existing APIs.

Suppress auto-doc on a handful of classes that are already
well-documented.

Test: make -j32 offline-sdk-docs
Bug: 37526420
Change-Id: I791437dccec0f11d5349a23b982ba098cb551af8
2017-04-21 16:35:08 -06:00
John Reck
b8d152f5cd Fix @throws javadoc on SurfaceTexture ctors
Change-Id: I63bd76ec4e44251b7e06ad6fc8aa5a3372104656
Fixes: 37323694
Test: Looked at generated docs, verified correct
2017-04-21 13:49:36 -07:00
Adam Lesinski
50954d2b4e Propagate density through AdaptiveIconDrawable and BitmapDrawable
Resources#getDrawableForDensity now propagates the overridden
density through to AdaptiveIconDrawable so that the density can be
propagated to leaf BitmapDrawables correctly.

This enables AdaptiveIconDrawable to support higher resolution
foreground/background bitmaps for use in Launcher.

Bug: 36039665
Test: bit CtsContentTestCases:android.content.res.cts.ResourcesTest
Change-Id: Iaa9a5592626e38e1ff839a76f7c6cfb9e16e5dc1
2017-04-21 13:25:44 -07:00
TreeHugger Robot
eedceb5721 Merge "Add transfer mode support to ColorDrawable" into oc-dev 2017-04-21 19:29:07 +00:00
Seigo Nonaka
daa8dfc690 Cache the Typeface based on the FontRequest.
Bug: 37471729
Test: FontsContractE2ETest
Change-Id: Ifb1bd2b50077471404f5f1dffc01e7697d7042e6
2017-04-21 09:11:10 -07:00
TreeHugger Robot
ab7a2879eb Merge "Support fraction type for inset* for InsetDrawable. b/36024318" into oc-dev 2017-04-21 15:14:27 +00:00
TreeHugger Robot
337be5a12f Merge "Update Typeface callback docs about error codes" into oc-dev 2017-04-21 09:44:53 +00:00
Hyunyoung Song
d0dfe3008d Support fraction type for inset* for InsetDrawable.
b/36024318

Test: manually tested on default icons.
Test: $ runtest --path=cts/tests/tests/graphics/src/android/graphics/drawable/cts/InsetDrawableTest.java

adb  shell am instrument -e class 'android.graphics.drawable.cts.InsetDrawableTest' -w 'android.graphics.cts/android.support.test.runner.AndroidJUnitRunner'

android.graphics.drawable.cts.InsetDrawableTest:........................

Time: 0.132

OK (26 tests)

Change-Id: Ie8d24680b6884e65017f07723a371120f5ae610c
2017-04-20 16:23:40 -07:00
Lucas Dupin
b27b47df6b Add transfer mode support to ColorDrawable
Test: runtest --path cts/tests/tests/graphics/src/android/graphics/drawable/cts/ColorDrawableTest.java
Change-Id: Ice87f248e307710315304fc191cb58ee7142e525
2017-04-20 13:57:01 -07:00
Clara Bayarri
5706a1b12d Update Typeface callback docs about error codes
As requested by API council, mention that the provider may
return its own error codes within the positive int range.

Bug: 37084803
Test: none
Change-Id: Ia8ee99432cc5025a12d43049e327605095dd2b57
2017-04-20 12:02:57 +01:00
TreeHugger Robot
e53b00c6d1 Merge "Set the color space as nullptr on native bitmaps when sRGB is requested" into oc-dev 2017-04-19 21:09:46 +00:00
TreeHugger Robot
611fae13df Merge "Fix compose shader child local matrix mutation" into oc-dev 2017-04-19 20:41:06 +00:00
TreeHugger Robot
f3157e1692 Merge "Add comment to Typeface.Builder about file descriptor." into oc-dev 2017-04-19 20:08:57 +00:00
Romain Guy
08587d45b1 Set the color space as nullptr on native bitmaps when sRGB is requested
This regression is a fallout from the recent API council feedback
fallout. The default color space used to be always set to null but
it's now the named SRGB instance. This change passes null to native
when the specified color space is known to be sRGB.

Bug: 37496760
Test: runtest managed-provisioning
Change-Id: Ie933c84e429a682a58ee253b57b77bd61b88ee5e
2017-04-19 11:58:05 -07:00
Chris Craik
f6b0e60bd0 Fix compose shader child local matrix mutation
Bug: 37495696
Test: cts-tradefed run singleCommand cts-dev --module CtsGraphicsTestCases --test android.graphics.cts.ComposeShaderTest

Adds back the verify step that discards a stale native ComposeShader if a child
changes.

Change-Id: I44f40c1edfdb7633994a69efb583cf28ee2c26b2
2017-04-19 10:57:25 -07:00
TreeHugger Robot
944782fac2 Merge "Change nullability of colorspace parameter" into oc-dev 2017-04-18 23:26:00 +00:00
Romain Guy
1fa9d86ea4 Change nullability of colorspace parameter
Bug: 37323693
Test: android.graphics.cts.BitmapColorSpaceTest
Change-Id: I705ac18e5c64c028c2e8366a18ec4ef20f44a630
2017-04-18 14:06:49 -07:00
Chris Craik
8a6ad4a89d Re-hide shader mutation, remove colorfilter mutation
Bug: 36025103
Bug: 37327129
Test: boots, CtsGraphicsTestCases passes

Change-Id: I937f8ae26ed47b4811dc033ed91c257670fc3a39
2017-04-18 12:57:59 -07:00