Bug: 150395371
Test: make
Follow-on to I359187a5c70b5e241c7f5879d50fde2a7449c818. Apps built
against R should have @UnsupportedAppUsage access to createAshmemBitmap,
since asShared does not exist yet. But apps built against S should use
the new API.
Note that the R branches have *no* maxTargetSdk set for this method.
This was added in S before it was possible to set R as maxTargetSdk.
Change-Id: If2313809084bc70613214b562847ae3a792df259
Created BlurShader framework API along with
native implementation as an implementation of
the Shader wrapper that maps to either
SkShader or SkImageFilter
Bug: 143468037
Test: Added CTS test to verify BlurShader
Change-Id: I05fcf7ba79e9d552f8b0738f7382f7826cd94e21
Created Shader classes to wrap existing shader classes
in the framework in order to handle creation of either an
SkShader or SkImageFilter.
Updated native Paint implementation to optionally configure
the currently configured SkShader or SkImageFilter
Bug: 143468037
Test: re-ran CtsGraphicsTestCases and CtsUiRenderingTestCases
Change-Id: I7663b92766c912ab3866cf4e39b268f6dcf5d8e2
Bug: 159246162
Bug: 154358781
Test: PaintNativeInstanceTest.kt
Although the android.graphics package makes no promises regarding
thread-safety, it is not obvious to clients how they might call
getNativeInstance from multiple threads. If one thread sets up a Paint,
and then two threads use it, this sets up a race condition for setting
up the native SkPaint. This seems to have been observed in internal
apps. Put accesses and modifications to these native objects inside
a synchronized block, so that we don't end up with a situation where
two instances of mCleaner attempt to dereference the same native object.
Add tests in PaintNativeInstanceTest.kt
Change-Id: I10fa0958ea216bfbc79667c6217dd6570b3eb110
We can't expose APIs if the enclosing class is hidden, so these
annotations are redundant. We need to remove them so that we can enable the
check.
Exempt-From-Owner-Approval:Cherry-pick from goog/master
Bug: 159121253
Test: treehugger (i.e. this shouldn't trigger "API has changed" error.)
Merged-in: Ie1841a670bdf6c6f4b25a1fc5deed8ec2d18cda2
Change-Id: Ie1841a670bdf6c6f4b25a1fc5deed8ec2d18cda2
We can't expose APIs if the enclosing class is hidden, so these
annotations are redundant. We need to remove them so that we can enable the
check.
Bug: 159121253
Test: treehugger (i.e. this shouldn't trigger "API has changed" error.)
Change-Id: Ie1841a670bdf6c6f4b25a1fc5deed8ec2d18cda2
Bug: 156282935
Test: I3ce1bbd4285443a4e481a0a1e9267feafbe49d44
Test: DisplayWhiteBalanceTintControllerTest
Remove cctToIlluminantdXyz, which was @hide, but unused.
Make the @hide constructor package-protected so it can be called by
ParcelableColorSpace, but not from outside the package.
Make cctToXyz and chromaticAdaptation public. These are used by
other parts of the system and may be useful to other clients. Make the
public version of chromaticAdaptation throw IllegalArgumentExceptions
for passing arrays with the wrong number of arguments.
Make mul3x3(float[], float[]) private and copy it over to
DisplayWhiteBalanceTintController. There is nothing ColorSpace-specific
about this code.
Remove Renderer and related. They were originally used to generate the
documentation pages, but they are no longer needed. Remove
ColorSpaceRenderTest, which tested it.
Change-Id: I9094046c8e5e72be0ac208d4d242e6f0b274f386
Bug: 155905258
Test: make and boot
It is tightly integrated with android.graphics.HardwareRenderer, and
this follows on I30d34055b6870dc1039f190a88f4a747cee17300, which moved
the native component into android_graphics_TextureLayer.cpp, and
Ifa044281a3c36cbc1b413175711e9b172cda640f, which registers its JNI along
with other graphics classes.
Make TextureLayer AutoCloseable, replacing destroy() with close(). Add
annotations where appropriate.
Change-Id: I1b146ff02a20751246636144c88fe6f8eec43514
There's an H3 at the top of the PorterDuff.Mode javadoc comment,
and that breaks the TOC in various ways. We don't need that
heading so I'm removing it.
Test: make ds-docs-java
Exempt-from-owner-approval: Docs-only change
Change-Id: I6d5f98b5103a77a7d0245a438b6961c4a21fb059
Bug: 311897143
Test: make
This partially reverts 7648ccaa3b
(I141d6d79520871df1a3c2a9267ec872a8314ffdb). Restore RecordingCanvas'
MAX_BITMAP_SIZE and throwIfCannotDraw. Although it's possible to draw a
bigger Bitmap, it is likely a bug on the part of the app developer and
will likely lead to other (potentially hard to diagnose) problems due to
using so much memory.
Make the restored version of MAX_BITMAP_SIZE private, so that it won't
be accessed outside the module.
Change-Id: Ia82c9f05b0b01960915a34e06e046447ab38854e
Bug: 152983829
Test: make
Test: I77ec845b5503df6f90deb6a2176836d9aacb74d1
Make IDENTITY_MATRIX a public API. It had @UnsupportedAppUsage, and it
is a useful thing to have.
Replace printShortString with dump, to match Point#dump (added in
I5e25dbbe47b3c690d7d763a0082beb8d8a9c86d3) and others. Make this public
as well.
Remove @UnsupportedAppUsage from native_instance, which appears to be a
false positive (no usage found on the dashboard). Also make it private,
forcing other classes to call ni().
Document why ni() needs to be @hide (usage by classes outside the
package but inside the module). Also add a FIXME that PdfRenderer should
*not* be calling it, since we plan for it to be outside the module.
Make toShortString(StringBuilder) private. Switch its only external
client to the public version. (While I see a few public
"toShortString()" methods in the public API, I do not see any that take
a StringBuilder parameter.)
Fix a typo.
Change-Id: I356fb6729764f1777830fc3a91216e869bf6de16
Bug: 156636925
Test: make
Remove UnsupportedAppUsage false-positives from Shader and BitmapShader.
Change public/package-protected methods that should only be called by
subclasses to protected and mark them @hide.
Document why other @hide methods must be @hide.
Remove unnecessary if statement in BitmapShader constructor.
Change-Id: If3e87c45cbbab1df180387dd6ccfda1ec2ecb153
Bug: 156505010
Test: HtmlTest
Test: I060478a4e46f4ed153007d42cb5b7c5eae04de27
Remove Color#getHtmlColor, which was marked as @hide. Its only caller
was outside the in-progress UI rendering module, so it would no longer
be able to access it after the move.
Make the calling code call either the already-public Color#parseColor or
the (@hide, which is okay from android.text) XmlUtils.convertValueToInt
directly to achieve the same effect as before.
Change-Id: I8fde97bb866689849ba49932c6d7ca10bbd618c5
DMS should be queried before RenderProxy is first created. Otherwise
JankTracker will be initialized with bad offset information, which
breaks the dequeue time forgiveness checks and causes apps to report
longer rendering times than they should.
Also, fix the default for the presentation deadline - the default should
align with SF's offset to be 0
Bug: 155490805
Test: builds, boots, verified that offsets are plumbed at the right
time.
Test: quickstep benchmark shows improved jank numbers
Change-Id: I51538a02969eb312df40cad5df48619433056de9
Bug: 156272375
Test: make
No other class needs this. Also remove UnsupportedAppUsage. The
dashboard shows no usage.
Change-Id: I69fce40fa079380e59b0be8367bc7c9ab44ae76d
Bug: 139186570
Test: make docs
As part of enforcing Scoped Storage for the next Android release, we're
encouraging app developers to steer away from using raw file path access
and, instead, use FileDescriptor or Uri to access files.
Update createSource(File)'s docs to suggest why they might want to use a
different method.
Update the top level example to use createSource(ContentResolver, Uri)
instead of createSource(File).
Change-Id: Icbccdb5183edd0b6a052ec905f999f02ac4e61d3
(cherry picked from commit 4056974583)
Merged-In: Icbccdb5183edd0b6a052ec905f999f02ac4e61d3
Bug: 139186570
Test: make docs
As part of enforcing Scoped Storage for the next Android release, we're
encouraging app developers to steer away from using raw file path access
and, instead, use FileDescriptor or Uri to access files.
Update createSource(File)'s docs to suggest why they might want to use a
different method.
Update the top level example to use createSource(ContentResolver, Uri)
instead of createSource(File).
Change-Id: Icbccdb5183edd0b6a052ec905f999f02ac4e61d3
Bug: 155905258
Test: make
Remove MAX_BITMAP_SIZE. It was based on a limitation of the old
renderer. Remove override of throwIfCannotDraw, which was only there for
comparing the size of a Bitmap against MAX_BITMAP_SIZE and throwing if
it was too big.
Remove MAX_BITMAP_SIZE from WallpaperManagerService, which was a copy of
the one in RecordingCanvas, and only there due to it.
Mark obtain, recycle, and finishRecording as being used by the package.
Change-Id: I141d6d79520871df1a3c2a9267ec872a8314ffdb
Bug: 154628299
Test: I20d4f94a145474394bc660368d9ddd1897001f4a
This allows displaying a new Bitmap without paying the cost of creation
and GC of the BitmapDrawable.
Non-SDK-API usage is low, but this is useful. Previously it was @hide
and used by the system. Once BitmapDrawable is in a mainline module,
the system can no longer access @hide methods.
Change-Id: I6a24b3c5870b0ee7d171aab86257896261b4b8c7
Bug: 155422223
Test: make
insertInOrderBarrier and insertReorderBarrier are @hide and deprecated.
Remove them and update all callers to enableZ and disableZ, which are
already public.
Update native code to refer to enableZ instead of insertReorderBarrier.
In addition, remove @hide Canvas#isRecordingFor. This method was
originally used to prevent a single RenderNode from being in two display
lists. This is now supported, so there's no reason to avoid it. The one
caller used it to determine whether to reorder drawing its child Views
(which, as the comment says, makes sense to determine based on whether
the Canvas isHardwareAccelerated) and whether to call
insertReorderBarrier/insertInOrderBarrier (now enableZ/disableZ). In the
latter case, there is no need for a conditional, since enableZ/disableZ
only work on a hardware Canvas.
Change-Id: Ib216a19d6aeff40b2e23532bacd62d1795c2ab27
Bug: 155661807
Test: make
Document/remove @hide/@UnsupportedAppUsage from NinePatch(Drawable)
- Remove the unused copy constructor
- Remove @UnsupportedAppUsage from InsetStruct. No usage was shown on
the dashboard; it was likely added by mistake due to its being called
from JNI
- Document that the other @hide methods are needed for access from
outside the package, but still within the module.
Change-Id: Ia27a5eda63a0115da54225f7ac18b3d2a55ab01f
Bug: 155422223
Bug: 155661807
Test: NinePatchTest#testDraw
Test: NinePatchDrawableTest#testDraw
As part of the move to a mainline module, code outside the module cannot
access @hidden APIs on Canvas. Although no code outside the module calls
these methods, there is a Canvas subclass that overrides it - NopCanvas,
which overrides it to do nothing. This is useful, and cannot be achieved
another way. (If NopCanvas did not override drawPatch, it would crash
when attempting to draw a NinePatchDrawable.)
In addition, this method is already public on RecordingCanvas. (This is
likely an accident; it contains no documentation for the method.)
Lastly, it is somewhat arbitrary that the way to draw a NinePatch
directly was to call NinePatch#draw. This is the reverse of how Canvas
drawing generally works. The newly public method matches the typical
pattern (Canvas#draw<Something>(Something, Paint)) and is already called
by NinePatch#draw.
Change-Id: I16d7dc7391e3ad5777fdd7023472545c6104af69
Bug: 155422223
Test: make
For Canvas to be in a mainline module, it cannot be have @hidden APIs
accessed from outside the module. Remove @hide where simple:
- document why Canvas(long) is needed to be public + @hide
- remove its UnsupportedAppUsage, which was a false positive
- remove EdgeType.nativeInt (which was @hide) - no longer used
- make VertexMode.nativeInt package protected
Change-Id: I508758889c586f336c2963e1b61d01dc3dc58be7
Bug: 155422223
Test: make
This method is @UnsupportedAppUsage but low usage. It is @hide but
unused internally. Remove it so Canvas can move to a mainline module.
Change-Id: Ida6710d3640c1c6ce03eb4f5634dd4e8df581d1d
Bug: 155422223
Test: make
Follow on to Ie7172fb93364a1e04ab844b8fa64887bf9d8b005. Remove @hidden
APIs on Canvas - instead call setCompatibilityVersion from the
Compatibility class already in the Java package. This is a step towards
moving Canvas into a mainline module. Note that this means these are set
when the application is bound, rather than when the first View is
created.
Change-Id: I3f73d77ba7351a6cb653dd550210698c6482e1bb
These were previously being suppressed by doclava but with this change,
all failures are fixed and the suppression logic has been removed.
To fix the issues, there were a few possible changes made:
- broken reference to a public API (such as incorrect parameters): fixed
- unnecessary @link inside an @see tag: fixed
- @see referring to an @hide or @SystemApi: reference removed
- broken references to inner class constructors
- worked around by fully qualifying the constructor
Bug: 6963924
Test: make doc-comment-check-docs
Exempt-From-Owner-Approval: cherry-picked from master
Change-Id: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
Merged-In: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
(cherry picked from commit e0624c7a40)
These were previously being suppressed by doclava but with this change,
all failures are fixed and the suppression logic has been removed.
To fix the issues, there were a few possible changes made:
- broken reference to a public API (such as incorrect parameters): fixed
- unnecessary @link inside an @see tag: fixed
- @see referring to an @hide or @SystemApi: reference removed
- broken references to inner class constructors
- worked around by fully qualifying the constructor
Bug: 6963924
Test: make doc-comment-check-docs
Change-Id: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
Merged-In: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85