diff options
author | Ravi Mistry <rmistry@google.com> | 2018-05-29 21:45:46 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-05-29 21:45:58 +0000 |
commit | cd21d676b782cf27a9ded17a69c0393e4d3e34cc (patch) | |
tree | e0e09d2c2b51fd646c912b2e7876d9a2a30d0cf6 /src/core/SkRemoteGlyphCache.cpp | |
parent | b6e035ee08ac85367e5c0616ab26e3dd0bf5db69 (diff) |
Revert "fonts: Use correct SurfaceProps in analysis canvas for remoting."
This reverts commit 4f078f7cfac6580dce6e213c022708922739ac6d.
Reason for revert: Seems to have caused these breakages:
* https://chromium-swarm.appspot.com/task?id=3dc6788dc7b77010&refresh=10
* https://chromium-swarm.appspot.com/task?id=3dc67452db797c10&refresh=10
Original change's description:
> fonts: Use correct SurfaceProps in analysis canvas for remoting.
>
> SaveLayer may not preserve the behaviour for lcd text, in which case
> the surfaceProps used for desc generation are inconsistent.
>
> R=​herb@google.com
>
> Bug: 829622
> Change-Id: I3adfc6780f26e4eb333a8aff76eaa4b5a9f0a0a7
> Reviewed-on: https://skia-review.googlesource.com/129557
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
TBR=herb@google.com,khushalsagar@chromium.org
Change-Id: I0372a3d834f8c4c929feb71c2b6b13739443eaaa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 829622
Reviewed-on: https://skia-review.googlesource.com/130680
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
Diffstat (limited to 'src/core/SkRemoteGlyphCache.cpp')
-rw-r--r-- | src/core/SkRemoteGlyphCache.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/core/SkRemoteGlyphCache.cpp b/src/core/SkRemoteGlyphCache.cpp index f9c38dd11e..a987e5bdde 100644 --- a/src/core/SkRemoteGlyphCache.cpp +++ b/src/core/SkRemoteGlyphCache.cpp @@ -198,6 +198,7 @@ SkTextBlobCacheDiffCanvas::SkTextBlobCacheDiffCanvas(int width, int height, SkStrikeServer* strikeSever, Settings settings) : SkNoDrawCanvas{sk_make_sp<TrackLayerDevice>(SkIRect::MakeWH(width, height), props)} , fDeviceMatrix{deviceMatrix} + , fSurfaceProps{props} , fStrikeServer{strikeSever} , fSettings{settings} { SkASSERT(fStrikeServer); @@ -283,9 +284,9 @@ void SkTextBlobCacheDiffCanvas::processGlyphRun( options.fMinDistanceFieldFontSize = fSettings.fMinDistanceFieldFontSize; options.fMaxDistanceFieldFontSize = fSettings.fMaxDistanceFieldFontSize; GrTextContext::SanitizeOptions(&options); - if (GrTextContext::CanDrawAsDistanceFields(runPaint, runMatrix, surfaceProps(), - fSettings.fContextSupportsDistanceFieldText, - options)) { + if (GrTextContext::CanDrawAsDistanceFields(runPaint, runMatrix, fSurfaceProps, + fSettings.fContextSupportsDistanceFieldText, + options)) { SkScalar textRatio; SkPaint dfPaint(runPaint); SkScalerContextFlags flags; @@ -357,7 +358,7 @@ void SkTextBlobCacheDiffCanvas::processGlyphRun( SkScalerContextEffects effects; auto* glyphCacheState = static_cast<SkStrikeServer*>(fStrikeServer) - ->getOrCreateCache(runPaint, &this->surfaceProps(), &runMatrix, + ->getOrCreateCache(runPaint, &fSurfaceProps, &runMatrix, SkScalerContextFlags::kFakeGammaAndBoostContrast, &deviceSpecificRec, &effects); SkASSERT(glyphCacheState); @@ -396,7 +397,7 @@ void SkTextBlobCacheDiffCanvas::processGlyphRunForPaths(const SkTextBlobRunItera SkScalerContextEffects effects; auto* glyphCacheState = static_cast<SkStrikeServer*>(fStrikeServer) - ->getOrCreateCache(pathPaint, &this->surfaceProps(), nullptr, + ->getOrCreateCache(pathPaint, &fSurfaceProps, nullptr, SkScalerContextFlags::kFakeGammaAndBoostContrast, &deviceSpecificRec, &effects); @@ -417,8 +418,8 @@ void SkTextBlobCacheDiffCanvas::processGlyphRunForDFT(const SkTextBlobRunIterato SkScalerContextRec deviceSpecificRec; SkScalerContextEffects effects; auto* glyphCacheState = static_cast<SkStrikeServer*>(fStrikeServer) - ->getOrCreateCache(runPaint, &this->surfaceProps(), nullptr, - flags, &deviceSpecificRec, &effects); + ->getOrCreateCache(runPaint, &fSurfaceProps, nullptr, flags, + &deviceSpecificRec, &effects); const bool asPath = false; const SkIPoint subPixelPos{0, 0}; @@ -431,13 +432,6 @@ void SkTextBlobCacheDiffCanvas::processGlyphRunForDFT(const SkTextBlobRunIterato } } -const SkSurfaceProps& SkTextBlobCacheDiffCanvas::surfaceProps() const { - // SaveLayers can change the SurfaceProps used, and we ensure that the props used by the top - // device for the layer is correct. This is done by ensuring that TrackLayerDevice used by this - // canvas propagates them correctly when a new device is created for a layer. - return this->getTopDevice()->surfaceProps(); -} - struct StrikeSpec { StrikeSpec() {} StrikeSpec(SkFontID typefaceID_, SkDiscardableHandleId discardableHandleId_) |