Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Unified Diff: src/gpu/gl/GrGLProgram.cpp

Issue 2007973002: Manually generated sRGB mipmaps. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Break long columns Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLProgram.h ('k') | tests/SRGBMipMapTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()));
+ }
+}
« no previous file with comments | « src/gpu/gl/GrGLProgram.h ('k') | tests/SRGBMipMapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698