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

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

Issue 1605013002: Fix GrAtlasTextBlob bounds management (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanuptext17
Patch Set: fix glprograms 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 | « src/gpu/batches/GrAtlasTextBatch.h ('k') | src/gpu/text/GrAtlasTextBlob.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrAtlasTextBatch.cpp
diff --git a/src/gpu/batches/GrAtlasTextBatch.cpp b/src/gpu/batches/GrAtlasTextBatch.cpp
index ce6b2eae2b56d4db7eb86aab35b94f756cc34434..b2251a42a884b1be3f3c530ea27ab1926134386e 100644
--- a/src/gpu/batches/GrAtlasTextBatch.cpp
+++ b/src/gpu/batches/GrAtlasTextBatch.cpp
@@ -413,6 +413,19 @@ void GrAtlasTextBatch::onPrepareDraws(Target* target) const {
size_t byteCount = info.byteCount();
memcpy(currVertex, blob->fVertices + info.vertexStartIndex(), byteCount);
+#ifdef SK_DEBUG
+ // bounds sanity check
+ SkRect rect;
+ rect.setLargestInverted();
+ SkPoint* vertex = (SkPoint*) ((char*)blob->fVertices + info.vertexStartIndex());
+ rect.growToInclude(vertex, vertexStride, kVerticesPerGlyph * info.glyphCount());
+
+ if (this->usesDistanceFields()) {
+ fBatch.fViewMatrix.mapRect(&rect);
+ }
+ SkASSERT(fBounds.contains(rect));
+#endif
+
currVertex += byteCount;
}
« no previous file with comments | « src/gpu/batches/GrAtlasTextBatch.h ('k') | src/gpu/text/GrAtlasTextBlob.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698