summaryrefslogtreecommitdiffstats
path: root/libs/hwui/font/CacheTexture.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Assume a texture is unbound after deleting itRomain Guy2013-06-061-1/+1
| | | | | | | | | | | Bug #9316260 The GL specification indicates that deleting a bound texture has the side effect of binding the default texture (name=0). This change replaces all calls to glDeleteTextures() by Caches::deleteTexture() to properly keep track of texture bindings. Change-Id: Ifbc60ef433e0f9776a668dd5bd5f0adbc65a77a0
* Introduce Caches::bindTexture() to reduce glBindTexture callsRomain Guy2013-06-041-3/+5
| | | | Change-Id: Ic345422567c020c0a9035ff51dcf2ae2a1fc59f4
* Introduce PixelBuffer API to enable PBOsRomain Guy2013-04-111-2/+48
| | | | | | | | | | | | | | | | | | | | | | | PBOs (Pixel Buffer Objects) can be used on OpenGL ES 3.0 to perform asynchronous texture uploads to free up the CPU. This change does not enable the use of PBOs unless a specific property is set (Adreno drivers have issues with PBOs at the moment, Mali drivers work just fine.) This change also cleans up Font/FontRenderer a little bit and improves performance of drop shadows generations by using memcpy() instead of a manual byte-by-byte copy. On GL ES 2.0 devices, or when PBOs are disabled, a PixelBuffer instance behaves like a simple byte array. The extra APIs introduced for PBOs (map/unmap and bind/unbind) are pretty much no-ops for CPU pixel buffers and won't introduce any significant overhead. This change also fixes a bug with text drop shadows: if the drop shadow is larger than the max texture size, the renderer would leave the GL context in a bad state and generate 0x501 errors. This change simply skips drop shadows if they are too large. Change-Id: I2700aadb0c6093431dc5dee3d587d689190c4e23
* First OpenGL ES 3.0 based optimizationRomain Guy2013-04-041-2/+1
| | | | | | | | | | | | | | | This change uses a new OpenGL ES 3.0 feature to upload less data when the font cache needs to be update. This can result in significant performance improvements on device with large textures or with locales that use a lot of glyphs (CJK for instance.) This change also fixes various unpack alignment issues. The unpack alignment, as well as the unpack row length, is not texture specific but a global state that affect all glTex/SubImage2D calls. Some of them were missing the appropriate glPixelStorei() call. This could result in corrupted textures. Change-Id: Iefb429d4d0d0b4e0faeadf27daafee6d30a21d85
* Reduce number of glDraw calls when drawing textRomain Guy2013-03-191-0/+78
| | | | | | | | This change moves the mesh buffer from FontRenderer to CacheTexture to help reduce the number of texture binds and glDraw calls when drawing text that spans across multiple textures. Change-Id: I7de574d88313ca3672879ca878c253ff5f131fc1
* Update framework to support r5967 of Skia.Derek Sollenberger2012-12-121-0/+1
| | | | | bug: 6906025 Change-Id: Iefdb830ec3aa2ab3472c1c142484a7aa21788a15
* Optimize glyph cache texture uploadsChet Haase2012-09-231-0/+3
| | | | | | | | | | | | Only upload the changed area of the glyph cache, not the entire bitmap. Note that we can't do the full-on optimization here of copying a sub-rect of the bitmap because of GL ES 2 limitations, but we can at least copy the horizontal stripe containing the dirty rect, which can still be a big savings over uploading the entire bitmap. Issue #7158326 Bad framerates on MR1 (Mako, Manta, Prime) Change-Id: Iab38d53202650f757ead4658cf4287bdad2b3cb9
* Correctly check the height of a glyph prior to caching itRomain Guy2012-09-041-10/+9
| | | | Change-Id: Iaf3977afc20fcde65bfda7b9e092b3e723241684
* Small code cleanup in FontRendererRomain Guy2012-09-041-1/+22
| | | | Change-Id: I09c00debe9b0b4f45b232cae402ed19bdaeabfe4
* Refactor FontRenderer.cppRomain Guy2012-09-041-0/+172
FontRenderer.h defined several classes and structures that now live in the font/ folder. This will make the code easier to read and maintain. Change-Id: I3dc044e9bde1d6515f8704f5c72462877d279fe2