summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/EglManager.h
AgeCommit message (Collapse)Author
2020-07-30Wire-up colorMode="hdr"John Reck
Fow now it uses a fixed white point of 150nits TBD if this is disabled or adjusted Test: Demo app Change-Id: Iac13597b3d7633fdef3feaf7ec1da0c27c87904c
2020-03-01[HWUI] remove libui from HWUI's dependenciesAlec Mouri
Bug: 136263238 Test: builds Test: interact with device Change-Id: I18540f78a4ee5ffcc30c96ff7862480e1d8fe50a
2019-11-08Decouple SurfaceTexture from HWUIStan Iliev
Remove all Skia and HWUI types from SurfaceTexture implementation. Move SurfaceTexture to libgui (ag/9578265). Define private C++ API for SurfaceTexture, which is consumed by DeferredLayerUpdater. Move AutoBackendTextureRelease/Skia code from SurfaceTexture to HWUI. Test: pass CtsUiRenderingTestCases and CtsViewTestCases Bug: 136263580 Change-Id: I3f971bb490f64a3ac0b2a66a89ba935bf7f08213
2019-01-24Remove use of SkColorSpace::Gamut enumBrian Osman
Get the gamut matrix from the color space, compare against sRGB/P3. Test: Refactoring CL. Change-Id: I9f5bcae8c1f637919ee9da892266ea882f16208c
2018-12-15[HWUI] Remove hardcoding around wide color gamut.Peiyong Lin
Previously we hardcode wide color gamut in HWUI as scRGB color space with FP16 pixel format. However, the hardware composer doesn't support this combination. This patch plumbs wide color gamut composition preference from composer API to HWUI such that HWUI can now pick the combination of color space and pixel format for the surface. BUG: 111436479 Test: Build, flash and boot, verify with a demo app. Change-Id: I7a8b4d8deca72ef40069dba9d23a3f5e90dbfe5a
2018-11-15Add a sprinkle of speculative anti-crash dustJohn Reck
Bugs: way too many Bug: 113367810 Test: well it builds... Change-Id: If00bcaad1c535c4996b59c1b5a7d3a4bba849191
2018-09-27Partially revert "[HWUI] Implement legacy color mode."Peiyong Lin
Reason for partially revert: Step back a little bit to think about how we want to move the view system forward. This patch removes the legacy mode we have added, as well as move color type and color space of the surface to SkiaPipeline. BUG: 111436479 BUG: 113530681 Test: Build, flash, boot and check dumpsys SurfaceFlinger Change-Id: I1ab7b88d41347284d87649618e5a15f5c6bcf8fe
2018-09-13[HWUI] Implement legacy color mode.Peiyong Lin
Previously, HWUI always produces SRGB buffers. We introduced new APIs for SurfaceFlinger, a.k.a. the composer service to return to composition preference for data space, and pixel format. This patch makes HWUI query composition preference from composer service, and creates the corresponding EGL surface with the correct attributes. In legacy mode, HWUI will take the pixel value from source color space, and interpret it as pixel value in destination color space. BUG: 111436479 BUG: 113530681 Test: Build, flash, boot and check dumpsys SurfaceFlinger Change-Id: I64562d5ea6f653076c8b448feb56b5e0624bc81c
2018-09-05Reland "TextureView Vulkan support and optimized OpenGL draw"Stan Iliev
Fix an issue with incorrect texture matrix, when there is 90/270 rotation. This happened, because after refactoring SkImage has buffer width/height, instead of layer width/height. This reverts commit a683eb3945320f592f58705c3c31b3c044f4bd72. Bug: 113673613 Test: Ran TextureView CTS and lensblur in camera app Change-Id: If3bcf9cd5195de09fd67a753708568a8e3ca3a9a
2018-09-04Revert "Revert "Revert "TextureView Vulkan support and optimized OpenGL draw"""Stan Iliev
This reverts commit 85f9096b5272c9a39e592e2e97cbbe6cb0e767ab. Reason for revert: lensblur broken. Change-Id: I83ac163159fc537bc15936a0f8597a7512ca9d6e
2018-08-31Revert "Revert "TextureView Vulkan support and optimized OpenGL draw""Stan Iliev
This reverts commit 867c43de0544217d26c3ee18f4d6603bb2ea97ce. Reason for revert: Fixed issue with unsupported hardware buffer formats by landing https://skia-review.googlesource.com/c/skia/+/150470 "Support more hardware buffer formats" Bug: 113673613 Change-Id: I1f7c528f138e290160e75833c8d989d9535002ee
2018-08-30Revert "TextureView Vulkan support and optimized OpenGL draw"John Reck
This reverts commit c8e22a653297837da9a80b0ba65f6854c8986c96. Reason for revert: broke camera, b/113555199 Bug: 113555199 Change-Id: Iae9b462694d5de0cd99427afead63b567fb4d71d
2018-08-29TextureView Vulkan support and optimized OpenGL drawStan Iliev
Render TextureView as hardware bitmaps, instead of GL textures. Cache SkImage for each observed GraphicBuffer, which is faster even for GL. Implement C++ SurfaceTexture, which allows Java SurfaceTexture to be used with Vulkan HWUI render thread and application GL. threads. Delete GLLayer and VkLayer classes and texture code from old HWUI pipeline. Test: Ran skiagl and skiavk pipeline with a TextureView app. Test: TextureView CTS tests pass for GL pipeline. Test: Ran Android NDK Native codec sample app. Change-Id: Idc94f864ce2d34fd6ceff4be4fc7d3327e99879c
2018-05-09A better HW Bitmap uploaderJohn Reck
Move all HW bitmap upload operations off of RenderThread. Ensure EGL context outlives all upload requests Bug: 79250950 Test: builds, boots, systrace is good, CTS bitmap tests pass Change-Id: I5ace6c516d33b1afdf1a407cd8b183f6b60c22c1
2018-04-26Remove RenderThread from EglManagerJohn Reck
Refactor to make EglManager re-usable. Test: hwuiunit passes, hwuimacro works Change-Id: Ie8e9398c703fada1dc5d8baca5f42485eadea202
2017-11-03Format the world (or just HWUI)John Reck
Test: No code changes, just ran through clang-format Change-Id: Id23aa4ec7eebc0446fe3a30260f33e7fd455bb8c
2017-06-02Enable wide color gamut renderingRomain Guy
When wide color gamut rendering is requested, hwui will now use an rgba16f scRGB-nl surface for rendering. This change also fixes the way screenshots are handled in the platform to behave properly with wide gamut rendering. This change does not affect hardware layers. They also need to use rgba16f scRGB-nl; this will be addressed in another CL. Bug: 29940137 Test: CtsUiRenderingTestCases, CtsGraphicsTestCases Change-Id: I68fd96c451652136c566ec48fb0e97c2a7a257c5
2016-12-09Make buffer age work in VulkanGreg Daniel
Test: manual testing in skiavk mode Change-Id: I5b9d8af7d9cecf2f022ef104ec33a5b7477e9e0c
2016-11-03Implement Skia pipelines for OpenGL and Vulkan.Stan Iliev
Implement Skia pipelines for OpenGL and Vulkan: base SkiaPipeline, SkiaOpenGLPipeline and SkiaVulkanPipeline. Write unit tests for SkiaPipeline. Test: Built and run manually on angler-eng. Change-Id: Ie02583426cb3547541ad9bf91700602a6163ff58
2016-10-31Routine to upload hardware bitmapssergeyv
Change-Id: Id8283a0975325e6830d55fd1e33c5f292a1e9be0 Test: refactoring cl. bug:30999911
2016-10-11Linear blending, step 1Romain Guy
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
2016-08-10Fix clang-tidy warnings in libs/hwui.Chih-Hung Hsieh
* 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
2016-02-26Always swap buffers if using partial update extensionJohn Reck
Bug: 27379093 Change-Id: Ifda18287248e4ae07d4bf2ae9642a9d23039e81f
2015-08-12Support new EGL extensionsJohn Reck
Bug: 21753739 Includes a revert of 13d1b4ab10fbee5e81a2ba1ac59cfae1e51d3ef0 as that only supported EGL_EXT_buffer_age Change-Id: Ia86a47d19e3355c067934d7764c330b640c6958d
2015-08-04renderthread: add EGL_EXT_buffer_age supportSeason Li
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
2015-07-16Don't crash on makeCurrent failJohn Reck
Bug: 22444755 WindowManager may decide to yank the surface at any point, so attempt to kinda handle this Change-Id: Id2f665d2f0f93bccd4ec977fbf52dca4dc1ec891
2015-05-20Eliminate requireGlContextJohn Reck
Bug: 20297820 Change-Id: I37c63bab6f6c0d2337c8c6002046d2ef17e74097
2015-05-08Add eglSwapBuffersWithDamageKHR supportJohn Reck
BUG: 20761426 Disabled temporarily Change-Id: I0b6b6f0eebab886145e13fa35aefe76826965cf5
2015-01-30Add a WAIT_FOR_GPU_COMPLETION optionJohn Reck
Change-Id: I18d526120651676109200bfd5da87cafcd7e3d13
2014-10-31Layer changesJohn Reck
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
2014-10-23Add some free zoom to lockHardwareCanvasJohn Reck
Bug: 18099195 Don't use EGL_SWAP_BUFFER_PRESERVED on surfaces that will never benefit. Also clean up some confusing naming Change-Id: I674ca64e0464a3282cff79e5ecd350d08f47c014
2014-09-17Special case EGL_BAD_SURFACEJohn Reck
Bug: 17516789 Change-Id: I3dcb10360c2aef6326f7dbbff6815866d4c143b6
2014-06-23No-fail invokeFunctorJohn Reck
Bug: 15513308 Bug: 15449247 Change-Id: I13a29f9c8d4975cdda6dcb33b6332c2555ff0f7c