Better layer tracking fidelity

Track layer processing more faithfully.
This temporary until we can remove the old
system for dissabling the unneeded system
for falling back to A8 format.

BUG=skia:7786

Change-Id: Iee9154f4209c4020f16b04edd03e42c6b7d0ec98
Reviewed-on: https://skia-review.googlesource.com/119104
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This commit is contained in:
Herb Derby 2018-04-06 16:49:57 -04:00 committed by Skia Commit-Bot
parent 1c6098d4b7
commit 30a9d260e8

View File

@ -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,