Revert "Use saveLayer-determined CT in SkGpuDevice::onCreateDevice"
This reverts commit 8c5c54ceaf
.
Reason for revert: bad ANGLE diffs, Chrome roll failing
Original change's description:
> Use saveLayer-determined CT in SkGpuDevice::onCreateDevice
>
> Currently Ganesh always uses the prev render target CT, but saveLayer
> may force a different CT, depending on flags.
>
> This fixes handling of saveLayer/kF16ColorType (added in
> https://skia-review.googlesource.com/c/skia/+/227066).
>
> Change-Id: I8e73fdfdf18eb61f97fadd0504a4bd0f4a71977d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227258
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Florin Malita <fmalita@chromium.org>
TBR=bsalomon@google.com,fmalita@chromium.org
Change-Id: I0c3e74be64d5286b8d95b2aabaa464ad97fcaccf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227262
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
This commit is contained in:
parent
2e8393c275
commit
ea79574fa4
@ -1655,14 +1655,18 @@ SkBaseDevice* SkGpuDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint
|
||||
SkBackingFit fit = kNever_TileUsage == cinfo.fTileUsage ? SkBackingFit::kApprox
|
||||
: SkBackingFit::kExact;
|
||||
|
||||
// CT is sanitized in SkCanvas::internalSaveLayer
|
||||
SkASSERT(cinfo.fInfo.colorType() != SkColorType::kRGBA_1010102_SkColorType);
|
||||
GrColorType colorType = fRenderTargetContext->colorSpaceInfo().colorType();
|
||||
if (colorType == GrColorType::kRGBA_1010102) {
|
||||
// If the original device is 1010102, fall back to 8888 so that we have a usable alpha
|
||||
// channel in the layer.
|
||||
colorType = GrColorType::kRGBA_8888;
|
||||
}
|
||||
|
||||
sk_sp<GrRenderTargetContext> rtc(fContext->priv().makeDeferredRenderTargetContext(
|
||||
fit,
|
||||
cinfo.fInfo.width(),
|
||||
cinfo.fInfo.height(),
|
||||
SkColorTypeToGrColorType(cinfo.fInfo.colorType()),
|
||||
colorType,
|
||||
fRenderTargetContext->colorSpaceInfo().refColorSpace(),
|
||||
fRenderTargetContext->numSamples(),
|
||||
GrMipMapped::kNo,
|
||||
|
Loading…
Reference in New Issue
Block a user