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

Unified Diff: src/gpu/GrTexture.cpp

Issue 2058143002: Better (?) interface for controlling sRGB-ness of mipmaps on GrTexture (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Set gamma treatment flag appropriately, after uploading CPU mips Created 4 years, 6 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 9209dbd05353fa7fb77ec6cfba65e2358c0324e4..683458182eaef312f5067e839de9568eb47e6029 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, bool sRGBCorrect) {
+void GrTexture::dirtyMipMaps(bool mipMapsDirty) {
if (mipMapsDirty) {
if (kValid_MipMapsStatus == fMipMapsStatus) {
fMipMapsStatus = kAllocated_MipMapsStatus;
@@ -26,7 +26,6 @@ void GrTexture::dirtyMipMaps(bool mipMapsDirty, bool sRGBCorrect) {
} 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();
@@ -90,16 +89,15 @@ GrSurfaceOrigin resolve_origin(const GrSurfaceDesc& desc) {
GrTexture::GrTexture(GrGpu* gpu, const GrSurfaceDesc& desc, GrSLType samplerType,
bool wasMipMapDataProvided)
: INHERITED(gpu, desc)
- , fSamplerType(samplerType) {
+ , fSamplerType(samplerType)
+ // Gamma treatment is explicitly set after creation via GrTexturePriv
+ , fGammaTreatment(SkSourceGammaTreatment::kIgnore) {
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