Plumb GrBackendFormat into the GrPrimitiveProcessor::TextureSampler
This is not a substantive CL. It is just setting up for removing the
usage of the GrGpu in the creation of the GrProgramDesc.
Change-Id: Ic24204de256862e5e780626bde3a44f4d735c6e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249121
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrPrimitiveProcessor.cpp b/src/gpu/GrPrimitiveProcessor.cpp
index fea8e2d..5ca399a 100644
--- a/src/gpu/GrPrimitiveProcessor.cpp
+++ b/src/gpu/GrPrimitiveProcessor.cpp
@@ -53,21 +53,21 @@
return requestedFilter;
}
-GrPrimitiveProcessor::TextureSampler::TextureSampler(GrTextureType textureType,
- const GrSamplerState& samplerState,
+GrPrimitiveProcessor::TextureSampler::TextureSampler(const GrSamplerState& samplerState,
+ const GrBackendFormat& backendFormat,
const GrSwizzle& swizzle,
uint32_t extraSamplerKey) {
- this->reset(textureType, samplerState, swizzle, extraSamplerKey);
+ this->reset(samplerState, backendFormat, swizzle, extraSamplerKey);
}
-void GrPrimitiveProcessor::TextureSampler::reset(GrTextureType textureType,
- const GrSamplerState& samplerState,
+void GrPrimitiveProcessor::TextureSampler::reset(const GrSamplerState& samplerState,
+ const GrBackendFormat& backendFormat,
const GrSwizzle& swizzle,
uint32_t extraSamplerKey) {
fSamplerState = samplerState;
- fSamplerState.setFilterMode(clamp_filter(textureType, samplerState.filter()));
+ fSamplerState.setFilterMode(clamp_filter(backendFormat.textureType(), samplerState.filter()));
+ fBackendFormat = backendFormat;
fSwizzle = swizzle;
- fTextureType = textureType;
fExtraSamplerKey = extraSamplerKey;
fIsInitialized = true;
}