History log of /frameworks/base/libs/hwui/renderstate/RenderState.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
530a2b44d9a4b40d028c912ade858da73081ed85 23-Jan-2017 Arun <arun.demeure@imgtec.com> Disable hwui blending for first draw to main FBO

bug:34809371

In some applications, the first draw is not opaque - either because the
application is misbehaved, or because hwui is not able to reliably tell
whether the layer is opaque or translucent. This is undefined behaviour
in OpenGL ES and has a significant performance and bandwidth impact on
some tiler GPUs as it requires loading the previous frame's color data.
This change disables blending in that case and also for effectively
opaque blend modes (SRC=GL_ONE, DST=GL_ZERO). It increases performance
by ~10% for Leanback CTS on some low-end GPUs (gradient layer that hwui
incorrectly believes to be translucent).

Test: manual - visual inspection on fugu (nexus player)

Change-Id: I2cbf1c76678acae1a36923e72fd18ed55cd89dc2
/frameworks/base/libs/hwui/renderstate/RenderState.h
642ebea6e14b72c512ef1168dc6edb061035dded 17-Jul-2017 John Reck <jreck@google.com> Delete all ro.hwui.* props

Remove all ro.hwui.* tuning props and instead
calculate them from the screen resolution.

Or just hardcode them to what all devices
were hardcoding them to anyway.

Bug: 63741221
Test: Check cache size results on sailfish

Change-Id: I8b0d210572a246f4fefb076935cf5156a70c274c
Merged-In: I8b0d210572a246f4fefb076935cf5156a70c274c
(cherry picked from commit 8dc02f99d09130ace2ee738c2e689db1b3f33181)
/frameworks/base/libs/hwui/renderstate/RenderState.h
f9e45d1d818ae0956ba77ed598b7040cfecca553 01-Jun-2017 Derek Sollenberger <djsollen@google.com> Implement CacheManager for the Skia pipelines.

The core of the implementation is complete and provides heuristic
cache sizing based on the size of the surface being used. This CL
will also be used to add the following features in the future...

1) Support Vulkan pipeline reporting on the size of the surface.
2) Complete the VectorDrawableAtlas stub code
3) Automatic purging of stale resources for low memory devices.

Test: hwui_unit_tests (new test added) and CtsUiRendering
Bug: 62260637
Change-Id: Ib85159cca28b646fe249f2190b07f1b7e0f50d8f
/frameworks/base/libs/hwui/renderstate/RenderState.h
9a814875c4e3a98fea99dae623f22268a9afa38a 23-May-2017 John Reck <jreck@google.com> Improve time to texture destruction

Eliminate textureCache.mGarbage which is only cleared
in a trimMemory. Instead when we hit ~Bitmap post a
message to RenderThread to release the texture immediately

Bug: 38258699
Test: manual
Change-Id: I962ba275e89afb628ba02f74769287edbab9fed4
/frameworks/base/libs/hwui/renderstate/RenderState.h
c3f131696111a066d9efd9c7c3e37566a2a9fb89 06-Feb-2017 sergeyv <sergeyv@google.com> Clean up deferredLayers only onGpuContextDestroyed.

Test: manual
bug:34919311
Change-Id: I5488b0845ec3922424f5893943e4f42675dfc9fd
/frameworks/base/libs/hwui/renderstate/RenderState.h
3e9999bd866fac71c72e6b484a9836c87c328a08 20-Jan-2017 sergeyv <sergeyv@google.com> Explicitly destroy Layer in DeferredLayerUpdater on destroyHardwareResources()

Change-Id: I0987104eabda9a2a302b9e765213aad48f93aea4
Test: refactoring CL. Existing tests still pass
bug:33753499
/frameworks/base/libs/hwui/renderstate/RenderState.h
45ec62ba72c5017fae7d8baab20bfb0d4c99c627 04-Jan-2017 Greg Daniel <egdaniel@google.com> Add support for dummy draws for Vulkan webview and texture views.

Test: manual testing
Change-Id: Iaec8c3a34367673c281665ff6c6e97d1ce532265
/frameworks/base/libs/hwui/renderstate/RenderState.h
253f2c213f6ecda63b6872aee77bd30d5ec07c82 29-Sep-2016 Romain Guy <romainguy@google.com> Linear blending, step 1

NOTE: Linear blending is currently disabled in this CL as the
feature is still a work in progress

Android currently performs all blending (any kind of linear math
on colors really) on gamma-encoded colors. Since Android assumes
that the default color space is sRGB, all bitmaps and colors
are encoded with the sRGB Opto-Electronic Conversion Function
(OECF, which can be approximated with a power function). Since
the power curve is not linear, our linear math is incorrect.
The result is that we generate colors that tend to be too dark;
this affects blending but also anti-aliasing, gradients, blurs,
etc.

The solution is to convert gamma-encoded colors back to linear
space before doing any math on them, using the sRGB Electo-Optical
Conversion Function (EOCF). This is achieved in different
ways in different parts of the pipeline:

- Using hardware conversions when sampling from OpenGL textures
or writing into OpenGL frame buffers
- Using software conversion functions, to translate app-supplied
colors to and from sRGB
- Using Skia's color spaces

Any type of processing on colors must roughly ollow these steps:

[sRGB input]->EOCF->[linear data]->[processing]->OECF->[sRGB output]

For the sRGB color space, the conversion functions are defined as
follows:

OECF(linear) :=
linear <= 0.0031308 ? linear * 12.92 : (pow(linear, 1/2.4) * 1.055) - 0.055

EOCF(srgb) :=
srgb <= 0.04045 ? srgb / 12.92 : pow((srgb + 0.055) / 1.055, 2.4)

The EOCF is simply the reciprocal of the OECF.
While it is highly recommended to use the exact sRGB conversion
functions everywhere possible, it is sometimes useful or beneficial
to rely on approximations:

- pow(x,2.2) and pow(x,1/2.2)
- x^2 and sqrt(x)

The latter is particularly useful in fragment shaders (for instance
to apply dithering in sRGB space), especially if the sqrt() can be
replaced with an inversesqrt().

Here is a fairly exhaustive list of modifications implemented
in this CL:

- Set TARGET_ENABLE_LINEAR_BLENDING := false in BoardConfig.mk
to disable linear blending. This is only for GLES 2.0 GPUs
with no hardware sRGB support. This flag is currently assumed
to be false (see note above)
- sRGB writes are disabled when entering a functor (WebView).
This will need to be fixed at some point
- Skia bitmaps are created with the sRGB color space
- Bitmaps using a 565 config are expanded to 888
- Linear blending is disabled when entering a functor
- External textures are not properly sampled (see below)
- Gradients are interpolated in linear space
- Texture-based dithering was replaced with analytical dithering
- Dithering is done in the quantization color space, which is
why we must do EOCF(OECF(color)+dither)
- Text is now gamma corrected differently depending on the luminance
of the source pixel. The asumption is that a bright pixel will be
blended on a dark background and the other way around. The source
alpha is gamma corrected to thicken dark on bright and thin
bright on dark to match the intended design of fonts. This also
matches the behavior of popular design/drawing applications
- Removed the asset atlas. It did not contain anything useful and
could not be sampled in sRGB without a yet-to-be-defined GL
extension
- The last column of color matrices is converted to linear space
because its value are added to linear colors

Missing features:
- Resource qualifier?
- Regeneration of goldeng images for automated tests
- Handle alpha8/grey8 properly
- Disable sRGB write for layers with external textures

Test: Manual testing while work in progress
Bug: 29940137

Change-Id: I6a07b15ab49b554377cd33a36b6d9971a15e9a0b
/frameworks/base/libs/hwui/renderstate/RenderState.h
49796451cb9d1dae580618eb320ef3c5e6d90cd4 10-Aug-2016 Chih-Hung Hsieh <chh@google.com> Fix clang-tidy warnings in libs/hwui.

* Add explicit keyword to conversion constructors.
Bug: 28341362
* Use const reference type for read-only parameters.
Bug: 30407689
Test: build with WITH_TIDY=1

Change-Id: Iab3e6636f60a70cb124f29dc19f20f842fa8dfda
/frameworks/base/libs/hwui/renderstate/RenderState.h
0b8d0677be2289bbc9e0b48c0878fb67d1cc0ebd 29-Jan-2016 John Reck <jreck@google.com> Fix copyLayerInto

Bug: 26763945
Change-Id: I21ffbd56cf70bad0928416963e6fc254be435af9
/frameworks/base/libs/hwui/renderstate/RenderState.h
a55b5d6c65cde2b7cc28bb3ea160bfaaef7a446a 15-Jan-2016 John Reck <jreck@google.com> Fix "leak" in FrameBuilder.textureLayer test

DeferredLayerUpdater always did a post to delete itself, which
would result in the test thinking it had leaked an object since
it wasn't deleted when it returned. Fix this by deleting immediately
if we're already on the right thread.

Remove RenderState's requireGlContext assert as it's now
covered by GpuMemoryTracker, which is also more test friendly.
RenderState's assert required an actual EGL context, which we
don't mock away in unit tests.

Change-Id: Ic23eb54e7151355f7acca483d7464350c9d6a87f
/frameworks/base/libs/hwui/renderstate/RenderState.h
9fded232a9548a304e0145011df8849fba0dcda7 12-Nov-2015 Chris Craik <ccraik@google.com> Recycle OffscreenBuffers

Change-Id: Ia2e219026f211a5308ecf8209c5f986bb888aadd
/frameworks/base/libs/hwui/renderstate/RenderState.h
5854b34881b1a747ac80b5077869ef270a92b1f4 26-Oct-2015 Chris Craik <ccraik@google.com> Rework receiver/dispatcher design slightly, and replace Layer usage.

Switched from 'renderer/info' to 'dispatcher/renderer' to make their
interaction more natural. The new BakedOpRenderer is more similar in
responsibilities to the OpenGLRenderer, as it manages layer and frame
lifecycles, and performs the actual rendering.

However, it's still simpler because the BakedOpDispatcher handles
mapping Canvas drawing ops to Glops, and the OpReorderer handles almost
all canvas state operations.

Also switch BakedOpRenderer to use the new OffscreenBuffer, which
serves as a lightweight Layer replacement, with a much simpler
lifecycle.

Change-Id: Ie0e2e248503400041d49729d813d485d28c76eb3
/frameworks/base/libs/hwui/renderstate/RenderState.h
818c9fbf1d76d5df19253ba4eb964efa939ec9ec 23-Oct-2015 Chris Craik <ccraik@google.com> Initial version of clipped saveLayer in new pipeline

Additionally disables usage of FBO cache, so FBO destruction safely
interacts with renderstate caching.

Change-Id: I25c277cb7afec2ca33bf226445d6c8867a15a915
/frameworks/base/libs/hwui/renderstate/RenderState.h
12efe649d3f5df8e81f4b78179939c1d488673a0 29-Sep-2015 Chris Craik <ccraik@google.com> Move ortho matrix out of glop

It's fbo-global, so don't bother stashing/restoring it repeatedly.

Change-Id: Icb32e3eda5d2086aaae07140f8ff40e038dad5fe
/frameworks/base/libs/hwui/renderstate/RenderState.h
117bdbcfa3e8306dad21e7e01fa71b00cdfa7265 05-Feb-2015 Chris Craik <ccraik@google.com> Glop ColorFilter & VertexBuffer support, initial enable

Enables Glop rendering for supported Rects and VertexBuffers
Also removes unused Query object

Change-Id: Ibe227bc362685a153159f75077664f0947764e06
/frameworks/base/libs/hwui/renderstate/RenderState.h
6c15ffa196fc9b7724c189d833c3435d8db12266 02-Feb-2015 Chris Craik <ccraik@google.com> Refactoring of Program ownership/lifecycle, and WIP Glop rendering path

Change-Id: I2549032790bddbc048b0bccc224ed8f386b4517c
/frameworks/base/libs/hwui/renderstate/RenderState.h
44eb2c00861098dd3e2950d923646814b4cc57c2 29-Jan-2015 Chris Craik <ccraik@google.com> Refactor blending and texture gl state

Change-Id: Ia6b3c8b2afd3dfcee7f3ce401d846b789612054a
/frameworks/base/libs/hwui/renderstate/RenderState.h
49bc4acfadf9c5b1e520217278ccb38010d38c89 29-Jan-2015 John Reck <jreck@google.com> resolved conflicts for merge of fe5ac4fc to master

Change-Id: I6c0cc82db14b56297586469f940e408c0e218b3b
96a5c4c7bab6718524de7253da8309143ab48bef 28-Jan-2015 Chris Craik <ccraik@google.com> Move more GL state management to RenderState and its directory

Change-Id: Ic68584e1c08dc64be2ad43450cb6caa1de834fdc
/frameworks/base/libs/hwui/renderstate/RenderState.h
65fe5eeb19e2e15c8b1ee91e8a2dcf0c25e48ca6 27-Jan-2015 Chris Craik <ccraik@google.com> Move scissor state to RenderState

Change-Id: I1227a3886fb24e4d9fad79fca469794f06cfb15e
/frameworks/base/libs/hwui/renderstate/RenderState.h