This reverts commit fc42a99ea5.
Because we are moving away from a wrapper class to delegate
between SkImageFilter and SkShader and instead adding
RenderEffect on RenderNode, this wrapper implementation
is no longer necessary. There are some behavioral
differences between SkShader and SkImageFilter that
would lead to additional complexity in conversions
between these objects and potential bugs.
To simplify this, RenderEffect will be added
directly to RenderNode to support better
caching of rasterization layers that is necessary
for various visual effects like blur.
Test: N/A
Change-Id: I65dc9f8bd26aed8761af13491ae3f6d583208377
Introduced RenderEffect API to handle consuming
SkImageFilter parameters on RenderNode objects
in order to support blur.
Updated SilkFX demo to use RenderEffect
APIs on RenderNode instead of BlurShader
Bug: 168549524
Test: Added tests to RenderNode CTS test cases
Change-Id: I5005a322a6d75438dd104e6915630264406cf771
TextShaper API provides a primitive text layout result, e.g. what glyph is used etc.
Here is the new APIs and its description
- PositionedGlyphs
This is a native instance backed object that gives layout information to developers.
- GlyphStyle
The glyph style is an object that holds the parameters that will be used for drawing.
This object is a subset of the Paint object for avoiding creating lots of Paint copy.
- TextShaper#shapeText
This does a text shaping and gives TextShaper.Result. This is a native backed primitive
shaping API.
- StyledTextShaper
This is a text shaper for a styled text. This will be the top-level developer facing
API for shaping text.
Bug: 168048923
Test: atest FontTest TextShaperTest StyledTextShaperTest
Change-Id: I2e91d1ef8503b25b28efc94da7de7cad49c4c1a9
Add support for submitting buffers in SurfaceView via BLAST using
BlastBufferQueue adapter.
Introduce a new config wm_use_blast_adapter_sv, that is disabled by
default to enable the adapter.
When enabled, the blast SC is created as a child of the main
SurfaceView SC and the main SC is set as a container layer. This layer
will continue to handle position, visibility and transforms while the
blast SC will handle buffer updates via the adapter.
Test: atest SurfaceViewBufferTests
Test: go/wm-smoke w/ & w/o adb shell adb shell settings set global use_blast_adapter_sv 1
Bug: b/168504870, b/168917217
Change-Id: I826eef39e03ea339df54400be0709eaba6c88797
This CL adds following APIs
Font#cloneWithSettings
This API provides a faster Font instance creation for different
variation settings.
Font#getBounds
This API provides glyph advance and bounding box information.
Font#getMetrics
This API provides font metrics that will be used for deciding line
height and/or baseline.
Bug: 168136332
Test: atest FontTest
Test: TreeHugger
Change-Id: I335557ce47ea0ca8e012c2a48b804c00bb348392
Added configurable parameters for edge treatment for
BlurShader to determine how edge pixels are to be
computed as part of the blur kernel. This provides
the option to sample the edge pixels of the source
for larger windows as well as using transparent
(default behavior)
Fixes: 167714368
Test: Added CTS tests to verify results of edge treatment parameters
Change-Id: I3880ff4aa2e2a4eba831a0aa6d2ec77b07e84813
Add plumbing to get shared timeline data from Surface Flinger to HWUI
and back.
Bug: 162890382
Bug: 162888881
Bug: 162890407
Test: manual using ALOG messages in SF
Change-Id: I85c5eb56d2fa933889518854e7b79b1e65e29af3
Add support for 10bit opaque and private RAW_DEPTH10 image format
which is similar to RAW_DEPTH.
Bug: 167250258
Test: Manual using camera application.
Change-Id: Ib2ee11570429d7a9a53e9dd6bc2042a1f5eaa760
Bug: 166069819
Test: ImageDecoderTest (cts)
The contained asset may only be a subset of the AssetFileDescriptor.
SkWebpCodec reads the entire stream into a contiguous block of memory.
(This is because libwebp does not provide a streaming API for creating
its demuxer.) If the AssetFileDescriptor contains data after the webp
file, this wastes memory. In some cases, there may be a *lot* of data
after the webp file, so this can use too much memory, particularly on
low memory devices.
Change-Id: I8d8e520f43a7ef0d7e4534ef165d8c7e4d2a0b55
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