summaryrefslogtreecommitdiffstats
path: root/libs/hwui/font/CacheTexture.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Performance Optimization: Align texture dirty rectywen2016-02-241-4/+10
| | | | | | | Align x offset and width to 32, y offset and height to 4. It improves the font texture upload performance. Change-Id: I967eeed90658f2ce1eb08cb2740d5dc34c72f40b
* Remove all usage of fmin and fmaxChris Craik2015-07-071-1/+1
| | | | | | | | bug:22208220 Removes needless call, and upconversion to doubles in multiple places. Change-Id: I1b949fa5f206446ac34de800154c0147d6bd8034
* Use glops for text renderingChris Craik2015-03-181-37/+34
| | | | Change-Id: I5e155c8baf3149f0ff231ec3c89dbff6bb8eae92
* Glop ColorFilter & VertexBuffer support, initial enableChris Craik2015-02-061-1/+1
| | | | | | | Enables Glop rendering for supported Rects and VertexBuffers Also removes unused Query object Change-Id: Ibe227bc362685a153159f75077664f0947764e06
* Refactor blending and texture gl stateChris Craik2015-01-301-3/+3
| | | | Change-Id: Ia6b3c8b2afd3dfcee7f3ce401d846b789612054a
* Add overrides and switch to nullptr keyword for all filesChris Craik2015-01-051-6/+6
| | | | | | | Adds remaining missing overrides and nullptr usages, missed due to an extreme failure in tool usage. Change-Id: I56abd72975a3999ad13330003c348db40f59aebf
* Clean up physical couplingTom Hudson2014-10-151-0/+1
| | | | | | | | 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
* Clean unused parameters, disable warningsChris Craik2013-10-171-2/+2
| | | | Change-Id: Iddb872f53075dd022eeef45265594d1c6a9e2bc0
* Take SkBitmap's stride into account when uploading texturesRomain Guy2013-09-251-5/+5
| | | | | Bug #10151807 Change-Id: I7ba4804fa3619088fea70eb55f10519fff0bf5f0
* fix kBW_Format glyphsVictoria Lease2013-08-121-2/+4
| | | | | | | | Oops! kBW_Format was omitted from a couple of switch statements, resulting in glyphs in that format being invisible. Bug: 10206452 Change-Id: Ib2aa52250aeeecc0de1b1b78e3d0f568f368c73e
* Support RGBA fonts and bitmap fonts (and RGBA bitmap fonts)Victoria Lease2013-07-311-7/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | Quite a few things going on in this commit: - Enable bitmap strikes by default in Paint objects. The SkPaint parameter that enables bitmap strikes was not previously included in DEFAULT_PAINT_FLAGS. This effectively disabled bitmap fonts. Oops! It's for the best, though, as additional work was needed in Skia to make bitmap fonts work anyway. - Complain if TEXTURE_BORDER_SIZE is not 1. Our glyph cache code does not currently handle any value other than 1 here, including zero. I've added a little C preprocessor check to prevent future engineers (including especially future-me) from thinking that they can change this value without updating the related code. - Add GL_RGBA support to hwui's FontRenderer and friends This also happened to involve some refactoring for convenience and cleanliness. Bug: 9577689 Change-Id: I0abd1e5a0d6623106247fb6421787e2c2f2ea19c
* 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