Instead of allocating a separate renderTarget and switching
between them on each draw the new implementation follows the same
pattern that the old HWUI renderer used. The area of the layer is
now copied to a buffer on the GPU, the area is then cleared, rendered
as normal, and finally the texture is redrawn using dst_over blending.
This results in no render target switches and is considerably faster
on some hardware.
Test: CtsGraphicsTestCases, CtsUiRenderingTestCases
Bug: 119222339
Change-Id: I716aac1fc31e4c7a171373d37dee82034c01cf18
Also for a canvas wrapping a bitmap the colorspace of the bitmap
will be used to correctly blend content.
Test: CtsUiRenderingTestCases
Bug: 111436479
Change-Id: I63ad7a30605a7f725cc0ef4716d42ea978fb03e3
Exposed Skia's underlying drawDRRect method used to draw a double
rounded rectangle
Bug: 117181396
Test: Added test case to verify Canvas#drawDRRect and re-ran CanvasTests
Change-Id: I4e1954c8ffc82811dc541488d1df9b37309faf51
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
Bug: 63909536
Bug: 63908092
Test: TODO
If ImageDecoder.decodeDrawable is called with an animated image Source
(currently GIF or WebP), return an object of a new (hidden) Drawable
subclass. The new Drawable animates, and it implements Animatable (TODO:
implement Animatable2) so users have some control over the animation.
In addition to the normal features of Drawable, this new one supports
many of the features of ImageDecoder, including scaling, cropping and
PostProcess, which enables circle masks/rounded corners and other
arbitrary after-effects. It does *not* support decoding directly to a
Hardware Bitmap, since it cycles through frames and reuses the same
bitmap memory. But it could be made to use shared memory (TODO?).
TODO: Use a better number for the native allocation registry
TODO: Use the RenderThread to drive the animation, and remove decoding
on the UI thread.
TODO: Add support for modifying the loop count
Android.bp:
- build new AnimatedImageDrawable.cpp
AndroidRuntime.cpp:
- register new native methods
AnimatedImageDrawable.java
AnimatedImageDrawable.cpp:
- new Drawable that handles animated images
Canvas.h, SkiaCanvas.h/.cpp
- New virtual method and implementation for drawing SkAnimatedImages
RecordingCanvas.h/.cpp
- Stub implementation of drawing SkAnimatedImages
ImageDecoder.h/cpp
- Allow code sharing with AnimatedImageDrawable.cpp
- postProcess
- access the ImageDecoder struct
Depends on https://skia-review.googlesource.com/c/skia/+/94660 in Skia.
Change-Id: Ie2ec98d9c52deda4d439c6ef8e5dea2861bb93a3
For picture-backed canvases, we will defer the xform
until playback.
Test: Unit tests and cts test.
Bug: 32984164
Change-Id: Ib74663bcb688b74b6ba8792b403b0475126732af
This allows Skia to remove
SK_SUPPORT_LEGACY_CANVAS_VERTICES
SK_SUPPORT_LEGACY_BITMAP_SETPIXELREF
SK_SUPPORT_LEGACY_PIXELREFFACTORY
Test: Existing CTS cover these changes
Running CtsGraphicsTestCases, there were 6 failures w/ and w/o this CL.
None of the 6 seems related to this CL.
Change-Id: I724082357d9f6cb699770df3c0b9ef555b957697
Avoid one memcpy in Canvas::drawGlyphs for all pipelines.
Test: CTS passed with exception of SweepTests#testBasicDraws
shadowtext, which fails with and without this CL.
Change-Id: I0841232dc7a6173eb3b03f939dbde15a84186296
This API is difficult to support for printing and has other negative
effects as it does not respect the current matrix/clip.
Test: compile
Bug: 14650725
Change-Id: I71f9bd687d446c7ce8910d755421aad8e09458db
Implement SkiaRecordingCanvas, RenderNodeDrawable, GLFunctorDrawable,
LayerDrawable, StartReorderBarrierDrawable, EndReorderBarrierDrawable.
Move AnimatedRoundRect and AnimatedCircle in a separate file.
All Skia pipeline files are moved in hwui/pipeline/skia folder.
Add unit tests for RenderNodeDrawable, StartReorderBarrierDrawable,
EndReorderBarrierDrawable and SkiaRecordingCanvas.
Test: I tested manually on 6P devices and did run the unit tests.
Change-Id: If2a347bd1fc4689953822294ce5bf98c7f3f57c7
Most changes are taken from ag/1407698, ag/1336660, ag/1488900.
Test: Built and run manually on angler-eng.
Change-Id: Id4e464b9a83c62b6bc7ea31a30e5ca6cd53b659d
on a per RenderNode basis. With Skia renderer we
see 30% speed improvement in Invalidate Tree UI Jank test,
when SkiaDisplayList objects are reused.
Test: manually built and run on angler-eng.
Change-Id: Ie4ec50ddb2015150e3ec678dde7ebed0c8d90067
Previously the header for SkiaCanvas was contained in the .cpp file,
but in prepration for broader use of SkiaCanvas we are moving the
header into its own .h file.
Change-Id: Ib8c738366198a9b63e7429d51e9fa5aec106fdb1