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>
This commit is contained in:
parent
317adf73a6
commit
48b958b709
@ -708,7 +708,7 @@ void GrTextBlob::generateFromGlyphRunList(GrGlyphCache* glyphCache,
|
||||
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)) {
|
||||
|
@ -237,7 +237,7 @@ void GrTextBlob::flush(GrTextTarget* target, const SkSurfaceProps& props,
|
||||
// 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];
|
||||
|
@ -396,9 +396,6 @@ private:
|
||||
* 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 @@ private:
|
||||
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 @@ private:
|
||||
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user