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

Unified Diff: src/gpu/GrTexture.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 | « include/gpu/GrTexture.h ('k') | src/gpu/GrTexturePriv.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTexture.cpp
diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp
index 033f1da8914daf2ea674059d274e1139a4168468..9209dbd05353fa7fb77ec6cfba65e2358c0324e4 100644
--- a/src/gpu/GrTexture.cpp
+++ b/src/gpu/GrTexture.cpp
@@ -18,7 +18,7 @@
#include "SkMipMap.h"
#include "SkTypes.h"
-void GrTexture::dirtyMipMaps(bool mipMapsDirty) {
+void GrTexture::dirtyMipMaps(bool mipMapsDirty, bool sRGBCorrect) {
if (mipMapsDirty) {
if (kValid_MipMapsStatus == fMipMapsStatus) {
fMipMapsStatus = kAllocated_MipMapsStatus;
@@ -26,6 +26,7 @@ void GrTexture::dirtyMipMaps(bool mipMapsDirty) {
} else {
const bool sizeChanged = kNotAllocated_MipMapsStatus == fMipMapsStatus;
fMipMapsStatus = kValid_MipMapsStatus;
+ fMipMapsAreSRGBCorrect = sRGBCorrect;
if (sizeChanged) {
// This must not be called until after changing fMipMapsStatus.
this->didChangeGpuMemorySize();
@@ -93,9 +94,12 @@ GrTexture::GrTexture(GrGpu* gpu, const GrSurfaceDesc& desc, GrSLType samplerType
if (wasMipMapDataProvided) {
fMipMapsStatus = kValid_MipMapsStatus;
fMaxMipMapLevel = SkMipMap::ComputeLevelCount(fDesc.fWidth, fDesc.fHeight);
+ // At the moment, the CPU code for generating mipmaps doesn't account for sRGB:
+ fMipMapsAreSRGBCorrect = false;
} else {
fMipMapsStatus = kNotAllocated_MipMapsStatus;
fMaxMipMapLevel = 0;
+ fMipMapsAreSRGBCorrect = false;
}
}
« no previous file with comments | « include/gpu/GrTexture.h ('k') | src/gpu/GrTexturePriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698