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

Unified Diff: src/gpu/batches/GrAtlasTextBatch.h

Issue 1615473002: Revert of Fix GrAtlasTextBlob bounds management (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanuptext17
Patch Set: Created 4 years, 11 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 | src/gpu/batches/GrAtlasTextBatch.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrAtlasTextBatch.h
diff --git a/src/gpu/batches/GrAtlasTextBatch.h b/src/gpu/batches/GrAtlasTextBatch.h
index 01c5615d50e1aca60f69d80d55ab37d0de01ef59..8f20313378c4bc7b1842db4e06e788a65cee3c46 100644
--- a/src/gpu/batches/GrAtlasTextBatch.h
+++ b/src/gpu/batches/GrAtlasTextBatch.h
@@ -84,31 +84,14 @@
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.
- // We handle vertex bounds differently for distance field text and bitmap text because
- // the vertex bounds of bitmap text are in device space. If we are flushing multiple runs
- // from one blob then we are going to pay the price here of mapping the rect for each run.
+ // into device space
const Run& run = geo.fBlob->fRuns[geo.fRun];
- SkRect bounds = run.fSubRunInfo[geo.fSubRun].vertexBounds();
if (run.fSubRunInfo[geo.fSubRun].drawAsDistanceFields()) {
- // Distance field text is positioned with the (X,Y) as part of the glyph position,
- // and currently the view matrix is applied on the GPU
- bounds.offset(geo.fBlob->fX - geo.fBlob->fInitialX,
- geo.fBlob->fY - geo.fBlob->fInitialY);
+ SkRect bounds = run.fVertexBounds;
fBatch.fViewMatrix.mapRect(&bounds);
this->setBounds(bounds);
} else {
- // Bitmap text is fully positioned on the CPU
- SkMatrix boundsMatrix;
- bounds.offset(-geo.fBlob->fInitialX, -geo.fBlob->fInitialY);
- boundsMatrix.setConcat(fBatch.fViewMatrix, geo.fBlob->fInitialViewMatrixInverse);
- boundsMatrix.mapRect(&bounds);
-
- // Due to floating point numerical inaccuracies, we have to round out here
- SkRect roundedOutBounds;
- bounds.roundOut(&roundedOutBounds);
- roundedOutBounds.offset(geo.fBlob->fX, geo.fBlob->fY);
- this->setBounds(roundedOutBounds);
+ this->setBounds(run.fVertexBounds);
}
}
« no previous file with comments | « no previous file | src/gpu/batches/GrAtlasTextBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698