summaryrefslogtreecommitdiffstats
path: root/libs/hwui/ProgramCache.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Remove invalid premul step from HWUI's matrix color filter." into lmp-devDerek Sollenberger2014-09-041-2/+1
|\
| * Remove invalid premul step from HWUI's matrix color filter.Derek Sollenberger2014-08-181-2/+1
| | | | | | | | | | bug: 16186699 Change-Id: Ia0b828e76ce4831ee9e3b4f54c697e6017f1604d
* | Fix precision issues for roundrect clippingChris Craik2014-08-291-1/+1
|/ | | | | bug:16984008 Change-Id: I941232d569293717f6bcd249d9e01f72a7409d2e
* Switch to cos interpolation of shadow alphaChris Craik2014-08-121-25/+19
| | | | | | | | | | bug:16852257 Updates default shadow opacities to compensate. Also, update variable/constant naming related to vertex alpha. Change-Id: I9055b4ac3c9ac305ca9d515f21b52d6aa6dc9c5c
* Rework shadow interpolationChris Craik2014-08-121-2/+16
| | | | | | | | | | bug:16852257 Use pow(alpha, 1.5) to avoid harsh edges on shadow alpha ramps. Also adjusts shadow constants to compensate. Change-Id: I5869956d7d292db2a8e496bc320084b6d64c3fb7
* Fix large radius RR clipping issue on certain devicesChris Craik2014-08-051-2/+4
| | | | | | | | | | bug:16804363 Since dist can be in the 1000s of pixels, and length() may square it in its current precision, scale the value down significantly first, since final precision isn't very important. Change-Id: Id20f7a49d6171355c8e242442c2b5083f746dca3
* Round rect outline clippingChris Craik2014-05-151-4/+46
| | | | Change-Id: Iee9cf4f719f6f1917507b69189ad114fa365917b
* Removing SkiaColorFilter and inspecting the native object directly.Derek Sollenberger2014-02-071-9/+2
| | | | | bug: 10650594 Change-Id: I4fcf66d008765afa0e35d011f58bc792183cb74f
* Add tessellation path for pointsChris Craik2013-05-141-38/+4
| | | | | | | | | | | | | | | | | | bug:4351353 bug:8185479 Point tessellation is similar to line special case, except that we only tessellate one point (as a circle or rect) and duplicate it across other instances. Additionally: Fixes square caps for AA=false lines Cleanup in CanvasCompare, disabling interpolation on zoomed-in comparison view Change-Id: I0756fcc4b20f77878fed0d8057297c80e82ed9dc
* Add an on-screen overdraw counterRomain Guy2013-05-031-1/+14
| | | | | | | | | The counter can be enabled by setting the system property called debug.hwui.overdraw to the string "count". If the string is set to "show", overdraw will be highlighted on screen instead of printing out a simple counter. Change-Id: I9a9c970d54bffab43138bbb7682f6c04bc2c40bd
* Change the dither texture's swizzlingRomain Guy2013-04-091-1/+1
| | | | | | | | | | This is a more elegant way to sample from a float alpha texture. Instead of sampling from the red channel in the fragment shader we can set the alpha channel swizzle to redirect it to the red channel. This lets us sample from the alpha channel in the fragment shader and get the correct value. Change-Id: I95bbf7a82964e1bf42c0fee1b782b6bdbbcef618
* Use float textures to render gradients when possibleRomain Guy2013-04-051-48/+40
| | | | | | | | | | | Float textures offer better precision for dithering. In addition this change removes two uniforms from gradient shaders. These uniforms were used to dither gradients but their value is a build time constant. Instead we hardcode the value directly in the shader source at compile time. Change-Id: I05e9fd3eef93771843bbd91b453274452dfaefee
* Add shader program selection shortcutChris Craik2013-03-011-0/+6
| | | | | | | | | | | Add a key manipulation that makes black text/paths use the standard simple bitmap/patch shader, since they are the same. Previously we'd create a separate shader for each because the keys differed, even though the shaders were functionally equivalent. Also fixes some issues around setting DEBUG_PROGRAM Change-Id: I0c77c684d58da03501ee9ab8239c7d4a70fd6b5c
* Add new property to debug non-rectangular clip operationsRomain Guy2013-02-251-1/+7
| | | | | | | | | | | | | This change adds a new property called "debug.hwui.show_stencil_clip" that accepts the following values: - "highlight", colorizes in green any drawing command that's tested against a non-rectangular clip region - "region", shows the non-rectangular clip region in blue every time it is used - "hide", default value, nothing is shown Change-Id: I83c8602310edc4aaeb8b905371cdd185b17d32b5
* Implement support for drawBitmapMesh's colors arrayRomain Guy2013-02-131-1/+24
| | | | Change-Id: I3d901f6267c2918771ac30ff55c8d80c3ab5b725
* Add cap tessellation supportChris Craik2013-02-061-45/+6
| | | | | | | | | | | bug:7117155 bug:8114304 Currently used for lines (with and without AA) and arcs with useCenter=false Also removes 0.375, 0.375 offset for AA lines Change-Id: Ic8ace418739344db1e2814edf65253fe7448b0b0
* Make gradients beautiful againRomain Guy2012-09-261-7/+8
| | | | | | | | | | | | | | | | | | | Bug #7239634 This change passes two matrices to the vertex shader instead of one. We used to compute the final MVP matrix on the CPU to minimize the number of operations in the vertex shaders. Shader compilers are however smart enough to perform this optimization for us. Since we need the MV matrix to properly compute gradients dithering, this change splits the MVP matrix into two. This has the advantage of removing one matrix multiplication per drawing operation on the CPU. The SGX 540 shader compiler produces the same number of instructions in both cases. There is no penalty hit with having two matrices instead of one. We also send so few vertices per frame that it does not matter very much. Change-Id: I17d47ac4772615418e0e1885b97493d31435a936
* Fix alpha channel computation with ColorMatrixColorFilterRomain Guy2012-09-251-1/+0
| | | | | | | | | | | Bug #7222476 There were two issues: - Blending was ignored with color filters - The addition vector of a color filter was treated as integer values instead of float values Change-Id: Id94065704a30ee8aaaa5724a9f3a3cff7c50ced7
* Merge "Optimize shaders for dithered gradients" into jb-mr1-devChet Haase2012-09-211-19/+34
|\
| * Optimize shaders for dithered gradientsChet Haase2012-09-211-19/+34
| | | | | | | | | | | | | | | | | | | | | | It's faster to compute a dither calculation in the vertex shader and use a varying (letting the GPU interpolate the fragment values) than to perform that calculation in the fragment shader as part of a texture lookup. Issue #7207600 Prime mr1 shader performance issues Issue #7158326 Bad framerates on MR1 (Mako, Manta, Prime) Change-Id: I15789582a6e9e2d8b9dd22aa5b0f72f0ba1cce7f
* | Polygonal rendering of simple fill shapesChris Craik2012-09-201-32/+42
|/ | | | | | bug:4419017 Change-Id: If0428e1732139786cba15f54b285d880e4a56b89
* Fix GL shader bugsChet Haase2012-09-181-6/+6
| | | | | | | Fixing errors in emitted shader code that caused GL errors at runtime Change-Id: I267a84398a81329a6688b292505f8779bd750ad1
* Fix bad shader codeChet Haase2012-09-171-2/+2
| | | | | | Shader code missing "=" in a couple of cases. Change-Id: Iff8a99a0ccb2903c30e2bdb2f698ef9b2e03d5d1
* Fix modulation and gamma correction issuesRomain Guy2012-09-141-37/+50
| | | | | | | | | | | | | | | | | | | | | | | Modulation is normally enabled in a shader when drawing with an alpha mask (A8 texture.) Modulation is used to do one of two things: - Colorize the primitive (to draw text in red for instance) - Apply extra translucency (50% translucent circle filled with a bitmap) The current implementation has four issues: 1. Unnecessary work is performed by assigning the modulation color to vec4 fragColor early in the shader 2. The modulation color's alpha is applied twice when the primitive is drawn with an SkShader 3. The decision to modulate is wrong and triggers when any of the RGB channels is < 1.0. Only the alpha channel needs to be taken into account to make the decision 4. Gamma correction is not applied properly This change addresses all four issues above. Change-Id: I73fcc74efc4b094bf2d1b835f10ffaa2ea4b9eb9
* Multiply alpha for AA as late as possibleChris Craik2012-09-131-5/+7
| | | | | | Should be done after all color computation Change-Id: Iaadd565f7d2263f111f6841a00e7c341025833d3
* Varying-based AA rect drawingChris Craik2012-09-051-6/+25
| | | | | | | | | | | | Instead of calculating opacity from relative position in the shader, use a shader varying to do this computation for us. bug:5045101 Also adds a test to HwAccelerationTest to show incorrect antialiasing in scaled drawAARect / boundarySize calculation. Change-Id: Icdc41acb01dc10ce354834f8389a5aed2f439162
* Use smoothstep to eliminate branches in AA shaderChris Craik2012-08-291-13/+4
| | | | Change-Id: If4ecb1a9446f29b2f8444f5cee551f863c1993e8
* Reduce gradients textures size whenever possibleRomain Guy2012-08-081-9/+7
| | | | Change-Id: Ifd58625ee62edac3b5d20b77553cb98b6fa2b46e
* Add dithering to gradientsRomain Guy2012-08-011-19/+39
| | | | Change-Id: Ic1208855bde3a254eca2fd7cef43e0f1318ce419
* Improve gradientsRomain Guy2012-07-311-23/+49
| | | | | | Avoid using textures for common gradients (two stops from 0.0 to 1.0) Change-Id: Iff55d21b126c8cfc4cfb701669f2339c8f6b131a
* Remove vendor specific precision qualifierRomain Guy2012-07-181-27/+17
| | | | Change-Id: I0a56ca7a5a399ec94993d3cea0c4aff6c0f86e39
* Note to selfRomain Guy2012-07-181-0/+2
| | | | Change-Id: Ic5699bdbf880ad68748c827bb5b4976b12d4d413
* Add shader-based text gamma correctionRomain Guy2012-07-161-3/+31
| | | | | | | | To enable it, the system property ro.hwui.text_gamma_shader must be set to true. For testing, DEBUG_FONT_RENDERER_FORCE_SHADER_GAMMA can be set to 1 in libhwui/Debug.h. Change-Id: If345c6b71b67ecf1ef2e8847b71f30f3ef251a27
* Optimize state changesRomain Guy2011-12-121-1/+1
| | | | Change-Id: Iae59bc8dfd6427d0967472462cc1994987092827
* Use high precision iterators on specific GPUsRomain Guy2011-08-011-9/+19
| | | | | | Bug #5098359 Change-Id: I52ee8c7b4c9e8d4c7bedb684eaf7bef6c44c74b9
* Merge "Allows to render with an OpenGL context inside a TextureView."Romain Guy2011-05-021-7/+5
|\
| * Allows to render with an OpenGL context inside a TextureView.Romain Guy2011-05-021-7/+5
| | | | | | | | Change-Id: I59453f7fc3997f0502a1c5d325d37fed376fabc7
* | Line endcaps for AA lines are now antialiased.Chet Haase2011-05-021-27/+36
|/ | | | | | Also fixed other minor issues with AA and line rendering. Change-Id: Icd4638d27c70e2ee0f28b5d9a2b97d8b29e8ac4d
* New widget: TextureViewRomain Guy2011-04-281-7/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug #4343984 TextureView can be used to render media content (video, OpenGL, RenderScript) inside a View. The key difference with SurfaceView is that TextureView does not create a new Surface. This gives the ability to seamlessly transform, animate, fade, etc. a TextureView, which was hard if not impossible to do with a SurfaceView. A TextureView also interacts perfectly with ScrollView, ListView, etc. It allows application to embed media content in a much more flexible way than before. For instance, to render the camera preview at 50% opacity, all you need to do is the following: mTextureView.setAlpha(0.5f); Camera c = Camera.open(); c.setPreviewTexture(mTextureView.getSurfaceTexture()); c.startPreview(); TextureView uses a SurfaceTexture to get the job done. More APIs are required to make it easy to create OpenGL contexts for a TextureView. It can currently be done with a bit of JNI code. Change-Id: Iaa7953097ab5beb8437bcbbfa03b2df5b7f80cd7
* Apply shaders/filters to text drop shadows.Romain Guy2011-04-261-0/+9
| | | | | | | | | Bug #4318323 This change also fixes the fact that shaders were not modulated by the paint's color when drawing paths. Change-Id: Id88804143aea06c895d4cbcdbe106d660230aa5a
* Enable anti-aliasing for hw-accelerated linesChet Haase2011-04-211-2/+36
| | | | | | | Draw anti-aliased lines with OpenGL by constructing a quad with a border that fades out (to mimic fragment coverage). Change-Id: Ib81a3e62d663acdf1b46b401ac4aa7ee9855cc7e
* Fix shaders generation on IMG GPUs.Romain Guy2011-03-231-2/+2
| | | | Change-Id: Id15df2663e41e31f04c8d86b958312341da8101d
* Add support for drawPoint() and drawPoints().Romain Guy2011-03-211-4/+38
| | | | Change-Id: I01bef50c08ec3160f8d40dc060b2cf6c2e4d7639
* Correctly release the OpenGL Canvas on EGL error.Romain Guy2010-12-071-0/+2
| | | | Change-Id: Ib31fd8445f7ce5f7aa7e0205de0e7db80d024fc2
* Move all debug flags in a single place.Romain Guy2010-11-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | This change also adds a new memory usage flag. When turned on, the following is printed after every frame: D/OpenGLRenderer( 3723): Current memory usage / total memory usage (bytes): D/OpenGLRenderer( 3723): TextureCache 3766680 / 20971520 D/OpenGLRenderer( 3723): LayerCache 3538944 / 8388608 D/OpenGLRenderer( 3723): GradientCache 135168 / 524288 D/OpenGLRenderer( 3723): PathCache 41180 / 4194304 D/OpenGLRenderer( 3723): TextDropShadowCache 0 / 2097152 D/OpenGLRenderer( 3723): FontRenderer 0 262144 / 262144 D/OpenGLRenderer( 3723): FontRenderer 1 262144 / 262144 D/OpenGLRenderer( 3723): FontRenderer 2 262144 / 262144 D/OpenGLRenderer( 3723): Other: D/OpenGLRenderer( 3723): FboCache 2 / 12 D/OpenGLRenderer( 3723): PatchCache 31 / 512 D/OpenGLRenderer( 3723): Total memory usage: D/OpenGLRenderer( 3723): 8268404 bytes, 7.89 MB This should help tracking possibe memory issues. Change-Id: I83f483ca1d2dbef904829bce368e33fe5503e8d6
* Color filters were ignored by the program cache fast path.Romain Guy2010-10-131-1/+1
| | | | Change-Id: I08f2f02d356234a674be778d088e0558fd49c849
* Simplify black texture fragment shader.Romain Guy2010-10-121-2/+2
| | | | Change-Id: If2d43f92f4c98ec128692761a670b0f31207a3c0
* Optimize GLSL shaders.Romain Guy2010-10-111-21/+150
| | | | Change-Id: I9a5e01bced63d8da0c61330a543a2b805388a59d
* Improve performance of linear gradients.Romain Guy2010-10-111-3/+3
| | | | Change-Id: If1caee31fc045dea13a4c5c10f25f2ffd325c4f8
* Add 3D transforms support to all gradients.Romain Guy2010-10-071-10/+3
| | | | Change-Id: I61409edd00dab3a11684a3f5e4f7df0afc734758