diff options
author | 2016-02-22 11:25:32 -0800 | |
---|---|---|
committer | 2016-02-22 11:25:32 -0800 | |
commit | 7023a00c35d904e4ccff09c377e9ba26abba6181 (patch) | |
tree | 33a9241b646576bd5c66b88623c1db8d925d1274 /src/gpu/text/GrBatchFontCache.cpp | |
parent | 01e583807618038a578a3b07cfad3101d24115c7 (diff) |
Use unorm shorts for texture coordinates when rendering text.
There are a couple of reasons for this:
- Vulkan does not guarantee conversions from integral vertex attributes
to floating point shader variables
- This may be faster and more precise on some platforms, as it avoids
the aforementioned conversion and changes a multiply by a very small
value to a multiply by a medium-sized value.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1713693002
TBR=bsalomon@google.com
Committed: https://skia.googlesource.com/skia/+/e507ff0460f4f878214b9454fb5b9ab8d64d8063
Review URL: https://codereview.chromium.org/1713693002
Diffstat (limited to 'src/gpu/text/GrBatchFontCache.cpp')
-rw-r--r-- | src/gpu/text/GrBatchFontCache.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gpu/text/GrBatchFontCache.cpp b/src/gpu/text/GrBatchFontCache.cpp index ad76e4d71f..d99df1da03 100644 --- a/src/gpu/text/GrBatchFontCache.cpp +++ b/src/gpu/text/GrBatchFontCache.cpp @@ -48,16 +48,22 @@ GrBatchFontCache::GrBatchFontCache(GrContext* context) // setup default atlas configs fAtlasConfigs[kA8_GrMaskFormat].fWidth = 2048; fAtlasConfigs[kA8_GrMaskFormat].fHeight = 2048; + fAtlasConfigs[kA8_GrMaskFormat].fLog2Width = 11; + fAtlasConfigs[kA8_GrMaskFormat].fLog2Height = 11; fAtlasConfigs[kA8_GrMaskFormat].fPlotWidth = 512; fAtlasConfigs[kA8_GrMaskFormat].fPlotHeight = 256; fAtlasConfigs[kA565_GrMaskFormat].fWidth = 1024; fAtlasConfigs[kA565_GrMaskFormat].fHeight = 2048; + fAtlasConfigs[kA565_GrMaskFormat].fLog2Width = 10; + fAtlasConfigs[kA565_GrMaskFormat].fLog2Height = 11; fAtlasConfigs[kA565_GrMaskFormat].fPlotWidth = 256; fAtlasConfigs[kA565_GrMaskFormat].fPlotHeight = 256; fAtlasConfigs[kARGB_GrMaskFormat].fWidth = 1024; fAtlasConfigs[kARGB_GrMaskFormat].fHeight = 2048; + fAtlasConfigs[kARGB_GrMaskFormat].fLog2Width = 10; + fAtlasConfigs[kARGB_GrMaskFormat].fLog2Height = 11; fAtlasConfigs[kARGB_GrMaskFormat].fPlotWidth = 256; fAtlasConfigs[kARGB_GrMaskFormat].fPlotHeight = 256; } |