diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-26 18:03:05 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-26 18:03:05 +0000 |
commit | 8fe2ee1cf380ee8972c846f74fabd81b34665053 (patch) | |
tree | 4a3cc589c70bda08cb973e8dbd6d5b22c16c753e /src/gpu/gl | |
parent | 3fcab54c7f8d3936f6c854b2c4e19cfffafa1066 (diff) |
Distance field fixes for Android
- Expand glyph size by 2 on each side to compensate for bilerp lookup
- Correct for Adreno tendency to drop entire tile if any pixel has divide-by-0
- Fix blurriness on Adreno by using uv coords to compute gradient instead
of st coords
- Add faster version for uniform scale
BUG=skia:2173
R=bsalomon@google.com
Author: jvanverth@google.com
Review URL: https://codereview.chromium.org/205343008
git-svn-id: http://skia.googlecode.com/svn/trunk@13955 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/GrGLCaps.cpp | 6 | ||||
-rw-r--r-- | src/gpu/gl/GrGLCaps.h | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index a60230a2fe..47f3f0f0c8 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -47,6 +47,7 @@ void GrGLCaps::reset() { fFixedFunctionSupport = false; fDiscardFBSupport = false; fFullClearIsFree = false; + fDropsTileOnZeroDivide = false; } GrGLCaps::GrGLCaps(const GrGLCaps& caps) : GrDrawTargetCaps() { @@ -84,6 +85,7 @@ GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) { fFixedFunctionSupport = caps.fFixedFunctionSupport; fDiscardFBSupport = caps.fDiscardFBSupport; fFullClearIsFree = caps.fFullClearIsFree; + fDropsTileOnZeroDivide = caps.fDropsTileOnZeroDivide; return *this; } @@ -244,6 +246,9 @@ void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { } } + // Adreno GPUs have a tendency to drop tiles when there is a divide-by-zero in a shader + fDropsTileOnZeroDivide = kQualcomm_GrGLVendor == ctxInfo.vendor(); + this->initFSAASupport(ctxInfo, gli); this->initStencilFormats(ctxInfo); @@ -661,5 +666,6 @@ SkString GrGLCaps::dump() const { (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); r.appendf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" : "NO")); r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO")); + r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES" : "NO")); return r; } diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h index 7f0c8874ca..0939f80c26 100644 --- a/src/gpu/gl/GrGLCaps.h +++ b/src/gpu/gl/GrGLCaps.h @@ -250,6 +250,8 @@ public: bool fullClearIsFree() const { return fFullClearIsFree; } + bool dropsTileOnZeroDivide() const { return fDropsTileOnZeroDivide; } + private: /** * Maintains a bit per GrPixelConfig. It is used to avoid redundantly @@ -332,6 +334,7 @@ private: bool fFixedFunctionSupport : 1; bool fDiscardFBSupport : 1; bool fFullClearIsFree : 1; + bool fDropsTileOnZeroDivide : 1; typedef GrDrawTargetCaps INHERITED; }; |