aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/batches/GrAtlasTextBatch.cpp
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2016-01-22 06:08:48 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-22 06:08:48 -0800
commit7481e75830dfae1e9084ff62e3d8438879e31aaa (patch)
tree4539059e92f3b850044ea91ba708a89f0996e85e /src/gpu/batches/GrAtlasTextBatch.cpp
parent4c5cd7d527ed29aabfa72aa47b23a4496eeda357 (diff)
Fix GrAtlasTextBlob bounds management
Diffstat (limited to 'src/gpu/batches/GrAtlasTextBatch.cpp')
-rw-r--r--src/gpu/batches/GrAtlasTextBatch.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gpu/batches/GrAtlasTextBatch.cpp b/src/gpu/batches/GrAtlasTextBatch.cpp
index ce6b2eae2b..b2251a42a8 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;
}