Remove bilerpPadding from SubRuns down to AtlasManager

Change-Id: I4a6a7306f6549c1749ee013b7ba6de4408dbf05a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/529206
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This commit is contained in:
Herb Derby 2022-04-16 22:18:46 -06:00 committed by SkCQ
parent 88530c559e
commit b7bddda319
5 changed files with 15 additions and 23 deletions

View File

@ -146,8 +146,7 @@ GrDrawOpAtlas::ErrorCode GrAtlasManager::addGlyphToAtlas(const SkGlyph& skGlyph,
GrGlyph* grGlyph,
int srcPadding,
GrResourceProvider* resourceProvider,
GrDeferredUploadTarget* uploadTarget,
bool) {
GrDeferredUploadTarget* uploadTarget) {
SkASSERT(0 <= srcPadding && srcPadding <= SK_DistanceFieldInset);
if (skGlyph.image() == nullptr) {

View File

@ -51,14 +51,11 @@ public:
bool hasGlyph(GrMaskFormat, GrGlyph*);
// If bilerpPadding == true then addGlyphToAtlas adds a 1 pixel border to the glyph before
// inserting it into the atlas.
GrDrawOpAtlas::ErrorCode addGlyphToAtlas(const SkGlyph&,
GrGlyph*,
int srcPadding,
GrResourceProvider*,
GrDeferredUploadTarget*,
bool);
GrDeferredUploadTarget*);
// To ensure the GrDrawOpAtlas does not evict the Glyph Mask from its texture backing store,
// the client must pass in the current op token along with the GrGlyph.

View File

@ -94,7 +94,7 @@ void GrGlyphVector::packedGlyphIDToGrGlyph(GrStrikeCache* cache) {
}
// This must be pinned for the Atlas filling to work.
// TODO(herb): reenable after the cut on 20220414
// TODO(herb): re-enable after the cut on 20220414
// fStrike->verifyPinnedStrike();
// Drop the ref on the strike that was taken in the SkGlyphRunPainter process* methods.
@ -105,8 +105,7 @@ void GrGlyphVector::packedGlyphIDToGrGlyph(GrStrikeCache* cache) {
std::tuple<bool, int> GrGlyphVector::regenerateAtlas(int begin, int end,
GrMaskFormat maskFormat,
int srcPadding,
GrMeshDrawTarget* target,
bool bilerpPadding) {
GrMeshDrawTarget* target) {
GrAtlasManager* atlasManager = target->atlasManager();
GrDeferredUploadTarget* uploadTarget = target->deferredUploadTarget();
@ -133,8 +132,7 @@ std::tuple<bool, int> GrGlyphVector::regenerateAtlas(int begin, int end,
if (!atlasManager->hasGlyph(maskFormat, grGlyph)) {
const SkGlyph& skGlyph = *metricsAndImages.glyph(grGlyph->fPackedID);
auto code = atlasManager->addGlyphToAtlas(
skGlyph, grGlyph, srcPadding, target->resourceProvider(),
uploadTarget, bilerpPadding);
skGlyph, grGlyph, srcPadding, target->resourceProvider(), uploadTarget);
if (code != GrDrawOpAtlas::ErrorCode::kSucceeded) {
success = code != GrDrawOpAtlas::ErrorCode::kError;
break;

View File

@ -54,8 +54,7 @@ public:
int begin, int end,
GrMaskFormat maskFormat,
int srcPadding,
GrMeshDrawTarget *,
bool bilerpPadding = false);
GrMeshDrawTarget *);
static size_t GlyphVectorSize(size_t count) {
return sizeof(Variant) * count;

View File

@ -1275,7 +1275,7 @@ void DirectMaskSubRun::testingOnly_packedGlyphIDToGrGlyph(GrStrikeCache *cache)
std::tuple<bool, int>
DirectMaskSubRun::regenerateAtlas(int begin, int end, GrMeshDrawTarget* target) const {
return fGlyphs.regenerateAtlas(begin, end, fMaskFormat, 0, target, false);
return fGlyphs.regenerateAtlas(begin, end, fMaskFormat, 0, target);
}
// The 99% case. No clip. Non-color only.
@ -1579,7 +1579,7 @@ void TransformedMaskSubRun::testingOnly_packedGlyphIDToGrGlyph(GrStrikeCache *ca
std::tuple<bool, int> TransformedMaskSubRun::regenerateAtlas(int begin, int end,
GrMeshDrawTarget* target) const {
return fGlyphs.regenerateAtlas(begin, end, fVertexFiller.grMaskType(), 1, target, false);
return fGlyphs.regenerateAtlas(begin, end, fVertexFiller.grMaskType(), 1, target);
}
void TransformedMaskSubRun::fillVertexData(void* vertexDst, int offset, int count,
@ -1854,10 +1854,9 @@ void SDFTSubRun::testingOnly_packedGlyphIDToGrGlyph(GrStrikeCache *cache) const
fGlyphs.packedGlyphIDToGrGlyph(cache);
}
std::tuple<bool, int> SDFTSubRun::regenerateAtlas(
int begin, int end, GrMeshDrawTarget *target) const {
return fGlyphs.regenerateAtlas(
begin, end, kA8_GrMaskFormat, SK_DistanceFieldInset, target, false);
std::tuple<bool, int>
SDFTSubRun::regenerateAtlas(int begin, int end, GrMeshDrawTarget *target) const {
return fGlyphs.regenerateAtlas(begin, end, kA8_GrMaskFormat, SK_DistanceFieldInset, target);
}
size_t SDFTSubRun::vertexStride(const SkMatrix& drawMatrix) const {
@ -2414,7 +2413,7 @@ void DirectMaskSubRunNoCache::testingOnly_packedGlyphIDToGrGlyph(GrStrikeCache *
std::tuple<bool, int>
DirectMaskSubRunNoCache::regenerateAtlas(int begin, int end, GrMeshDrawTarget* target) const {
return fGlyphs.regenerateAtlas(begin, end, fMaskFormat, 0, target, false);
return fGlyphs.regenerateAtlas(begin, end, fMaskFormat, 0, target);
}
// The 99% case. No clip. Non-color only.
@ -2581,7 +2580,7 @@ void TransformedMaskSubRunNoCache::testingOnly_packedGlyphIDToGrGlyph(GrStrikeCa
std::tuple<bool, int> TransformedMaskSubRunNoCache::regenerateAtlas(
int begin, int end, GrMeshDrawTarget* target) const {
return fGlyphs.regenerateAtlas(begin, end, fVertexFiller.grMaskType(), 1, target, false);
return fGlyphs.regenerateAtlas(begin, end, fVertexFiller.grMaskType(), 1, target);
}
void TransformedMaskSubRunNoCache::fillVertexData(
@ -2778,7 +2777,7 @@ void SDFTSubRunNoCache::testingOnly_packedGlyphIDToGrGlyph(GrStrikeCache *cache)
std::tuple<bool, int> SDFTSubRunNoCache::regenerateAtlas(
int begin, int end, GrMeshDrawTarget *target) const {
return fGlyphs.regenerateAtlas(begin, end, fMaskFormat, SK_DistanceFieldInset, target, false);
return fGlyphs.regenerateAtlas(begin, end, fMaskFormat, SK_DistanceFieldInset, target);
}
size_t SDFTSubRunNoCache::vertexStride(const SkMatrix& drawMatrix) const {
@ -3323,7 +3322,7 @@ void DirectMaskSubRunSlug::testingOnly_packedGlyphIDToGrGlyph(GrStrikeCache *cac
std::tuple<bool, int>
DirectMaskSubRunSlug::regenerateAtlas(int begin, int end, GrMeshDrawTarget* target) const {
return fGlyphs.regenerateAtlas(begin, end, fMaskFormat, 0, target, false);
return fGlyphs.regenerateAtlas(begin, end, fMaskFormat, 0, target);
}
template<typename Quad, typename VertexData>