Remove unused fields from GrTextBlobKey
Change-Id: Ibb42f943ffbed16867d714e9a1eee35d3f422b2a Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259282 Commit-Queue: Herb Derby <herb@google.com> Auto-Submit: Herb Derby <herb@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
This commit is contained in:
parent
8718be99a2
commit
51b99659ed
@ -299,29 +299,21 @@ void GrTextContext::drawGlyphRunList(
|
||||
const SkMaskFilter* mf = blobPaint.getMaskFilter();
|
||||
bool canCache = glyphRunList.canCache() && !(blobPaint.getPathEffect() ||
|
||||
(mf && !as_MFB(mf)->asABlur(&blurRec)));
|
||||
SkScalerContextFlags scalerContextFlags = ComputeScalerContextFlags(colorInfo);
|
||||
|
||||
sk_sp<GrTextBlob> cachedBlob;
|
||||
GrTextBlob::Key key;
|
||||
if (canCache) {
|
||||
bool hasLCD = glyphRunList.anyRunsLCD();
|
||||
|
||||
// We canonicalize all non-lcd draws to use kUnknown_SkPixelGeometry
|
||||
SkPixelGeometry pixelGeometry = hasLCD ? props.pixelGeometry() :
|
||||
kUnknown_SkPixelGeometry;
|
||||
|
||||
// TODO we want to figure out a way to be able to use the canonical color on LCD text,
|
||||
// see the note on ComputeCanonicalColor above. We pick a dummy value for LCD text to
|
||||
// ensure we always match the same key
|
||||
GrColor canonicalColor = hasLCD ? SK_ColorTRANSPARENT :
|
||||
ComputeCanonicalColor(blobPaint, hasLCD);
|
||||
|
||||
key.fPixelGeometry = pixelGeometry;
|
||||
key.fUniqueID = glyphRunList.uniqueID();
|
||||
key.fStyle = blobPaint.getStyle();
|
||||
key.fHasBlur = SkToBool(mf);
|
||||
key.fCanonicalColor = canonicalColor;
|
||||
key.fScalerContextFlags = scalerContextFlags;
|
||||
cachedBlob = textBlobCache->find(key);
|
||||
}
|
||||
|
||||
|
@ -65,9 +65,7 @@ public:
|
||||
// represents the bucket. This functionality is currently only supported for A8
|
||||
SkColor fCanonicalColor;
|
||||
SkPaint::Style fStyle;
|
||||
SkPixelGeometry fPixelGeometry;
|
||||
bool fHasBlur;
|
||||
uint32_t fScalerContextFlags;
|
||||
|
||||
bool operator==(const Key& other) const;
|
||||
};
|
||||
|
@ -76,17 +76,6 @@ SkColor GrTextContext::ComputeCanonicalColor(const SkPaint& paint, bool lcd) {
|
||||
return canonicalColor;
|
||||
}
|
||||
|
||||
SkScalerContextFlags GrTextContext::ComputeScalerContextFlags(const GrColorInfo& colorInfo) {
|
||||
// If we're doing linear blending, then we can disable the gamma hacks.
|
||||
// Otherwise, leave them on. In either case, we still want the contrast boost:
|
||||
// TODO: Can we be even smarter about mask gamma based on the dest transfer function?
|
||||
if (colorInfo.isLinearlyBlended()) {
|
||||
return SkScalerContextFlags::kBoostContrast;
|
||||
} else {
|
||||
return SkScalerContextFlags::kFakeGammaAndBoostContrast;
|
||||
}
|
||||
}
|
||||
|
||||
void GrTextContext::SanitizeOptions(Options* options) {
|
||||
if (options->fMaxDistanceFieldFontSize < 0.f) {
|
||||
options->fMaxDistanceFieldFontSize = kDefaultMaxDistanceFieldFontSize;
|
||||
|
@ -79,8 +79,6 @@ private:
|
||||
|
||||
// sets up the descriptor on the blob and returns a detached cache. Client must attach
|
||||
static SkColor ComputeCanonicalColor(const SkPaint&, bool lcd);
|
||||
// Determines if we need to use fake gamma (and contrast boost):
|
||||
static SkScalerContextFlags ComputeScalerContextFlags(const GrColorInfo&);
|
||||
|
||||
const GrDistanceFieldAdjustTable* dfAdjustTable() const { return fDistanceAdjustTable.get(); }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user