Fix check for scaling in SkiaOpenGLReadback: old code was not
taking into account that matrix rotation swaps width/height.
Test: Passed PixelCopyTest#testWindowProducerCopyToRGBA16F
Bug: 110097060
Bug: 111776948
Change-Id: I0d26416fa72a026bc376417773d5a73548b1f1a5
Merged-In: I0d26416fa72a026bc376417773d5a73548b1f1a5
(cherry picked from commit d50edd004b60bec3f1d36066725129276b4a53ec)
(cherry picked from commit ee7b63aa646c937e326ac5f39f07f724020533bb)
Fix TextureView.getBitmap to capture content only from the layer.
Bug: 111401911
Test: A new test TextureViewTest.testTransformScale is passing
Change-Id: I2b9cee17fc48de7b12ed03d5b4f173ce5445dbfe
Merged-In: I2b9cee17fc48de7b12ed03d5b4f173ce5445dbfe
(cherry-picked from ff129aefe2b68c5dc6fe51a9b1d34f98750d4973)
(cherry picked from commit 9675537555913a6aa7c25a71a6b854a083e22ede)
The WebView was unable to draw into either a standard clipped
layer or the "fading edges" unclipped layer. This CL and its
companion test cases ensure that both work with simple and
complex clips.
Bug: 79619253
Bug: 80443556
Bug: 80477645
Test: atest CtsUiRenderingTestCases:.LayerTests
Merged-In: I0e16b724f74415a61cc2a841ccf4a491f293ac94
Change-Id: I4900222975fc841b11828916878fb0ea6d87dcda
Make sure view port and frame buffer are set to the correct values
before calling GL functor (WebView) draw.
Improve correctness for stencil clip by doing a second flush that
guarantees the stencil clear will be executed after draw commands.
Bug: 79619253
Test: XFINITY Connect app draws correctly
Change-Id: Ieb3d0d70caf0469b6393e6287f8529cd86519301
Bug: 78866720
Test: Manual + systrace; existing CTS
Previously, we set hasAnimations to true when the AnimatedImageDrawable,
so that we would get a call to redraw. But if the image does not need to
show its next frame yet, the redraw was unnecessary.
Instead, add a new field to TreeInfo::Out, representing the delay time
until the image will need to be redrawn - i.e. when the duration of the
current frame has passed. Each call to prepareTree will post at most one
message to redraw, in time for the earliest animated image to be
redrawn. Post the message for one rendered frame ahead of time, so that
when it is time to show the next frame, the image has already gotten the
message to update.
On a screen with a single animated image, this drops the number of calls
to dispatchFrameCallbacks to as infrequent as possible. It is called
only when we need to draw a new frame of the image. On a screen with
multiple animated images, the calls may be redundant, but they will not
be more frequent than they would be without this change.
Switch to nsecs_t and systemTime internally, matching the rest of HWUI.
Remove mDidDraw and related. Its purpose was to prevent advancing the
animation while the image is not being drawn. But it isn't really
necessary. If it's not drawn, onDraw is not called, which is where we
trigger decoding. And onDraw already has a defense against getting too
far ahead - if its timer indicates that it should skip a frame or show
it very briefly, it will back up its timer. More importantly, mDidDraw
caused a bug, when combined with less frequent redraws. If the display
list containing the drawable doesn't need to be redrawn for other
reasons, the drawable's timer never advanced, so its animation stopped.
Fix software drawing. Compute the milliseconds in the future to draw the
next frame, and add that to SystemClock.uptimeMillis() to compute the
time to pass to scheduleSelf.
Change-Id: I13aab49922fa300f73b327be25561d7120c09ec4
Bug: 77917978
Test: Look at toggles; CtsUiRenderingTestCases
Prior to this change, the toggles look pixelated due to using a
"nearest" filter instead of a "bilerp".
This matches the behavior of the hwui renderer.
Depends on changes in Skia (Ib7d0abdd51981bddf36ec5c3fd84bb651f405f0f)
to respect the filter quality when drawing to a GPU canvas and to
remove the resulting "bleeding" effect from drawImageLattice.
Change-Id: I59d81a17f351e18574539479a38a580a02e1619b
This CL extracts the android_dataspace from the GLConsumer and converts
it to a SkColorSpace. HWUI always expects to composite into an sRGB
destination so when we draw the layer we run the draw through a
colorFilter that converts the input colorSpace into that of the
destination.
Test: CtsViewTestCases
Bug: 78016220
Merged-In: Ic0446a0d861e86a5a9d0382346b57fcc45c8a61b
Change-Id: Ic0446a0d861e86a5a9d0382346b57fcc45c8a61b
This is a partial revert of b1f27aae89a9da9fbf3cb15a47f1a401db5a7974.
Test: hwui_unit_tests
Bug: 77654081
Change-Id: I5a58c156a280edfe3e9973ac3a8a30c97a2cff8b
Fix memory leak in a limited memory situation within
ShaderCache::load().
Bug: 76213660
Test: Passed ShaderCacheTest unit test, ran a build on device.
Change-Id: Ibb6ea8fe167eb22bcbbaffc4cfffac12eda98c42
Bug: 73392905
Test: New test added with I2d4ef440f943a50b9367976ba1444f4350071bfd
When providing a width and height, getBitmap should scale to the
destination. Add a parameter to LayerDrawable::DrawLayer for a
destination rectangle to scale to. Pass the size of the bitmap in
SkiaOpenGLPipeline::copyLayerInto down to DrawLayer. The only other
caller of DrawLayer is unaffected.
Change-Id: I7aa192181c2d15bc8fd4de2fb15c4d276b05d2ac
Pass error handler down to the pipeline object, which allows
skia pipelines to print cache memory usage.
In case of an error, print arguments that were used to invoke
SkSurface::MakeRenderTarget.
Test: Ran android build on a device
Bug: 76115654
Change-Id: I5baddfa66debd505eddc3117cf94aa6ae69bedaa
This is a workaround for Qualcomm bug and should be reverted
after a proper fixed is found.
Bug: 74976293
Test: Ran Photo app
Change-Id: I9e0a4634f02c3553635f058eb588b510a63273ba
kClear blend mode is drawn as kDstOut on hardware canvas for
compatibility with Android O and older.
On SDK released with Android P, the kClear blend mode is respected.
Bug: 71602378
Test: Ran Flo app
Change-Id: I6b0fa8b8bf5aa14aa5a351a914bf2ed0469ac660
(cherry picked from commit f9a461feafded09a0949f5acfd42187dc857a823)
Cache VectorDrawable bounds at record time, because the same
drawable object may be used several times with different bounds.
Bug: 71737362
Test: Wrote a new unit test, tried sample app attached to the bug
Change-Id: If7be934acf0c16b328cb0f95d849e463dcd3b88b
Bug: 63908092
Test: Manual: Ie18811ba29a1db163aca08472b04ae185e9344f0
Depends on https://skia-review.googlesource.com/#/c/skia/+/101544. That
change removes the Skia class's time checks, and leaving it up to the
client to keep track of the time. In this case, the client wants to keep
track of the time because it only wants to update while it is being
drawn. If it goes off screen (for example), it will just resume where it
left off when it returns on screen. This allows for smooth animations.
If an AnimatedImageDrawable is being drawn to a SkiaRecordingCanvas,
decode on the new (lazily-created) AnimatedImageThread.
When running, always decode one frame ahead on the AnimatedImageThread
so that it will be ready when it is time to display.
During prepareTree, update the time and check whether there is a new
frame ready to draw or the next frame needs to be decoded. In either
case, return true. The next frame to be decoded will be triggered by
onDraw.
Change-Id: If447976e9df417060a950f658dbca9cf7980dd02
bug: 71900691
Emulator user might switch renderers, migrate a snapshot to a different
machine with a different shader binary format, etc.
Plus, program binaries don't seem to work so well on some desktop GPUs.
Change-Id: I0c6239acbd556097494aa903d6603c963d3141cb
The current implementation schedules the next frame of the images
to be decoded after the current frame completes but potentially
schedules tasks that will result in a no-op execution if a new
frame is not yet needed.
Test: HwAccelerationTest
Change-Id: I0510cb5a1b801abd651327e924deb586af0306d6
Increase filter quality when rendering a layer into the frame
buffer from kNone_SkFilterQuality to kLow_SkFilterQuality.
This visibly improves the quality if the layer is scaled.
For example the circle shutter button in camera app looks
better in pressed state (there is no jagged edge).
Test: Ran camera app
Bug: 72144993
Change-Id: I138d930a25301a369876d76a2cd322df0324f0f2
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
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
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
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
Use Skia GrCaps to detect if we can render into a FP16 buffer.
Exclude Extension class initialization from SkiaGL pipeline.
Bug: 68383159
Test: Passed testWindowProducerCopyToRGBA16F on gce_x86_phone emu
Change-Id: I3355bad891ed5403fbd94d18bb8ba110a3b77325
Implement SkSL cache by reusing code and logic from egl_cache_t.
Test: Improves startup times for gmail by 15ms and 10ms for calc app.
Bug: 66740665
Change-Id: I9ba479c649ba97a2c29a48d40579ba001264c957
This feature needs support for renderable float textures, but the checks
were only guaranteeing support for float texture reads.
Bug: 68754504
Test: CtsViewTestCases
Change-Id: I0ce4a81cb8e09c10a5f1e65234685767a24ef8c4
Fix readback to return correct error code on X86 emulator, when
half float pixel format is not supported.
Test: Ran and passed all CtsViewTestCases tests on x86 emulator
Bug: 68383159
Change-Id: Id66484b73488e2c8d29fbecbd45a97af285a0710
Apply correct texture transform and use filter if source and dest
have different size.
Test: Ran and passed CtsUiRenderingTestCases,
Test: CtsGraphicsTestCases, CtsViewTestCases tests and the
Test: DecodeAccuracyTest.
Bug:68051015
Change-Id: Iee885e243e43497c9294f7475c0c5b9c1a783754
Convert SkiaPipeline::skpCaptureEnabled into a system property.
Add ability to capture drawing in layers. Add ability to capture
animations/sequence of frames. Fix crash when recording a
TextureView.
Test: Ran capture script.
Change-Id: I463eecf6ec90a601a6cc172ad1901bd4bcc86ac8
Fix crash caused by updating vectordrawable cache for objects
from previous frames, which may have been deleted.
Bug: 67940327
Test: Ran CtsUiRenderingTestCases test
Change-Id: I4466235e78e9b7937a0d4428240574d9e3d0989f
Fix a crash caused by calling OpenGL APIs with Vulkan pipeline
(likely a regression from ag/2706458).
Test: Ran CtsViewTestCases tests with SkiaGL pipeline.
Change-Id: Ibabeb4229ef88de57c99f2961a10a68ca71b25ab
Fix order of matrix multipication and use drawImage instead of
shader.
Test: Ran camera app, message app and smart face lock app.
Bug: 67405584
Change-Id: I3df161d58218e1b1845f1c1ca2db2b12c51b3532