Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Unified Diff: src/gpu/GrAtlasTextContext.cpp

Issue 1122253003: small fix to correct bounds on distance field text (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAtlasTextContext.cpp
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp
index e5fd8e6fa16315c17db41aa36f945e81655a4a97..7731f4d9be7fdf65f27a4631a091086c7882db9a 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:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698