diff options
author | 2015-05-06 06:46:01 -0700 | |
---|---|---|
committer | 2015-05-06 06:46:01 -0700 | |
commit | 444987fea8e6be1ff89ecce14ef0d934e7d3eb04 (patch) | |
tree | cc461f46164d992ed900b39700819c3335bd8fc1 /src/gpu/GrAtlasTextContext.cpp | |
parent | 84b008873b5bdf35eba9185038fb3b5580a8b9a8 (diff) |
small fix to correct bounds on distance field text
BUG=skia:
Review URL: https://codereview.chromium.org/1122253003
Diffstat (limited to 'src/gpu/GrAtlasTextContext.cpp')
-rw-r--r-- | src/gpu/GrAtlasTextContext.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp index e5fd8e6fa1..7731f4d9be 100644 --- a/src/gpu/GrAtlasTextContext.cpp +++ b/src/gpu/GrAtlasTextContext.cpp @@ -1713,9 +1713,20 @@ public: // init() so the Batch can initialize itself Geometry& geometry() { return fGeoData[0]; } void init() { - fBatch.fColor = fGeoData[0].fColor; - fBatch.fViewMatrix = fGeoData[0].fBlob->fViewMatrix; - this->setBounds(fGeoData[0].fBlob->fRuns[fGeoData[0].fRun].fVertexBounds); + const Geometry& geo = fGeoData[0]; + fBatch.fColor = geo.fColor; + fBatch.fViewMatrix = geo.fBlob->fViewMatrix; + + // We don't yet position distance field text on the cpu, so we have to map the vertex bounds + // into device space + const Run& run = geo.fBlob->fRuns[geo.fRun]; + if (run.fSubRunInfo[geo.fSubRun].fDrawAsDistanceFields) { + SkRect bounds = run.fVertexBounds; + fBatch.fViewMatrix.mapRect(&bounds); + this->setBounds(bounds); + } else { + this->setBounds(run.fVertexBounds); + } } private: |