diff --git a/src/text/gpu/TextBlob.cpp b/src/text/gpu/TextBlob.cpp index 3e0a70a693..c5464ca123 100644 --- a/src/text/gpu/TextBlob.cpp +++ b/src/text/gpu/TextBlob.cpp @@ -376,7 +376,6 @@ sk_sp TextBlob::Make(const SkGlyphRunList& glyphRunList, sk_sp blob = sk_sp(initializer.initialize(std::move(alloc), std::move(container), totalMemoryAllocated, - positionMatrix, initialLuminance)); // Be sure to pass the ref to the matrix that the SubRuns will capture. @@ -389,14 +388,16 @@ void TextBlob::addKey(const Key& key) { fKey = key; } -bool TextBlob::hasPerspective() const { return fInitialPositionMatrix.hasPerspective(); } +bool TextBlob::hasPerspective() const { + return fSubRuns->initialPosition().hasPerspective(); +} bool TextBlob::canReuse(const SkPaint& paint, const SkMatrix& positionMatrix) const { // A singular matrix will create a TextBlob with no SubRuns, but unknown glyphs can // also cause empty runs. If there are no subRuns or some glyphs were excluded or perspective, // then regenerate when the matrices don't match. if ((fSubRuns->isEmpty() || fSomeGlyphsExcluded || hasPerspective()) && - fInitialPositionMatrix != positionMatrix) { + fSubRuns->initialPosition() != positionMatrix) { return false; } @@ -446,12 +447,10 @@ const AtlasSubRun* TextBlob::testingOnlyFirstSubRun() const { TextBlob::TextBlob(SubRunAllocator&& alloc, SubRunContainerOwner subRuns, int totalMemorySize, - const SkMatrix& positionMatrix, SkColor initialLuminance) : fAlloc{std::move(alloc)} , fSubRuns{std::move(subRuns)} , fSize(totalMemorySize) - , fInitialPositionMatrix{positionMatrix} , fInitialLuminance{initialLuminance} { } diff --git a/src/text/gpu/TextBlob.h b/src/text/gpu/TextBlob.h index d534c4b040..068171ad67 100644 --- a/src/text/gpu/TextBlob.h +++ b/src/text/gpu/TextBlob.h @@ -97,7 +97,6 @@ public: TextBlob(SubRunAllocator&& alloc, SubRunContainerOwner subRuns, int totalMemorySize, - const SkMatrix& positionMatrix, SkColor initialLuminance); ~TextBlob() override; @@ -138,10 +137,6 @@ private: // Overall size of this struct plus vertices and glyphs at the end. const int fSize; - // The initial view matrix combined with the initial origin. Used to determine if a cached - // subRun can be used in this draw situation. - const SkMatrix fInitialPositionMatrix; - const SkColor fInitialLuminance; Key fKey;