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>
This commit is contained in:
parent
706a6ff60c
commit
cf1aa5327e
@ -112,6 +112,11 @@ private:
|
||||
uint32_t color = random.nextU();
|
||||
x = size + draw_string(fTarget.get(), text, x, y, color, typeface, size);
|
||||
x = SkScalarCeilToScalar(x);
|
||||
// Flush periodically to test continued drawing after a flush. Using color
|
||||
// to avoid churning the RNG and having to rebaseline images.
|
||||
if (!(color & 0xf)) {
|
||||
fTarget->flush();
|
||||
}
|
||||
if (x + 100 > kSize) {
|
||||
x = 0;
|
||||
y += SkScalarCeilToScalar(size + 3);
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user