aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/atlastext
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-11-29 14:58:59 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-30 15:37:57 +0000
commitcf1aa5327ed9b19fbab9fe1e97292cce509096b4 (patch)
treefcafc504a8309e584808ff81b83cbc41a23459fb /src/atlastext
parent706a6ff60c55bee85cff06fc9f8f3764f6e5154b (diff)
Fix SkInternalAtlasTextContext to update advance the flush token after issuing each draw.
This was causing SkAtlasTextTarget:flush() calls beyond the first to skip the uploads of glyphs added to the atlas after the first flush(). Change-Id: I291b88d50629e38914d4b6af21fc25d8a41fbd9d Reviewed-on: https://skia-review.googlesource.com/77584 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/atlastext')
-rw-r--r--src/atlastext/SkInternalAtlasTextContext.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/atlastext/SkInternalAtlasTextContext.cpp b/src/atlastext/SkInternalAtlasTextContext.cpp
index 8be7e1fb67..858ae4da01 100644
--- a/src/atlastext/SkInternalAtlasTextContext.cpp
+++ b/src/atlastext/SkInternalAtlasTextContext.cpp
@@ -98,17 +98,16 @@ void SkInternalAtlasTextContext::flush() {
for (const auto& upload : fASAPUploads) {
upload(writePixelsFn);
}
- auto draw = fDraws.begin();
auto inlineUpload = fInlineUploads.begin();
- while (draw != fDraws.end()) {
- while (inlineUpload != fInlineUploads.end() && inlineUpload->fToken == draw->fToken) {
+ for (const auto& draw : fDraws) {
+ while (inlineUpload != fInlineUploads.end() && inlineUpload->fToken == draw.fToken) {
inlineUpload->fUpload(writePixelsFn);
++inlineUpload;
}
- auto vertices = reinterpret_cast<const SkAtlasTextRenderer::SDFVertex*>(draw->fVertexData);
- fRenderer->drawSDFGlyphs(draw->fTargetHandle, fDistanceFieldAtlas.fTextureHandle, vertices,
- draw->fGlyphCnt);
- ++draw;
+ auto vertices = reinterpret_cast<const SkAtlasTextRenderer::SDFVertex*>(draw.fVertexData);
+ fRenderer->drawSDFGlyphs(draw.fTargetHandle, fDistanceFieldAtlas.fTextureHandle, vertices,
+ draw.fGlyphCnt);
+ this->flushToken();
}
fASAPUploads.reset();
fInlineUploads.reset();