aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/atlastext/SkAtlasTextTarget.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-03-07 11:54:37 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-07 19:25:10 +0000
commitd2e9f767bbb1a7664e9ee83d0755d7e4327cb7b2 (patch)
tree48e23613d7bb6f3c57ec16bf447390a704be5598 /src/atlastext/SkAtlasTextTarget.cpp
parentc7fbda95404a9422d0dd762d35383d5a61e89440 (diff)
Revise Text & Small Path Atlas so instantiation failure is handled at flush time
This paves the way to having the AtlasTextOps not need the RestrictedAtlasManager at op creation time. Change-Id: I1028faba730d50d3d3349a4c0809465d036ed611 Reviewed-on: https://skia-review.googlesource.com/111807 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/atlastext/SkAtlasTextTarget.cpp')
-rw-r--r--src/atlastext/SkAtlasTextTarget.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/atlastext/SkAtlasTextTarget.cpp b/src/atlastext/SkAtlasTextTarget.cpp
index 9da5fd1e3d..4513952781 100644
--- a/src/atlastext/SkAtlasTextTarget.cpp
+++ b/src/atlastext/SkAtlasTextTarget.cpp
@@ -192,15 +192,20 @@ void GrAtlasTextOp::executeForTextTarget(SkAtlasTextTarget* target) {
resourceProvider, fGeoData[i].fBlob, fGeoData[i].fRun, fGeoData[i].fSubRun,
fGeoData[i].fViewMatrix, fGeoData[i].fX, fGeoData[i].fY, fGeoData[i].fColor,
&context, glyphCache, fullAtlasManager, &autoGlyphCache);
- GrAtlasTextBlob::VertexRegenerator::Result result;
- do {
- result = regenerator.regenerate();
+ bool done = false;
+ while (!done) {
+ GrAtlasTextBlob::VertexRegenerator::Result result;
+ if (!regenerator.regenerate(&result)) {
+ break;
+ }
+ done = result.fFinished;
+
context.recordDraw(result.fFirstVertex, result.fGlyphsRegenerated,
fGeoData[i].fViewMatrix, target->handle());
if (!result.fFinished) {
// Make space in the atlas so we can continue generating vertices.
context.flush();
}
- } while (!result.fFinished);
+ }
}
}