diff options
Diffstat (limited to 'src/gpu/gl/GrGLProgram.cpp')
-rw-r--r-- | src/gpu/gl/GrGLProgram.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp index c270858ec3..040c57de3a 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())); + } +} |