diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 3b6abc00b0..d5e9ae071e 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -1167,12 +1167,17 @@ void SkCanvas::internalSaveLayer(const SaveLayerRec& rec, SaveLayerStrategy stra sk_sp newDevice; { SkASSERT(info.alphaType() != kOpaque_SkAlphaType); - const SkBaseDevice::TileUsage usage = SkBaseDevice::kNever_TileUsage; + + // TODO: reinstate kPreserveLCDText_SaveLayerFlag + geo = kUnknown_SkPixelGeometry; + const bool trackCoverage = SkToBool(saveLayerFlags & kMaskAgainstCoverage_EXPERIMENTAL_DONT_USE_SaveLayerFlag); - const SkBaseDevice::CreateInfo createInfo = SkBaseDevice::CreateInfo(info, usage, geo, - trackCoverage, - fAllocator.get()); + const auto createInfo = SkBaseDevice::CreateInfo(info, + geo, + SkBaseDevice::kNever_TileUsage, + trackCoverage, + fAllocator.get()); newDevice.reset(priorDevice->onCreateDevice(createInfo, paint)); if (!newDevice) { return; diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp index bf35bb1a5e..234ca2e388 100644 --- a/src/core/SkDevice.cpp +++ b/src/core/SkDevice.cpp @@ -106,20 +106,6 @@ bool SkBaseDevice::getLocalToMarker(uint32_t id, SkM44* localToMarker) const { return false; } -SkPixelGeometry SkBaseDevice::CreateInfo::AdjustGeometry(TileUsage tileUsage, SkPixelGeometry geo) { - switch (tileUsage) { - case kPossible_TileUsage: - // (we think) for compatibility with old clients, we assume this layer can support LCD - // even though they may not have marked it as opaque... seems like we should update - // our callers (reed/robertphilips). - break; - case kNever_TileUsage: - geo = kUnknown_SkPixelGeometry; - break; - } - return geo; -} - static inline bool is_int(float x) { return x == (float) sk_float_round2int(x); } diff --git a/src/core/SkDevice.h b/src/core/SkDevice.h index ecd5a86447..9482279659 100644 --- a/src/core/SkDevice.h +++ b/src/core/SkDevice.h @@ -339,17 +339,14 @@ protected: virtual bool onAccessPixels(SkPixmap*) { return false; } struct CreateInfo { - static SkPixelGeometry AdjustGeometry(TileUsage, SkPixelGeometry); - - // The constructor may change the pixel geometry based on other parameters. CreateInfo(const SkImageInfo& info, - TileUsage tileUsage, SkPixelGeometry geo, + TileUsage tileUsage, bool trackCoverage, SkRasterHandleAllocator* allocator) : fInfo(info) , fTileUsage(tileUsage) - , fPixelGeometry(AdjustGeometry(tileUsage, geo)) + , fPixelGeometry(geo) , fTrackCoverage(trackCoverage) , fAllocator(allocator) {}