IFrameCallback has a pure virtual method, but its destructor was
non-virtual. While CanvasContext, which inherits from
IFrameCallback, declares its own destructor virtual, this is not
sufficient when accessing via an IFrameCallback pointer.
We fix this by making the base destructor virtual.
Test: Treehugger
Change-Id: I6424f90c16caea417b5f80b60d76a7ca7c7ef97c
com.android.server.cts.GraphicsStatsValidationTest#testDaveyDrawFrame in
modue CtsIncidentHostTestCases failed
This cts case design 20 frames, every 4 frames include 700ms frame and
150ms frame
When activity launched, first 3 frames need allocate buffer during
dequeue buffer, bug some low-end platform took too long (>6ms), so
it will skip the fourth frame(150ms) and post a new draw callback that will cause cts failed
Otherwise it could lead to parameters applied in the wrong frame,
leading to jank.
Test: Open notification
Bug: 78611607
Change-Id: Ia7900e753b29187a7a7b81f393666687e8b8e04b
Merged-In: Ia7900e753b29187a7a7b81f393666687e8b8e04b
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
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
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
Fixes: 74395652
Test: hwuiunit passes in 'shell stop' state (pseudo-isolated process),
manually checked non-isolated processes still have working vsync
via systrace of RT animations demo
Change-Id: I630ea011dc7eb2efa265b25673d3304b3b2510d3
Fix a crash when trimMemory has occurred and then a java
VectorDrawable object is deleted.
Test: Ran Camera app
Bug: 72837472
Change-Id: I4bdc5975a9ceccc09af17edd9905345f97c2660f
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
It is valid to advertise EGL_EXT_pixel_format_float, but not have a
the requested EGL config. Instead of aborting, fallback to the default
behavior.
Change-Id: I6c602233b627dc2070364434fece57d3d0aab435
Cc: Romain Guy <romainguy@google.com>
Signed-off-by: Rob Herring <robh@kernel.org>
It is valid to advertise EGL_EXT_pixel_format_float, but not have a
the requested EGL config. Instead of aborting, fallback to the default
behavior.
Change-Id: I6c602233b627dc2070364434fece57d3d0aab435
Cc: Romain Guy <romainguy@google.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Enable Skia shader cache after fix for image and text drawing
issues were landed in Skia.
Test: Ran Hangouts, Settings, CNN, Drive, GMail, Calendar, Clock
Test: Maps, Docs, Play store, YouTube apps.
Change-Id: I94cd07e95b704bc164894aa8b8c63f49ded198f5
Disable skia shader cache, which is causing image rendering
issues.
Test: Ran CNN app and images are OK.
Bug: 69264347
Change-Id: Ie81f3398074f28ac1670333f1fd3c95267b2beb3
Avoid fdopen as fclose, which frees the FILE*, will close
the FD which we don't want. Just normalize on dprintf instead,
and we can add buffering if it turns out to matter at some point
Test: ran 'dumpsys gfxinfo framestats' in a loop while observing PSS
Change-Id: I7808753641aa1055cfdf570c3e017017f11f1dee
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
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
Move content bounds into DrawFrameTask. This ensures
that changes in bounds are synchronized with changes in
rendering commands, avoiding potential underdraw.
Bug: 64200212
Test: Repro steps in bug. Drag up/down on resize handle, verify
no flicker.
Change-Id: I3109acf262e23c2a7d8904f1dcbfc8273aaed65b
The path renderer bitfield will soon be private (for Skia testing
only), so switch to using the public flag.
Test: Simple refactoring change, still builds
Change-Id: I6715ba8addd0e104a46842f2398320d1904bb187
Release VectorDrawable cache surface on render thread.
This is fixing an assert in skia GrSingleOwner.h:33.
Test: Ran gmail before and after the change.
Bug: 64842607
Change-Id: I46e0c2557ac5b2fc3be2cc2d35abf96f6d6c9399
Using a shared atlas surface is causing a variance in AA pixels
when drawing the same content. This is causing some CTS tests in
CtsPreference2TestCases to fail because of up to RGB(1,1,1)
difference in AA pixels in screenshots of a recreated activity.
Another effect is reducing memory usage ("GL mtrack" down by
10MB for clock app).
Test: Ran CtsPreference2TestCases tests.
Bug: 64487466
Change-Id: I1e5a547285c885136b6885d129d566d5b0c2ed76
Optimize VectorDrawables for Skia pipeline: draw small VectorDrawables
in a GPU atlas instead of seprate offscreen buffers.
This implementation is using CacheManger and allows for the atlas to
be released if there is a memory pressure.
Test: A new unit test for VectorDrawableAtlas is passing. Systrace shows
0.5ms faster DrawFrame for fling in Settings app main screen.
Change-Id: Ide3884eefae777e1547f1dfdb67b807185839fb4
Since hwui output non-linear scRGB data in wide-gamut, use
the scRGB-nl extension instead of scRGB.
Bug: 62951776
Test: Manual, CtsGraphicsTestCases
Change-Id: Ifdb288e777d12b790b93624ccea9b4f1f6966e52
Layers created using View.setLayerType() or Canvas.saveLayer() need
to be RGBA16F/scRGB-nl when within a window that requested wide color
gamut rendering.
Bug: 29940137
Test: CtsUiRenderingTestCases, CtsGraphicsTestCases, hwui_unit_tests
Change-Id: I42fd6355448c92041491a7109e3ac8a153d38bf9
We now have a fix in the driver so we don't need this workaround
any more.
Test: hwuimacro savelayer2 --onscreen
Bug: 31957043
Change-Id: I8d8a4abcfa809d0cdab3bf63d7f8255febf2aa06