diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkRemoteGlyphCache.cpp | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/src/core/SkRemoteGlyphCache.cpp b/src/core/SkRemoteGlyphCache.cpp index 7ee9d504fb..3d925c49d3 100644 --- a/src/core/SkRemoteGlyphCache.cpp +++ b/src/core/SkRemoteGlyphCache.cpp @@ -127,16 +127,6 @@ private: size_t fCursor{0}; }; -// -- TrackLayerDevice ----------------------------------------------------------------------------- -class TrackLayerDevice : public SkNoPixelsDevice { -public: - TrackLayerDevice(const SkIRect& bounds, const SkSurfaceProps& props) - : SkNoPixelsDevice(bounds, props) { } - SkBaseDevice* onCreateDevice(const CreateInfo& cinfo, const SkPaint*) override { - const SkSurfaceProps surfaceProps(this->surfaceProps().flags(), cinfo.fPixelGeometry); - return new TrackLayerDevice(this->getGlobalBounds(), surfaceProps); - } -}; // -- SkStrikeCacheDifferenceSpec ------------------------------------------------------------------ @@ -179,6 +169,29 @@ void SkStrikeCacheDifferenceSpec::iterateDifferences(PerStrike perStrike, PerGly } } +// -- TrackLayerDevice ----------------------------------------------------------------------------- +class TrackLayerDevice : public SkNoPixelsDevice { +public: + TrackLayerDevice(const SkIRect& bounds, const SkSurfaceProps& props) + : SkNoPixelsDevice(bounds, props) { } + SkBaseDevice* onCreateDevice(const CreateInfo& cinfo, const SkPaint*) override { + const SkSurfaceProps surfaceProps(this->surfaceProps().flags(), cinfo.fPixelGeometry); + return new TrackLayerDevice(this->getGlobalBounds(), surfaceProps); + } + + // Stolen from the SkBitmapDevice, but the SkGPUDevice is similar. + bool onShouldDisableLCD(const SkPaint& paint) const override { + if (paint.getPathEffect() || + paint.isFakeBoldText() || + paint.getStyle() != SkPaint::kFill_Style || + !paint.isSrcOver()) + { + return true; + } + return false; + } +}; + // -- SkTextBlobCacheDiffCanvas ------------------------------------------------------------------- SkTextBlobCacheDiffCanvas::SkTextBlobCacheDiffCanvas( int width, int height, |