summaryrefslogtreecommitdiff
path: root/libs/hwui/Extensions.cpp
AgeCommit message (Collapse)Author
2018-04-12Remove Properties::isSkiaPipeline (3/!?) John Reck
Test: hwuiunit & CtsUiRenderingTestCases pass Change-Id: Ie7b336eacdd1b8660e09653c64eb6ea0a7b4a258
2017-11-09Use Skia API to detect if FP16 render buffer is supported Stan Iliev
Use Skia GrCaps to detect if we can render into a FP16 buffer. Exclude Extension class initialization from SkiaGL pipeline. Bug: 68383159 Test: Passed testWindowProducerCopyToRGBA16F on gce_x86_phone emu Change-Id: I3355bad891ed5403fbd94d18bb8ba110a3b77325
2017-11-03Format the world (or just HWUI) John Reck
Test: No code changes, just ran through clang-format Change-Id: Id23aa4ec7eebc0446fe3a30260f33e7fd455bb8c
2017-11-01Fix PixelCopyTest failure in CTS Romain Guy
This feature needs support for renderable float textures, but the checks were only guaranteeing support for float texture reads. Bug: 68754504 Test: CtsViewTestCases Change-Id: I0ce4a81cb8e09c10a5f1e65234685767a24ef8c4
2017-10-31Fix testWindowProducerCopyToRGBA16F test on x86 emulator Stan Iliev
Fix readback to return correct error code on X86 emulator, when half float pixel format is not supported. Test: Ran and passed all CtsViewTestCases tests on x86 emulator Bug: 68383159 Change-Id: Id66484b73488e2c8d29fbecbd45a97af285a0710
2017-10-18Fix crash in Vulkan pipeline at boot time Stan Iliev
Fix a crash caused by calling OpenGL APIs with Vulkan pipeline (likely a regression from ag/2706458). Test: Ran CtsViewTestCases tests with SkiaGL pipeline. Change-Id: Ibabeb4229ef88de57c99f2961a10a68ca71b25ab
2017-03-06Add ColorSpace information on Bitmap Romain Guy
This is the first step toward interpreting color spaces at render time. Bug: 32984164 Test: BitmapColorSpaceTest in CtsGraphicsTestCases Change-Id: I0164a18f1ed74a745874fe5229168042afe27a04
2016-12-01Query GL version before using it Romain Guy
Bug: 32984164 Test: manual testing of linear blending Change-Id: Ie20bdc34d1b98e93eae22b15f3e2a7994d3b4ff7
2016-10-12Various fixes for linear blending and gradients Romain Guy
With linear blending turned off some textures were still created as sRGB textures instead of linear textures. Multi-stop gradients were not behaving properly on devices with no support for float textures. Gradients are now always interpolated in linear space even if linear blending is off. New functions to always force sRGB->linear->sRGB conversions. Test: Manual testing Bug: 29940137 Change-Id: Ie2f84ee2a65fd85570e88af813e841e0e625df6c
2016-10-11Linear blending, step 1 Romain 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
2015-11-16Extensions must load in ctor John Reck
Because Caches is terrible Change-Id: I91e2442d97664759ee2c7602eb7172f009b20d53
2015-11-05add DeviceInfo John Reck
This reverts commit 096895550b9d5430d7a001d491566decf4f9791b. Change-Id: Ib2ed1e96d8f7f88302f5e27fe735687194553104
2015-11-05Revert "add DeviceInfo" John Reck
This reverts commit b2442896e3a226c7ebe9d47fa80b257e98a6a34d. Change-Id: I50f6555451f71067505245333c8e558b5e3b2b3b
2015-11-04add DeviceInfo John Reck
Change-Id: I4c122278a7e88b6f47c4dd3c5fc553df7d3c900d
2015-11-03Remove almost-all android::Singleton users John Reck
Bug: 25426213 Change-Id: I88e6206e8915cce95c3a8a8a82a4bb8fbf668141
2015-09-21Unify extensions parsing behavior Chris Craik
Removes remnants of EGL extension support, and persistence of GL extension list. Change-Id: I35aec12d900bdb33549ea47654bb8146f350ef48
2015-08-12Support new EGL extensions John Reck
Bug: 21753739 Includes a revert of 13d1b4ab10fbee5e81a2ba1ac59cfae1e51d3ef0 as that only supported EGL_EXT_buffer_age Change-Id: Ia86a47d19e3355c067934d7764c330b640c6958d
2015-08-04am b47ea9b2: am 2fa3eec0: am 93c14069: Merge "hwui: add extension to support ↵ John Reck
unpack operations in OpenGL ES 2.0" * commit 'b47ea9b2ed24f8eb6fc8b338555ff0d8825d8565': hwui: add extension to support unpack operations in OpenGL ES 2.0
2015-08-04am 2fa3eec0: am 93c14069: Merge "hwui: add extension to support unpack ↵ John Reck
operations in OpenGL ES 2.0" * commit '2fa3eec0e1807f6a45b71a41624698e8cc949026': hwui: add extension to support unpack operations in OpenGL ES 2.0
2015-08-04hwui: add extension to support unpack operations in OpenGL ES 2.0 xiaozhengdong
OpenGL ES 3.0+ lets us specify the row length for unpack operations such as glTexSubImage2D(). This allows us to upload a sub-rectangle of a texture. Also, the GL_EXT_unpack_subimage extension can also support this feature in OpenGL ES 2.0 Change-Id: Id43c2c55c5eaefbace67087c955f0b4324fb2c35 Signed-off-by: xiaozhengdong <xiaozhengdong@xiaomi.com>
2015-07-14Clean up unncessary defines Chris Craik
LOG_TAG and TRACE_TAG are already defined in the makefile Change-Id: I9e53e3dacbe018441edd74cb7c8c90846defee74
2015-02-25Add null egl/gles stub support John Reck
Change-Id: I41372585202f69ef31a4ef95efc75fb7a1ff7289
2015-02-06Glop ColorFilter & VertexBuffer support, initial enable Chris Craik
Enables Glop rendering for supported Rects and VertexBuffers Also removes unused Query object Change-Id: Ibe227bc362685a153159f75077664f0947764e06
2015-01-05Add overrides and switch to nullptr keyword for all files Chris Craik
Adds remaining missing overrides and nullptr usages, missed due to an extreme failure in tool usage. Change-Id: I56abd72975a3999ad13330003c348db40f59aebf
2013-07-24Fix 9patches' limitation of 32 empty quads Romain Guy
The 9patch format allows to define more empty quads than this, remove the use of a single int to index empty quads and replace it with a lookup in the 9patch resource data structure. Change-Id: I148ee5d9e0c96822b534a344e15c9d88078db7c2
2013-06-18Share Caches' index buffer with FontRenderer Romain Guy
This reduces state changes when we draw 9patches and text together, which happens *a lot*. Also disable the NV profiling extension by default since it doesn't play nice with display lists deferrals. To enable it set debug.hwui.nv_profiling to true. Change-Id: I518b44b7d294e5def10c78911ceb9f01ae401609
2013-05-23Add PerfHUD ES profiling capabilities Romain Guy
The eglGetSystemTimeNV extension can be used to enable profiling in PerfHUD ES. When the delta of two calls to eglGetSystemTimeNV equals 0, we now cancels display lists updates. This allows the tool to redraw the same frame several times in a row to run its analysis. For better results profiling should only be attempted after setting viewroot.profile_rendering to true using adb shell setprop. Change-Id: I02e3c237418004cff8d6cb0b9a37126efae44c90
2013-04-04Add internal API to query GL version number Romain Guy
Change-Id: Idc02efc237b8e97445a9bab05c291bf193c7f279
2013-02-07Add a RenderBuffer object to store stencil buffers. Romain Guy
Bug #7146141 This change is needed to add a render buffer cache to avoid creating and destroying stencil buffers on every frame. This change also allows the renderer to use a 1 bit or 4 bit stencil buffer whenever possible. Finally this change fixes a bug introduced by a previous CL which causes the stencil buffer to not be updated in certain conditions. The fix relies on a new optional parameter in drawColorRects() that can be used to avoid performing a quickReject on rectangles generated by the clip region. Change-Id: I2f55a8e807009887b276a83cde9f53fd5c01199f