Type usage improvements in GrTextureProducer classes
Make better use of SkISize and GrImageInfo.
Change-Id: Ie3c9f16d7db05e6527baf1aae4607d74d020ee49
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250577
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrTextureAdjuster.cpp b/src/gpu/GrTextureAdjuster.cpp
index 9b6ce36..a024db1 100644
--- a/src/gpu/GrTextureAdjuster.cpp
+++ b/src/gpu/GrTextureAdjuster.cpp
@@ -15,29 +15,17 @@
GrTextureAdjuster::GrTextureAdjuster(GrRecordingContext* context,
sk_sp<GrTextureProxy> original,
- GrColorType colorType,
- SkAlphaType alphaType,
- uint32_t uniqueID,
- SkColorSpace* cs,
- bool useDecal)
- : INHERITED(context, original->width(), original->height(),
- GrColorInfo(colorType, alphaType, sk_ref_sp(cs)), useDecal)
- , fOriginal(std::move(original))
- , fUniqueID(uniqueID) {}
-
-GrTextureAdjuster::GrTextureAdjuster(GrRecordingContext* context,
- sk_sp<GrTextureProxy> original,
const GrColorInfo& colorInfo,
uint32_t uniqueID,
bool useDecal)
- : INHERITED(context, original->width(), original->height(), colorInfo, useDecal)
+ : INHERITED(context, {colorInfo, original->dimensions()}, useDecal)
, fOriginal(std::move(original))
, fUniqueID(uniqueID) {}
void GrTextureAdjuster::makeCopyKey(const CopyParams& params, GrUniqueKey* copyKey) {
// Destination color space is irrelevant - we already have a texture so we're just sub-setting
GrUniqueKey baseKey;
- GrMakeKeyFromImageID(&baseKey, fUniqueID, SkIRect::MakeWH(this->width(), this->height()));
+ GrMakeKeyFromImageID(&baseKey, fUniqueID, SkIRect::MakeSize(this->dimensions()));
MakeCopyKeyFromOrigKey(baseKey, params, copyKey);
}
@@ -101,8 +89,8 @@
bool needsCopyForMipsOnly = false;
if (!params.isRepeated() ||
!GrGpu::IsACopyNeededForRepeatWrapMode(this->context()->priv().caps(), proxy.get(),
- proxy->width(), proxy->height(), params.filter(),
- ©Params, scaleAdjust)) {
+ proxy->dimensions(), params.filter(), ©Params,
+ scaleAdjust)) {
needsCopyForMipsOnly = GrGpu::IsACopyNeededForMips(this->context()->priv().caps(),
proxy.get(), params.filter(),
©Params);