History log of /frameworks/base/libs/hwui/renderthread/EglManager.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a896306c38c4d11c43b967a21db6d74c251b2520 14-Jun-2017 John Reck <jreck@google.com> Add a workaround for simulate secondary display

To workaround a deadlock caused by bufferqueue locks
we force RenderThread over to use async mode which
we enable via eglSwapInterval(0)

Bug: 38372997
Test: steps in the bug
Change-Id: Ia305f73abbdd64ab0c25d1f7d32792cc6295a0ce
ab61fb8b5f3e7fc807bd335fcfe088d2d0fcb13a 23-Feb-2017 Derek Sollenberger <djsollen@google.com> Update framework to use new method for disabling DF path rendering.

Test: compile only
Change-Id: Ifa690a0af01cb6b07c4fd303302cb6a557e8dfde
b77c94a96abeeecf65c5b3292db679c049af6271 07-Dec-2016 Matt Sarett <msarett@google.com> Disable buffer age swap behavior for SkiaGL on Adreno gpus

Test: Verified that this fixes rendering bugs.

Change-Id: I3e5bca73eae2d917906658f76d8c432dbb248d89
173215d1b20b70908a9d1807f1372bd95b7ad5f1 12-Jan-2017 Mark Salyzyn <salyzyn@google.com> resolve merge conflicts of ec7e2a164c37 to master

Test: compile
Bug: 26552300
Bug: 31289077
Change-Id: I49c6e41b79061e2b3c0352e3ac8fa5ebb152b6f5
96bf5985d5a360568832fd26b6d5b44236c9343e 29-Sep-2016 Mark Salyzyn <salyzyn@google.com> Replace cutils/log.h and log/logger.h with android/log.h or log/log.h
(part deux)

Test: compile
Bug: 26552300
Bug: 31289077
Change-Id: I7417936c4d3666608fccfe51a312c90ecefba2fb
1deac99c557d4be757c266e066a0d614c1959474 27-Sep-2016 John Reck <jreck@google.com> Support EGL_KHR_partial_update without EGL_EXT_buffer_age

Bug: 31334677
Test: manual && hwuimacro --onscreen partialdamage

Change-Id: I9b346b4053ec12c8a78a143a4dc0e708c44888a2
cd55852fcd840f7f4c4d7a0a7253a2995c77afa2 17-Nov-2016 Greg Daniel <egdaniel@google.com> Make buffer age work in Vulkan

Test: manual testing in skiavk mode

Change-Id: I5b9d8af7d9cecf2f022ef104ec33a5b7477e9e0c
7e044fef628c7deb25189958714cb93a714a3617 07-Nov-2016 Derek Sollenberger <djsollen@google.com> Enable SkiaPipelines to interoperate with existing GlesDriver configs.

Test: hwui unit tests
Change-Id: Icd94d0e21130d86fb5514801f999d0018a69e151
97cc85fd4b5ab6070ce75c2792369d4611625eaf 01-Nov-2016 Sergei Vasilinetc <sergeyv@google.com> Merge "Routine to upload hardware bitmaps"
694d499662838123f474f41b31dea84ec5d563f0 27-Oct-2016 sergeyv <sergeyv@google.com> Routine to upload hardware bitmaps

Change-Id: Id8283a0975325e6830d55fd1e33c5f292a1e9be0
Test: refactoring cl.
98f75d53dbe243b1661c616643698e025d4978f6 25-Oct-2016 Derek Sollenberger <djsollen@google.com> Store GrContext on RenderThread for use by Skia-based renderers.

Test: built and booted on device
Change-Id: I4c1060ec72bc67e54e6b2d25b1f2c13aaa513f89
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,

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

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
- 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
8733bff058e12075e50c15c0c56c20298cc5f44f 27-Sep-2016 John Reck <jreck@google.com> Support EGL_KHR_partial_update without EGL_EXT_buffer_age

Bug: 31334677
Test: manual && hwuimacro --onscreen partialdamage

Change-Id: I9b346b4053ec12c8a78a143a4dc0e708c44888a2
8afcc76920499d0a384dba1470c5a377f80ed768 13-Apr-2016 John Reck <jreck@google.com> Revert "Revert "Make stopped state a first-class thing""

This reverts commit eab3f2658aa41d37c3b05d49a2ce4e3f4ed85399.

Fixes first-frame issue, mReportNextDraw needs to override

Fixes: 28118961
Fixes: 27286867

Change-Id: I5c811759637d08ba9f3b342016d1b3006986d5a2
eab3f2658aa41d37c3b05d49a2ce4e3f4ed85399 11-Apr-2016 John Reck <jreck@google.com> Revert "Make stopped state a first-class thing"

This reverts commit 945961f78a78eced823d5ba78505c781b079703d.

Change-Id: Iebc1d49fac33380233f8785fc39bec6c30a5e714
945961f78a78eced823d5ba78505c781b079703d 08-Apr-2016 John Reck <jreck@google.com> Make stopped state a first-class thing

Bug: 27286867

WindowManager has committed to stopped state
controlling the lifecycle of the Surface, so
make that a first-class thing in HWUI as well.

This makes it more resistent to things like
a rogue updateSurface() happening while mStopped=true,
leading to bad things down the line. Instead let
the surface be changed/updated as often as desired,
and just block any attempt to draw on that surface.

Also removes some unnecessary makeCurrent()s, as
EglManager ensures that we *always* have a valid
GL context now (using a pbuffer surface if there is
no window surface set)

Change-Id: Iead78ddebc7997e8fdb0c9534836352f5e54b9bd
fc736869aced442057e5a2c16a9591dca1f93295 27-Feb-2016 John Reck <jreck@google.com> Switch to pbuffer surface sooner

Bug: 27286867

If the system/app is slow, it might take too long to
stop drawing. Switch the ordering of destroying stuff so
that we switch to the pbuffer surface first, then do

Change-Id: If64a3dbb71bb9fd53567231590436a89b2f1a09e
c96955d9bb997b51be5fa929b5a67349d0459c3a 26-Feb-2016 John Reck <jreck@google.com> Always swap buffers if using partial update extension

Bug: 27379093
Change-Id: Ifda18287248e4ae07d4bf2ae9642a9d23039e81f
d1ddcf19bbb17cad09ec93b2ad09b1e1e0bfb3ff 06-Feb-2016 John Reck <jreck@google.com> resolve merge conflicts of 9ea5295597 to master.

Change-Id: I68b883e8a1bb17abd4cf151d057dd07e53a80f50
9a878a646f6aca6160f22c139a5efd4de94199f8 05-Feb-2016 Christian Poetzsch <christian.potzsch@imgtec.com> hwui: set buffer destroyed swap mode explicitly

Not using EGL_SWAP_BEHAVIOR_PRESERVED_BIT as config attribute for
eglChooseConfig doesn't automatically mean the swap behavior is buffer
destroyed. This is driver implementation specific and on some hw this
can still be buffer preserved. Make sure it is buffer destroyed by
explicitly setting it for every new surface when requested.

Change-Id: Ie2c7c89b0d20e35832b488c6263bb4d9dd844a75
Signed-off-by: Christian Poetzsch <christian.potzsch@imgtec.com>
892760008f7c774b3556b1863c6228f3d55d4246 21-Jan-2016 Zhang Dongsheng <dongsheng.zhang@intel.com> libhwui: handle eglSwapBuffers with EGL_BAD_NATIVE_WINDOW error case

If eglSwapBuffers is called but the under surface was destroyed,
the EGL_BAD_NATIVE_WINDOW error may also be generated according
to the EGL spec 1.4.

This really shouldn't happen from the upper, but add the graceful
handling of this case also.

Change-Id: Ic0a599808b72f401d2a01c3dc40f9e6ea0e0a564
Signed-off-by: Zhang Dongsheng <dongsheng.zhang@intel.com>
Signed-off-by: Zhiquan Liu <zhiquan.liu@intel.com>
682573c84b7c21dc8ce4a2375da3961147442c4a 30-Oct-2015 John Reck <jreck@google.com> Add some options to macrobench

Change-Id: If8d5f5d3ace050577986a554182b2b66fd2257e1
704bed0da7cc75d0c517d425445de70ceb58060b 05-Nov-2015 John Reck <jreck@google.com> add DeviceInfo

This reverts commit 096895550b9d5430d7a001d491566decf4f9791b.

Change-Id: Ib2ed1e96d8f7f88302f5e27fe735687194553104
096895550b9d5430d7a001d491566decf4f9791b 05-Nov-2015 John Reck <jreck@google.com> Revert "add DeviceInfo"

This reverts commit b2442896e3a226c7ebe9d47fa80b257e98a6a34d.

Change-Id: I50f6555451f71067505245333c8e558b5e3b2b3b
b2442896e3a226c7ebe9d47fa80b257e98a6a34d 04-Nov-2015 John Reck <jreck@google.com> add DeviceInfo

Change-Id: I4c122278a7e88b6f47c4dd3c5fc553df7d3c900d
c2547fa6f9a0f4247b35edcee69f3c3cc3510b1a 26-Oct-2015 John Reck <jreck@google.com> eglSwapBuffers can also return EGL_BAD_NATIVE_WINDOW

Bug: 25017107
Change-Id: I545a746ba89d577de5769bc3e7dd335a100638c0
708b6687da23d2ac5bd394dec3e6d950b34d5b6c 22-Oct-2015 John Reck <jreck@google.com> Add assert for required EGL extensions

Bug: 25149700

Change-Id: I535ead7c1f8ba8766dff85fcf26a9cfe76647fb8
a672f6ba4c9f65de0b94bcdc639f1e053d7ee5d9 22-Oct-2015 John Reck <jreck@google.com> Remove obsolete debug option

Bug: 25149700
Change-Id: I9280e2414255fb01e672094cd8d173efadac1681
6e6646c03788f198a9878763680c05342d7622f3 15-Sep-2015 Chris Craik <ccraik@google.com> Unify extensions parsing behavior

Removes remnants of EGL extension support, and persistence of
GL extension list.

Change-Id: I35aec12d900bdb33549ea47654bb8146f350ef48
149173d28c0843aba86b0810ce75b34be6a0d08f 10-Aug-2015 John Reck <jreck@google.com> Support new EGL extensions

Bug: 21753739

Includes a revert of 13d1b4ab10fbee5e81a2ba1ac59cfae1e51d3ef0
as that only supported EGL_EXT_buffer_age

Change-Id: Ia86a47d19e3355c067934d7764c330b640c6958d
13d1b4ab10fbee5e81a2ba1ac59cfae1e51d3ef0 30-Jul-2015 Season Li <seasonl@nvidia.com> renderthread: add EGL_EXT_buffer_age support

EGL_EXT_buffer_age is better than EGL_BUFFER_PRESERVED
because it can save memory bandwidth used to blit
back buffer into front buffer.

Change-Id: I2fea0ee08dc7dd66e348b04dd694d075d509d01b
f2dcc2aecb94e726096256c47b913ed0a57ae7e2 16-Jul-2015 John Reck <jreck@google.com> Don't crash on makeCurrent fail

Bug: 22444755

WindowManager may decide to yank the surface at any point, so
attempt to kinda handle this

Change-Id: Id2f665d2f0f93bccd4ec977fbf52dca4dc1ec891
4cd44f8110c3b648a7eeb526152b2a50e0a376a1 27-May-2015 John Reck <jreck@google.com> Enable swapBuffersWithDamage by default

Bug: 20761426

Change-Id: I520e60ca4f182dea590bc86eebd522e1db7a018a
d7db4d767246b41d44995acb93d03d220b53c748 20-May-2015 John Reck <jreck@google.com> Eliminate requireGlContext

Bug: 20297820

Change-Id: I37c63bab6f6c0d2337c8c6002046d2ef17e74097
d04794a9a3f9edc8b7ca336175d66eb81a8f55fa 08-May-2015 John Reck <jreck@google.com> Add eglSwapBuffersWithDamageKHR support

BUG: 20761426
Disabled temporarily

Change-Id: I0b6b6f0eebab886145e13fa35aefe76826965cf5
8a6b56651b42df2a073d68bbaf23e681acd7eeb5 31-Jan-2015 John Reck <jreck@google.com> Merge "Add a WAIT_FOR_GPU_COMPLETION option"
5515637540bedd8fc9a1a6e46a4b512dd45520a5 21-Jan-2015 John Reck <jreck@google.com> Add a WAIT_FOR_GPU_COMPLETION option

Change-Id: I18d526120651676109200bfd5da87cafcd7e3d13
44eb2c00861098dd3e2950d923646814b4cc57c2 29-Jan-2015 Chris Craik <ccraik@google.com> Refactor blending and texture gl state

Change-Id: Ia6b3c8b2afd3dfcee7f3ce401d846b789612054a
65fe5eeb19e2e15c8b1ee91e8a2dcf0c25e48ca6 27-Jan-2015 Chris Craik <ccraik@google.com> Move scissor state to RenderState

Change-Id: I1227a3886fb24e4d9fad79fca469794f06cfb15e
d41c4d8c732095ae99c955b6b82f7306633004b1 06-Jan-2015 Chris Craik <ccraik@google.com> Add overrides and switch to nullptr keyword for all files

Adds remaining missing overrides and nullptr usages, missed due to
an extreme failure in tool usage.

Change-Id: I56abd72975a3999ad13330003c348db40f59aebf
59cf734f9ee8fa0154d199f0f36779a6ffe0dfb5 11-Dec-2014 Yohann Roussel <yroussel@google.com> resolved conflicts for merge of d67bb501 to master

Change-Id: I40698ce1e382cb41eec7af5ea49ac0e2f997d555
ebd52610cfeff6e557fde284a7e1efc5e6438285 11-Dec-2014 John Reck <jreck@google.com> Don't preload textures for AssetAtlas

Bug: 18317479

RenderNode::prepareSubTree calls prefetchAndMarkInUse
on every bitmapResoruce in the DisplayList. However,
this resulted in textures being uploaded for bitmaps
that would be drawn from the AssetAtlas instead.

To fix this we teach TextureCache about the AssetAtlas
so that calls to TextureCache return the Texture from
AssetAtlas if it exists. Thus usage of AssetAtlas
is now purely to allow for further optimizations via
draw merging instead of a requirement to get
any benefit at all.

Change-Id: I65282fa05bac46f4e93822b3467ffa0261ccf200
27eaec23881f9564f98b484765d000822de5fdc3 18-Nov-2014 John Reck <jreck@google.com> am 842697a3: am decc26df: am f0f68117: Merge "Trace some interesting events" into lmp-mr1-dev

* commit '842697a3602204036e991cfea8b74da3df6e7f14':
Trace some interesting events
fbc8df03e498baf47ff1a5e05e182f1bcd60c770 15-Nov-2014 John Reck <jreck@google.com> Trace some interesting events

Bug: 18337099
Change-Id: Ie2e60da2b9f06e0368061c944d8123ab6903355c
9481684560b2815d2706512086bb36467ef6acc0 01-Nov-2014 John Reck <jreck@google.com> am e05575e9: am a8d83d63: Merge "Layer changes" into lmp-mr1-dev automerge: a51fba0

* commit 'e05575e9c36850d8cfe49396ac9a1372511b12bf':
Layer changes
0e89e2b7bcb2c035e8cee77f93120e7c5617f8d2 31-Oct-2014 John Reck <jreck@google.com> Layer changes

Bug: 17208461

* Switch Layer to be VirtualLightRefBase instead of
Caches' side-channel ref-counting
* Include active layers in gfxinfo dump
* Run gfxinfo dump on the correct thread
* Dump gfxinfo on Layer creation failure

Change-Id: I28d195699e2334518e215ab28c7a17355aee9678
eaab65f49d320f0689ee52a55bb768907e5e6928 30-Oct-2014 John Reck <jreck@google.com> am 97054254: am 141823ec: Merge "Be more conservative about current buffer" into lmp-mr1-dev automerge: a27e1a3

* commit '97054254d4c8eef66538814e1d5def776ceba97a':
Be more conservative about current buffer
950ff1b88cc1330f8e80d62ed3aa15bee6be0556 27-Oct-2014 John Reck <jreck@google.com> Be more conservative about current buffer

Bug: 18065565
Change-Id: I0b9c85ecf384ebe525e3a38803ab77d7ee37f33a
675a518d5aca3092bfdd438f3f40bfdc3640cb80 24-Oct-2014 John Reck <jreck@google.com> am b64e4372: am 82572cc4: am badac04d: Merge "Add some free zoom to lockHardwareCanvas" into lmp-mr1-dev

* commit 'b64e4372bb60bdce75e2af7d0b94efe92d94ac6a':
Add some free zoom to lockHardwareCanvas
1125d1fa92ab9f3b8315bbfb72e038b62dfd454b 23-Oct-2014 John Reck <jreck@google.com> Add some free zoom to lockHardwareCanvas

Bug: 18099195

Don't use EGL_SWAP_BUFFER_PRESERVED on surfaces that will
never benefit. Also clean up some confusing naming

Change-Id: I674ca64e0464a3282cff79e5ecd350d08f47c014
2dc236b2bae13b9a0ed9b3f7320502aecd7983b3 15-Oct-2014 Tom Hudson <tomhudson@google.com> Clean up physical coupling

Narrow the use of #include directives in hwui, replacing with forward
declarations where straightforward. Speeds compiles; doesn't do any
restructuring of code.

Change-Id: Icac2baffb5896f55d8c6718e9bd9d4bfa02d3ca0
2cdbc7d2283aae3d77b12c8fdbba8ca4bd3db5ea 18-Sep-2014 John Reck <jreck@google.com> Special case EGL_BAD_SURFACE

Bug: 17516789

Change-Id: I3dcb10360c2aef6326f7dbbff6815866d4c143b6
998a6d81896df8b662cc10ddeb35087b78b38d72 29-Aug-2014 John Reck <jreck@google.com> Track buildLayer calls, destroy if unused

Bug: 17208461

Change-Id: Ibdb104a493285d77a6891c5e74e38a52c7014da9
1d4774233304c484673e2af2c1de2ab41021c979 27-Aug-2014 Chris Craik <ccraik@google.com> Crash instead of leaking layers/textures between GL contexts

Change-Id: I4d58f301cf0f5e8145e808a5d6ade4de7801970b
3b20251a355c88193c439f928a84ae69483fb488 23-Jun-2014 John Reck <jreck@google.com> No-fail invokeFunctor

Bug: 15513308
Bug: 15449247

Change-Id: I13a29f9c8d4975cdda6dcb33b6332c2555ff0f7c