Remove GrPixelConfigIsAlphaOnly call and transition calls to it.
Bug: skia:6718
Change-Id: I4d9c31bc0ca42a80e652de29462531587efef031
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248257
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/SkGpuDevice_drawTexture.cpp b/src/gpu/SkGpuDevice_drawTexture.cpp
index 6d6208f..869f348 100644
--- a/src/gpu/SkGpuDevice_drawTexture.cpp
+++ b/src/gpu/SkGpuDevice_drawTexture.cpp
@@ -175,10 +175,10 @@
const SkPaint& paint, const SkRect& srcRect, const SkRect& dstRect,
const SkPoint dstClip[4], GrAA aa, GrQuadAAFlags aaFlags,
SkCanvas::SrcRectConstraint constraint, sk_sp<GrTextureProxy> proxy,
- SkAlphaType alphaType, SkColorSpace* colorSpace) {
+ const GrColorInfo& srcColorInfo) {
const GrColorInfo& dstInfo(rtc->colorInfo());
auto textureXform =
- GrColorSpaceXform::Make(colorSpace , alphaType,
+ GrColorSpaceXform::Make(srcColorInfo.colorSpace(), srcColorInfo.alphaType(),
dstInfo.colorSpace(), kPremul_SkAlphaType);
GrSamplerState::Filter filter;
switch (paint.getFilterQuality()) {
@@ -208,7 +208,7 @@
}
}
SkPMColor4f color;
- if (GrPixelConfigIsAlphaOnly(proxy->config())) {
+ if (GrColorTypeIsAlphaOnly(srcColorInfo.colorType())) {
color = SkColor4fPrepForDst(paint.getColor4f(), dstInfo).premul();
} else {
float paintAlpha = paint.getColor4f().fA;
@@ -246,7 +246,7 @@
}
draw_texture(rtc, clip, ctm, paint, src, dst, dstClip, aa, aaFlags, constraint,
- std::move(proxy), producer->alphaType(), producer->colorSpace());
+ std::move(proxy), producer->colorInfo());
return;
}
@@ -402,17 +402,15 @@
SK_HISTOGRAM_BOOLEAN("DrawTiled", false);
LogDrawScaleFactor(ctm, srcToDst, paint.getFilterQuality());
- SkAlphaType alphaType = image->alphaType();
- SkColorSpace* colorSpace = as_IB(image)->colorSpace();
+ GrColorInfo colorInfo(image->imageInfo().colorInfo());
if (attemptDrawTexture && can_use_draw_texture(paint)) {
draw_texture(fRenderTargetContext.get(), this->clip(), ctm, paint, src, dst,
- dstClip, aa, aaFlags, constraint, std::move(proxy), alphaType, colorSpace);
+ dstClip, aa, aaFlags, constraint, std::move(proxy), colorInfo);
return;
}
- auto colorType = SkColorTypeToGrColorType(image->colorType());
- GrTextureAdjuster adjuster(fContext.get(), std::move(proxy), colorType, alphaType,
- pinnedUniqueID, colorSpace, useDecal);
+ GrTextureAdjuster adjuster(fContext.get(), std::move(proxy), colorInfo, pinnedUniqueID,
+ useDecal);
draw_texture_producer(fContext.get(), fRenderTargetContext.get(), this->clip(), ctm,
paint, &adjuster, src, dst, dstClip, srcToDst, aa, aaFlags,
constraint, /* attempt draw_texture */ false);