change Run to store bool_aa instead of flags_only_aa
Bug: skia:2664
Change-Id: Idf89a511ba1427bf7a1000ba400aeafa215a7258
Reviewed-on: https://skia-review.googlesource.com/c/173993
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
diff --git a/src/core/SkGlyphRunPainter.cpp b/src/core/SkGlyphRunPainter.cpp
index b6c74fe..db8c31a 100644
--- a/src/core/SkGlyphRunPainter.cpp
+++ b/src/core/SkGlyphRunPainter.cpp
@@ -708,7 +708,7 @@
const SkPaint& runPaint = glyphRun.paint();
Run* run = this->pushBackRun();
- run->setRunPaintFlags(runPaint.getFlags());
+ run->setRunFontAntiAlias(runPaint.isAntiAlias());
if (GrTextContext::CanDrawAsDistanceFields(runPaint, viewMatrix, props,
shaderCaps.supportsDistanceFieldText(), options)) {
diff --git a/src/gpu/text/GrTextBlob.cpp b/src/gpu/text/GrTextBlob.cpp
index 184ee7a..48aed7a 100644
--- a/src/gpu/text/GrTextBlob.cpp
+++ b/src/gpu/text/GrTextBlob.cpp
@@ -237,7 +237,7 @@
// first flush any path glyphs
if (run.fPathGlyphs.count()) {
SkPaint runPaint{paint};
- runPaint.setFlags((runPaint.getFlags() & ~Run::kPaintFlagsMask) | run.fPaintFlags);
+ runPaint.setAntiAlias(run.fAntiAlias);
for (int i = 0; i < run.fPathGlyphs.count(); i++) {
GrTextBlob::Run::PathGlyph& pathGlyph = run.fPathGlyphs[i];
diff --git a/src/gpu/text/GrTextBlob.h b/src/gpu/text/GrTextBlob.h
index 739a079..9251fc8 100644
--- a/src/gpu/text/GrTextBlob.h
+++ b/src/gpu/text/GrTextBlob.h
@@ -396,9 +396,6 @@
* would greatly increase the memory of these cached items.
*/
struct Run {
- // the only flags we need to set
- static constexpr auto kPaintFlagsMask = SkPaint::kAntiAlias_Flag;
-
explicit Run(GrTextBlob* blob)
: fBlob{blob} {
// To ensure we always have one subrun, we push back a fresh run here
@@ -440,8 +437,8 @@
SkScalerContextFlags scalerContextFlags,
const SkMatrix& viewMatrix);
- void setRunPaintFlags(uint16_t paintFlags) {
- fPaintFlags = paintFlags & Run::kPaintFlagsMask;
+ void setRunFontAntiAlias(bool aa) {
+ fAntiAlias = aa;
}
// sets the last subrun of runIndex to use distance field text
@@ -495,7 +492,7 @@
SkTArray<PathGlyph> fPathGlyphs;
- uint16_t fPaintFlags{0}; // needed mainly for rendering paths
+ bool fAntiAlias{false}; // needed mainly for rendering paths
bool fInitialized{false};
GrTextBlob* const fBlob;