aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/text/GrGlyphCache.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/gpu/text/GrGlyphCache.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/gpu/text/GrGlyphCache.cpp')
-rw-r--r--src/gpu/text/GrGlyphCache.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gpu/text/GrGlyphCache.cpp b/src/gpu/text/GrGlyphCache.cpp
index 2372af815c..49e24b8b8c 100644
--- a/src/gpu/text/GrGlyphCache.cpp
+++ b/src/gpu/text/GrGlyphCache.cpp
@@ -292,7 +292,8 @@ void GrTextStrike::removeID(GrDrawOpAtlas::AtlasID id) {
}
}
-bool GrTextStrike::addGlyphToAtlas(GrResourceProvider* resourceProvider,
+GrDrawOpAtlas::ErrorCode GrTextStrike::addGlyphToAtlas(
+ GrResourceProvider* resourceProvider,
GrDeferredUploadTarget* target,
GrGlyphCache* glyphCache,
GrAtlasManager* fullAtlasManager,
@@ -325,7 +326,7 @@ bool GrTextStrike::addGlyphToAtlas(GrResourceProvider* resourceProvider,
if (isSDFGlyph) {
if (!get_packed_glyph_df_image(cache, skGlyph, width, height,
storage.get())) {
- return false;
+ return GrDrawOpAtlas::ErrorCode::kError;
}
} else {
void* dataPtr = storage.get();
@@ -336,15 +337,16 @@ bool GrTextStrike::addGlyphToAtlas(GrResourceProvider* resourceProvider,
if (!get_packed_glyph_image(cache, skGlyph, glyph->width(), glyph->height(),
rowBytes, expectedMaskFormat,
dataPtr)) {
- return false;
+ return GrDrawOpAtlas::ErrorCode::kError;
}
}
- bool success = fullAtlasManager->addToAtlas(resourceProvider, glyphCache, this,
+ GrDrawOpAtlas::ErrorCode result = fullAtlasManager->addToAtlas(
+ resourceProvider, glyphCache, this,
&glyph->fID, target, expectedMaskFormat,
width, height,
storage.get(), &glyph->fAtlasLocation);
- if (success) {
+ if (GrDrawOpAtlas::ErrorCode::kSucceeded == result) {
if (addPad) {
glyph->fAtlasLocation.fX += 1;
glyph->fAtlasLocation.fY += 1;
@@ -352,5 +354,5 @@ bool GrTextStrike::addGlyphToAtlas(GrResourceProvider* resourceProvider,
SkASSERT(GrDrawOpAtlas::kInvalidAtlasID != glyph->fID);
fAtlasedGlyphs++;
}
- return success;
+ return result;
}