summaryrefslogtreecommitdiffstats
path: root/libs/hwui/FontRenderer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use const where possible for drawing parametersChris Craik2014-01-031-6/+7
| | | | | | They should never be modified by a Renderer, only read and copied. Change-Id: I9d8d55dca19115ee9dfeb2bb3f092ba2fb327cd4
* Handle user-defined cache path for RS.Tim Murray2013-12-131-1/+3
| | | | Change-Id: I92e3346dca331ae6a9dfbe4f95292bc604dfd196
* Clean up modelView matrix logicChris Craik2013-11-181-1/+2
| | | | | | | | | bug:11359533 Also changes shader matrix to correctly account for modelView and currentTransform() Change-Id: I6ce18857dc6d08ea08ca7535385c2ad351ec3caa
* am ab99b39d: am ddc0a63d: Merge "fix emoji clipping in hw draw path" into ↵Victoria Lease2013-09-201-1/+1
|\ | | | | | | | | | | | | klp-dev * commit 'ab99b39d7d152de35ea02a364190ff325da4015b': fix emoji clipping in hw draw path
| * fix emoji clipping in hw draw pathVictoria Lease2013-09-191-1/+1
| | | | | | | | | | | | | | | | I guess we don't want to overwrite the last line in every RGBA glyph with our one-line texture atlas spacer? Bug: 10841207 Change-Id: Ief85ca58650c731e9d21dbf90942b7b44670abcc
* | am 19c727bb: am 895a4375: Merge "Fix FontRenderer bug." into klp-devTim Murray2013-09-101-1/+1
|\ \ | |/ | | | | | | * commit '19c727bbc6371924bfd2f85e804b5b6b093a8413': Fix FontRenderer bug.
| * Fix FontRenderer bug.Tim Murray2013-09-101-1/+1
| | | | | | | | | | | | bug 10691313 Change-Id: Icd5341a3c2066e337911f040ddc935c48c8d7cd1
* | am 9163b1d9: am 23ae1461: Merge "Add flags word to initialization." into klp-devTim Murray2013-09-091-1/+1
|\ \ | |/ | | | | | | * commit '9163b1d9ceeca3e956218dda1ca19a748dc48d8d': Add flags word to initialization.
| * Add flags word to initialization.Tim Murray2013-09-091-1/+1
| | | | | | | | | | | | bug 10427951 Change-Id: I1356b9b96315ead44aa3898de5604d75f9bb8be5
* | am 816f3058: am cf8e6778: Merge "Handle updates to C++ API." into klp-devTim Murray2013-08-201-2/+3
|\ \ | |/ | | | | | | * commit '816f3058bdd7b888965022888e4a789ea967f444': Handle updates to C++ API.
| * Handle updates to C++ API.Tim Murray2013-08-191-2/+3
| | | | | | | | Change-Id: I8ab17cbae3a9a4cc3c3202b8277d49f27bdf1fec
* | Replace float arrays with readable namesRomain Guy2013-08-151-2/+2
|/ | | | Change-Id: I32a8be560b60a4ac5cbee2fec4574b2c5df9f825
* fix kBW_Format glyphsVictoria Lease2013-08-121-0/+1
| | | | | | | | Oops! kBW_Format was omitted from a couple of switch statements, resulting in glyphs in that format being invisible. Bug: 10206452 Change-Id: Ib2aa52250aeeecc0de1b1b78e3d0f568f368c73e
* Handle updates to RS C++ API.Tim Murray2013-08-021-6/+8
| | | | Change-Id: I73127fc7369643b94d4a49f31a516b50c74b54ac
* Support RGBA fonts and bitmap fonts (and RGBA bitmap fonts)Victoria Lease2013-07-311-81/+216
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Share Caches' index buffer with FontRendererRomain Guy2013-06-181-37/+1
| | | | | | | | | 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
* Introduce Caches::bindTexture() to reduce glBindTexture callsRomain Guy2013-06-041-2/+2
| | | | Change-Id: Ic345422567c020c0a9035ff51dcf2ae2a1fc59f4
* am 55b883b0: am 30c990c3: Merge "Draw Operation merging" into jb-mr2-devChris Craik2013-04-151-6/+8
|\ | | | | | | | | * commit '55b883b0a960b37aa453253f3ccb614dd95c221c': Draw Operation merging
| * Draw Operation mergingChris Craik2013-04-151-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge simple bitmap draw operations and text operations to avoid issuing individual gl draws for each operation. Merging other ops to be done eventually. The methods are different - the bitmap merging generates a single mesh for reused, unclipped images (esp. repeated images in a listview) The text approach queries just defers the normal font rendering until the last drawText in the sequence that can share the same shader. Patches are sorted and merged, but don't yet have a multiDraw implementation. For now, the pretending-to-merge gives better sorting behavior by keeping similar patches together. Change-Id: Ic300cdab0a53814cf7b09c58bf54b1bf0f58ccd6
* | resolved conflicts for merge of 886e1204 to masterRomain Guy2013-04-121-51/+42
|\ \ | |/ | | | | Change-Id: Id002d2ae799c6946672335f122ecbfa07d9c0bc1
| * Introduce PixelBuffer API to enable PBOsRomain Guy2013-04-111-51/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | am 21af446c: am a151ef8c: Merge "First OpenGL ES 3.0 based optimization" ↵Romain Guy2013-04-041-4/+31
|\ \ | |/ | | | | | | | | | | into jb-mr2-dev * commit '21af446ce9704bdc465bf15755148c5de50ea019': First OpenGL ES 3.0 based optimization
| * First OpenGL ES 3.0 based optimizationRomain Guy2013-04-041-4/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Phase 1 of refactoring SystemServer.Dan Morrill2013-04-041-29/+39
|/ | | | | | | | | | SystemServer is currently a monolithic class that brings up key system services. This change is the first phase of refactoring it to be more configurable. Specifically, it adds a set of on/off switches used to control startup of individual services. Future plans include finer grained controls and a more explicit and consistent startup sequence for these services. Change-Id: I7299f5ce7d7b74a34eb56dffb788366fbc058532
* Optimize text GL setupRomain Guy2013-03-201-4/+8
| | | | | | | | Only performs the GL setup steps when at least one glyph is drawn. This change also skips various draw operations when the specified paint draws with alpha = 0. Change-Id: I9eda148b0503acffc552ee19196f5d52e958a1a2
* Reduce number of glDraw calls when drawing textRomain Guy2013-03-191-80/+41
| | | | | | | | 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
* Minimize texture binds when drawing textRomain Guy2013-03-191-14/+15
| | | | | | | | | | | When several CacheTextures are used to draw text, sort the draw batches by texture ID to minimize state changes in the driver. This change also tweaks the font cache size and renames a property that was too long to be set using setprop. Change-Id: I0a36dfffe58c9e75dd7384592d3343c192d042b1
* Move blur code from FontRenderer to utils/Blur.cppRomain Guy2013-03-081-132/+8
| | | | Change-Id: I2cebbfbcb722ed4b37e54ffbf8b53bb92ad0c964
* Make glyph copies a little more cache friendlyRomain Guy2013-03-051-15/+17
| | | | Change-Id: Ie21b7079cc5d3ea67a03597c57842636e4afe143
* Support 3D rotations when drawing textRomain Guy2013-02-281-0/+10
| | | | | | | | | | | | | If a perspective transform is set on the Canvas, drawText() should not attempt to rasterize glyphs in screen space. This change uses the old behavior instead (i.e. rasterize the glyphs at the native font size and apply the transform on the resulting mesh.) This change also adds an optimization: empty glyphs (spaces) do not generate vertices anymore. This saves a lot of vertices in text heavy applications such as Gmail. Change-Id: Ib531384163f5165b5785501612a7b1474f3ff599
* Avoid double blurChris Craik2013-02-221-3/+10
| | | | | | | | | | bug:8204062 Avoids incorrectly blurring with RenderScript after a C++ blur Additionally, avoids draw/blurring if the input text has empty bounds Change-Id: Ibbaf74800fff7a6e4cda3aa24286b90e7aef589d
* am 7a60c43d: Merge "Use free for memory chunks allocated through memalign."Ben Cheng2013-02-201-1/+1
|\ | | | | | | | | * commit '7a60c43d874bd047ea4b93b94c9b8771ea5739cc': Use free for memory chunks allocated through memalign.
| * Use free for memory chunks allocated through memalign.Ben Cheng2013-02-201-1/+1
| | | | | | | | | | BUG: 8234423 Change-Id: Ic4100a780908c94540722cc4af5f73f4940431b4
* | am 805a6fe7: Merge "Revert "Revert "Use RenderScript for large text blurs"""Chris Craik2013-02-131-12/+48
|\ \ | |/ | | | | | | | | # Via Android (Google) Code Review (1) and Chris Craik (1) * commit '805a6fe7b1417640ccaf7914171cb65515b6ab39': Revert "Revert "Use RenderScript for large text blurs""
| * Revert "Revert "Use RenderScript for large text blurs""Chris Craik2013-02-131-12/+48
| | | | | | | | | | | | This reverts commit bf5703e52e3304246cbf0e73f6976f7d7312d238. Change-Id: Ic6f991277dec9e80a6fed93db91499726b30ab2a
| * Revert "Merge remote-tracking branch 'goog/master-chromium' into ↵Chris Craik2013-02-131-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | 'goog/master'" DO NOT MERGE This reverts commit 6c0307dd0aefe9a08794b155fc03ee60ebd14f25, reversing changes made to a2cd828b749c444d55c2c41c7dbb85088ff94b9f. Conflicts: packages/SystemUI/res/values-sv/strings.xml Change-Id: Ia178efe8b14751583d47b2826bfe3d3d5463dd2e
* | Revert "Use RenderScript for large text blurs"Chris Craik2013-02-131-48/+12
| | | | | | | | | | | | This reverts commit 3f76e65d251ead65fe8ff98e3bd4c7623fbaac07 Change-Id: Ia81cd485e5ca696bb284c419dc8a1d2f3247100e
* | Use RenderScript for large text blursChris Craik2013-02-121-12/+48
|/ | | | | | Still fall back to simple path for small tasks Change-Id: I492f1b3f7d6fec1738f3e45cbfb15864bd23a392
* Merge "Merge remote-tracking branch 'goog/master-chromium' into 'goog/master'"Derek Sollenberger2013-02-061-0/+1
|\
| * resolved conflicts for merge of c88c60be to master-chromiumRomain Guy2013-01-081-60/+18
| |\ | | | | | | | | | Change-Id: I3b4b42443312068e942aa779dfdc928afa7569fd
| * | Update framework to support r5967 of Skia.Derek Sollenberger2012-12-121-0/+1
| | | | | | | | | | | | | | | bug: 6906025 Change-Id: Iefdb830ec3aa2ab3472c1c142484a7aa21788a15
* | | Add support for non-antialiased textRomain Guy2013-02-051-13/+44
| |/ |/| | | | | Change-Id: I17c073955ab94abc9b409e5fcfbc675faa07c5ba
* | Add plumbing for better text scalingRomain Guy2013-01-081-60/+18
|/ | | | | | | | Fonts are now described by a transform matrix. This lead to switching from a vector to a hashmap. This change therefore adds new comparators and hash computations to Font. Change-Id: I2daffa7d6287c18554c606b8bfa06640d28b4530
* Another optimization of glyph cache uploadsSangkyu Lee2012-11-281-18/+31
| | | | | | | | | | | | Previously, cache textures were updated whenever mCurrentCacheTexuture was changed. Since updating cache textures needs glTexSubImage2D call, frequent changing of mCurrentCacheTexture (which can easily happen when an app uses lots of unique glyphs even with precaching) caused many glTexSubImage2D calls and bad framerates. This patch optimized isssueDrawCommand function. Consequently, changing mCurrentCacheTexture doesn't cause glTexSubImage2D call any more and it will improve font rendering performance. Change-Id: Id19d959fa0e69eeb2a39f83a57e311d7394586b2 Signed-off-by: Sangkyu Lee <geteuid@gmail.com>
* Add stroke support to polygonal shape renderingChris Craik2012-09-261-3/+2
| | | | | | | | | | | | bug:4419017 bug:7230005 - Adds support for stroke/strokeAndFill for shapes without joins - Fixes path-polygonization threshold calculation - Fixes rendering offset (now only used for points) - Several formatting fixes Change-Id: If72473dc881e45752e2ec212d0dcd1e3f97979ea
* Optimize glyph cache texture uploadsChet Haase2012-09-231-7/+10
| | | | | | | | | | | | 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
* Code cleanup in FontRendererRomain Guy2012-09-041-62/+26
| | | | Change-Id: Ic788721c224a77f0a76f4cd6d9817b62e390a5a7
* Small code cleanup in FontRendererRomain Guy2012-09-041-7/+19
| | | | Change-Id: I09c00debe9b0b4f45b232cae402ed19bdaeabfe4
* Refactor FontRenderer.cppRomain Guy2012-09-041-579/+11
| | | | | | | | 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
* Paramaterize and adjust the glyph cache sizesChet Haase2012-08-311-35/+31
| | | | | | | | | Add new parameters for the texture size used for the larger, fallback caches. Bump up the defaults in some situations. Issue #7045164 Adjust cache sizes for manta Change-Id: I562118ce785d7f8b6e445178878672e9709d25f2