diff options
author | 2016-01-22 06:08:48 -0800 | |
---|---|---|
committer | 2016-01-22 06:08:48 -0800 | |
commit | 7481e75830dfae1e9084ff62e3d8438879e31aaa (patch) | |
tree | 4539059e92f3b850044ea91ba708a89f0996e85e /src/gpu/batches/GrAtlasTextBatch.cpp | |
parent | 4c5cd7d527ed29aabfa72aa47b23a4496eeda357 (diff) |
Fix GrAtlasTextBlob bounds management
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1605013002
Committed: https://skia.googlesource.com/skia/+/ae473fdfc3db2d9dd82b05b2568767d6d4038fcd
Review URL: https://codereview.chromium.org/1605013002
Diffstat (limited to 'src/gpu/batches/GrAtlasTextBatch.cpp')
-rw-r--r-- | src/gpu/batches/GrAtlasTextBatch.cpp | 13 |
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; } |