aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/private/GrSurfaceProxy.h6
-rw-r--r--include/private/GrTextureProxy.h3
-rw-r--r--src/gpu/GrRenderTargetProxy.cpp3
-rw-r--r--src/gpu/GrSurfaceProxy.cpp5
-rw-r--r--src/gpu/GrTextureProxy.cpp9
-rw-r--r--src/gpu/GrTextureRenderTargetProxy.cpp2
6 files changed, 17 insertions, 11 deletions
diff --git a/include/private/GrSurfaceProxy.h b/include/private/GrSurfaceProxy.h
index bf668fcb2d..1b7950c510 100644
--- a/include/private/GrSurfaceProxy.h
+++ b/include/private/GrSurfaceProxy.h
@@ -323,8 +323,6 @@ protected:
, fFit(fit)
, fBudgeted(budgeted)
, fFlags(flags)
- // fMipColorMode is only valid for texturable proxies
- , fMipColorMode(SkDestinationSurfaceColorMode::kLegacy)
, fGpuMemorySize(kInvalidGpuMemorySize)
, fLastOpList(nullptr) {
// Note: this ctor pulls a new uniqueID from the same pool at the GrGpuResources
@@ -347,7 +345,8 @@ protected:
}
GrSurface* instantiateImpl(GrResourceProvider* resourceProvider, int sampleCnt,
- GrSurfaceFlags flags, bool isMipMapped);
+ GrSurfaceFlags flags, bool isMipMapped,
+ SkDestinationSurfaceColorMode mipColorMode);
// For wrapped resources, 'fConfig', 'fWidth', 'fHeight', and 'fOrigin; will always be filled in
// from the wrapped resource.
@@ -360,7 +359,6 @@ protected:
// mutable bc of SkSurface/SkImage wishy-washiness
const uint32_t fFlags;
- SkDestinationSurfaceColorMode fMipColorMode;
const UniqueID fUniqueID; // set from the backing resource for wrapped resources
diff --git a/include/private/GrTextureProxy.h b/include/private/GrTextureProxy.h
index 342e920682..d40b2e173e 100644
--- a/include/private/GrTextureProxy.h
+++ b/include/private/GrTextureProxy.h
@@ -53,8 +53,11 @@ protected:
// Wrapped version
GrTextureProxy(sk_sp<GrSurface>);
+ SkDestinationSurfaceColorMode mipColorMode() const { return fMipColorMode; }
+
private:
bool fIsMipMapped;
+ SkDestinationSurfaceColorMode fMipColorMode;
size_t onUninstantiatedGpuMemorySize() const override;
diff --git a/src/gpu/GrRenderTargetProxy.cpp b/src/gpu/GrRenderTargetProxy.cpp
index 099f7e5f8d..7cc51dfcd6 100644
--- a/src/gpu/GrRenderTargetProxy.cpp
+++ b/src/gpu/GrRenderTargetProxy.cpp
@@ -49,7 +49,8 @@ GrSurface* GrRenderTargetProxy::instantiate(GrResourceProvider* resourceProvider
static constexpr GrSurfaceFlags kFlags = kRenderTarget_GrSurfaceFlag;
GrSurface* surf = this->instantiateImpl(resourceProvider, fSampleCnt, kFlags,
- /* isMipped = */ false);
+ /* isMipped = */ false,
+ SkDestinationSurfaceColorMode::kLegacy);
if (!surf) {
return nullptr;
}
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp
index a9abb16ea9..b22d0aaa4c 100644
--- a/src/gpu/GrSurfaceProxy.cpp
+++ b/src/gpu/GrSurfaceProxy.cpp
@@ -40,7 +40,8 @@ GrSurfaceProxy::~GrSurfaceProxy() {
}
GrSurface* GrSurfaceProxy::instantiateImpl(GrResourceProvider* resourceProvider, int sampleCnt,
- GrSurfaceFlags flags, bool isMipMapped) {
+ GrSurfaceFlags flags, bool isMipMapped,
+ SkDestinationSurfaceColorMode mipColorMode) {
if (fTarget) {
return fTarget;
}
@@ -62,7 +63,7 @@ GrSurface* GrSurfaceProxy::instantiateImpl(GrResourceProvider* resourceProvider,
return nullptr;
}
- fTarget->asTexture()->texturePriv().setMipColorMode(fMipColorMode);
+ fTarget->asTexture()->texturePriv().setMipColorMode(mipColorMode);
this->INHERITED::transferRefs();
#ifdef SK_DEBUG
diff --git a/src/gpu/GrTextureProxy.cpp b/src/gpu/GrTextureProxy.cpp
index 7ecd50bee8..79281640cd 100644
--- a/src/gpu/GrTextureProxy.cpp
+++ b/src/gpu/GrTextureProxy.cpp
@@ -13,17 +13,20 @@
GrTextureProxy::GrTextureProxy(const GrSurfaceDesc& srcDesc, SkBackingFit fit, SkBudgeted budgeted,
const void* srcData, size_t /*rowBytes*/, uint32_t flags)
: INHERITED(srcDesc, fit, budgeted, flags)
- , fIsMipMapped(srcDesc.fIsMipMapped) {
+ , fIsMipMapped(srcDesc.fIsMipMapped)
+ , fMipColorMode(SkDestinationSurfaceColorMode::kLegacy) {
SkASSERT(!srcData); // currently handled in Make()
}
GrTextureProxy::GrTextureProxy(sk_sp<GrSurface> surf)
: INHERITED(std::move(surf), SkBackingFit::kExact)
- , fIsMipMapped(fTarget->asTexture()->texturePriv().hasMipMaps()) {}
+ , fIsMipMapped(fTarget->asTexture()->texturePriv().hasMipMaps())
+ , fMipColorMode(fTarget->asTexture()->texturePriv().mipColorMode()) {}
GrSurface* GrTextureProxy::instantiate(GrResourceProvider* resourceProvider) {
GrSurface* surf =
- this->instantiateImpl(resourceProvider, 0, kNone_GrSurfaceFlags, fIsMipMapped);
+ this->instantiateImpl(resourceProvider, 0, kNone_GrSurfaceFlags, fIsMipMapped,
+ fMipColorMode);
if (!surf) {
return nullptr;
}
diff --git a/src/gpu/GrTextureRenderTargetProxy.cpp b/src/gpu/GrTextureRenderTargetProxy.cpp
index 4f1c420830..7058c83afc 100644
--- a/src/gpu/GrTextureRenderTargetProxy.cpp
+++ b/src/gpu/GrTextureRenderTargetProxy.cpp
@@ -48,7 +48,7 @@ GrSurface* GrTextureRenderTargetProxy::instantiate(GrResourceProvider* resourceP
static constexpr GrSurfaceFlags kFlags = kRenderTarget_GrSurfaceFlag;
GrSurface* surf = this->instantiateImpl(resourceProvider, this->numStencilSamples(), kFlags,
- this->isMipMapped());
+ this->isMipMapped(), this->mipColorMode());
if (!surf) {
return nullptr;
}