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

Unified Diff: src/gpu/gl/GrGLGpu.h

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/GrTexturePriv.h ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGpu.h
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h
index 0b2198a8342ae69d66fb865140e1df56e94c383f..06d4bd357bade03841ad916d1d9bdb08bf50a92e 100644
--- a/src/gpu/gl/GrGLGpu.h
+++ b/src/gpu/gl/GrGLGpu.h
@@ -62,6 +62,8 @@ public:
void bindTexelBuffer(int unitIdx, intptr_t offsetInBytes, GrPixelConfig, GrGLBuffer*);
+ void generateMipmaps(const GrTextureParams& params, bool allowSRGBInputs, GrGLTexture* texture);
+
bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeight, size_t rowBytes,
GrPixelConfig readConfig, DrawPreference*,
ReadPixelTempDrawInfo*) override;
@@ -237,6 +239,7 @@ private:
GrSurface* src,
const SkIRect& srcRect,
const SkIPoint& dstPoint);
+ bool generateMipmap(GrGLTexture* texture, bool gammaCorrect);
void stampPLSSetupRect(const SkRect& bounds);
@@ -319,6 +322,8 @@ private:
void flushMinSampleShading(float minSampleShading);
+ void flushFramebufferSRGB(bool enable);
+
// helper for onCreateTexture and writeTexturePixels
enum UploadType {
kNewTexture_UploadType, // we are creating a new texture
@@ -365,6 +370,7 @@ private:
SkAutoTUnref<GrGLContext> fGLContext;
bool createCopyProgram(int progIdx);
+ bool createMipmapProgram(int progIdx);
bool createWireRectProgram();
bool createPLSSetupProgram();
@@ -532,6 +538,14 @@ private:
} fCopyPrograms[3];
SkAutoTUnref<GrGLBuffer> fCopyProgramArrayBuffer;
+ /** IDs for texture mipmap program. (4 filter configurations) */
+ struct {
+ GrGLuint fProgram;
+ GrGLint fTextureUniform;
+ GrGLint fTexCoordXformUniform;
+ } fMipmapPrograms[4];
+ SkAutoTUnref<GrGLBuffer> fMipmapProgramArrayBuffer;
+
struct {
GrGLuint fProgram;
GrGLint fColorUniform;
@@ -553,6 +567,12 @@ private:
}
}
+ static int TextureSizeToMipmapProgramIdx(int width, int height) {
+ const bool wide = (width > 1) && SkToBool(width & 0x1);
+ const bool tall = (height > 1) && SkToBool(height & 0x1);
+ return (wide ? 0x2 : 0x0) | (tall ? 0x1 : 0x0);
+ }
+
struct {
GrGLuint fProgram;
GrGLint fPosXformUniform;
« no previous file with comments | « src/gpu/GrTexturePriv.h ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698