Index: src/gpu/gl/GrGLProgram.cpp |
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp |
index c270858ec3cf82b3ed1b4184b849c550f0ae85db..040c57de3a337dec82c6e6600264805704d64369 100644 |
--- a/src/gpu/gl/GrGLProgram.cpp |
+++ b/src/gpu/gl/GrGLProgram.cpp |
@@ -83,6 +83,23 @@ void GrGLProgram::setData(const GrPrimitiveProcessor& primProc, const GrPipeline |
} |
} |
+void GrGLProgram::generateMipmaps(const GrPrimitiveProcessor& primProc, |
+ const GrPipeline& pipeline) { |
+ this->generateMipmaps(primProc, pipeline.getAllowSRGBInputs()); |
+ |
+ int numProcessors = fFragmentProcessors.count(); |
+ for (int i = 0; i < numProcessors; ++i) { |
+ const GrFragmentProcessor& processor = pipeline.getFragmentProcessor(i); |
+ this->generateMipmaps(processor, pipeline.getAllowSRGBInputs()); |
+ } |
+ |
+ if (primProc.getPixelLocalStorageState() != |
+ GrPixelLocalStorageState::kDraw_GrPixelLocalStorageState) { |
+ const GrXferProcessor& xp = pipeline.getXferProcessor(); |
+ this->generateMipmaps(xp, pipeline.getAllowSRGBInputs()); |
+ } |
+} |
+ |
void GrGLProgram::setFragmentData(const GrPrimitiveProcessor& primProc, |
const GrPipeline& pipeline, |
int* nextSamplerIdx) { |
@@ -146,3 +163,12 @@ void GrGLProgram::bindTextures(const GrProcessor& processor, |
static_cast<GrGLBuffer*>(access.buffer())); |
} |
} |
+ |
+void GrGLProgram::generateMipmaps(const GrProcessor& processor, |
+ bool allowSRGBInputs) { |
+ for (int i = 0; i < processor.numTextures(); ++i) { |
+ const GrTextureAccess& access = processor.textureAccess(i); |
+ fGpu->generateMipmaps(access.getParams(), allowSRGBInputs, |
+ static_cast<GrGLTexture*>(access.getTexture())); |
+ } |
+} |