aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-09-25 12:27:44 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-26 18:17:37 +0000
commite2d76d5ffea9e0fed2970d7b54d77b91d4b358de (patch)
tree19b966ae91bbb97d97b812ae6641c3f77a7ba27a
parent9b89bcae4088b174480795ef16e321c6c74e85ae (diff)
Remove fIsMipMapped from GrSurfaceDesc
Part 3 of 3 for relanding of https://skia-review.googlesource.com/c/skia/+/42083 Bug: skia: Change-Id: I98c5406015213df5d11a0101df8722da6845157e Reviewed-on: https://skia-review.googlesource.com/44464 Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
-rw-r--r--include/gpu/GrTypes.h4
-rw-r--r--src/effects/SkBlurMaskFilter.cpp1
-rw-r--r--src/gpu/GrBackendTextureImageGenerator.cpp1
-rw-r--r--src/gpu/GrResourceProvider.cpp4
-rw-r--r--src/gpu/GrSurfaceProxy.cpp4
-rw-r--r--src/gpu/GrTexture.cpp3
-rw-r--r--src/gpu/GrTextureProxy.cpp3
-rw-r--r--src/gpu/SkGr.cpp3
-rw-r--r--tests/GrSurfaceTest.cpp3
-rw-r--r--tests/IntTextureTest.cpp3
-rw-r--r--tests/ResourceCacheTest.cpp1
11 files changed, 4 insertions, 26 deletions
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h
index 6ba9ffe429..606fc00cb3 100644
--- a/include/gpu/GrTypes.h
+++ b/include/gpu/GrTypes.h
@@ -594,8 +594,7 @@ struct GrSurfaceDesc {
, fWidth(0)
, fHeight(0)
, fConfig(kUnknown_GrPixelConfig)
- , fSampleCnt(0)
- , fIsMipMapped(false) {
+ , fSampleCnt(0) {
}
GrSurfaceFlags fFlags; //!< bitfield of TextureFlags
@@ -617,7 +616,6 @@ struct GrSurfaceDesc {
* max supported count.
*/
int fSampleCnt;
- bool fIsMipMapped; //!< Indicates if the texture has mipmaps
};
/**
diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp
index 4ee1f6bc78..242b398db2 100644
--- a/src/effects/SkBlurMaskFilter.cpp
+++ b/src/effects/SkBlurMaskFilter.cpp
@@ -955,7 +955,6 @@ sk_sp<GrTextureProxy> GrRectBlurEffect::CreateBlurProfileTexture(
texDesc.fWidth = profileSize;
texDesc.fHeight = 1;
texDesc.fConfig = kAlpha_8_GrPixelConfig;
- texDesc.fIsMipMapped = false;
std::unique_ptr<uint8_t[]> profile(SkBlurMask::ComputeBlurProfile(sigma));
diff --git a/src/gpu/GrBackendTextureImageGenerator.cpp b/src/gpu/GrBackendTextureImageGenerator.cpp
index ef391c8f0c..cedc60cc5b 100644
--- a/src/gpu/GrBackendTextureImageGenerator.cpp
+++ b/src/gpu/GrBackendTextureImageGenerator.cpp
@@ -186,7 +186,6 @@ sk_sp<GrTextureProxy> GrBackendTextureImageGenerator::onGenerateTexture(
// the subregion into the base layer and then let the GPU generate the rest of the mip
// levels.
SkASSERT(!proxy->isMipMapped());
- desc.fIsMipMapped = false;
sk_sp<GrSurfaceContext> sContext(context->contextPriv().makeDeferredSurfaceContext(
desc, SkBackingFit::kExact, SkBudgeted::kYes));
diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp
index 16fe0c359d..6ab8e19f73 100644
--- a/src/gpu/GrResourceProvider.cpp
+++ b/src/gpu/GrResourceProvider.cpp
@@ -78,7 +78,6 @@ sk_sp<GrTexture> GrResourceProvider::createTexture(const GrSurfaceDesc& desc, Sk
ASSERT_SINGLE_OWNER
SkASSERT(mipLevelCount > 1);
- SkASSERT(desc.fIsMipMapped);
if (this->isAbandoned()) {
return nullptr;
@@ -98,7 +97,6 @@ sk_sp<GrTexture> GrResourceProvider::createTexture(const GrSurfaceDesc& desc, Sk
sk_sp<GrTexture> GrResourceProvider::getExactScratch(const GrSurfaceDesc& desc,
SkBudgeted budgeted, uint32_t flags) {
- SkASSERT(!desc.fIsMipMapped);
sk_sp<GrTexture> tex(this->refScratchTexture(desc, flags));
if (tex && SkBudgeted::kNo == budgeted) {
tex->resourcePriv().makeUnbudgeted();
@@ -121,7 +119,6 @@ sk_sp<GrTextureProxy> GrResourceProvider::createTextureProxy(const GrSurfaceDesc
SkBudgeted budgeted,
const GrMipLevel& mipLevel) {
ASSERT_SINGLE_OWNER
- SkASSERT(!desc.fIsMipMapped);
if (this->isAbandoned()) {
return nullptr;
@@ -181,7 +178,6 @@ sk_sp<GrTexture> GrResourceProvider::createApproxTexture(const GrSurfaceDesc& de
uint32_t flags) {
ASSERT_SINGLE_OWNER
SkASSERT(0 == flags || kNoPendingIO_Flag == flags);
- SkASSERT(!desc.fIsMipMapped);
if (this->isAbandoned()) {
return nullptr;
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp
index bcb9ad4931..478982961c 100644
--- a/src/gpu/GrSurfaceProxy.cpp
+++ b/src/gpu/GrSurfaceProxy.cpp
@@ -63,7 +63,7 @@ sk_sp<GrSurface> GrSurfaceProxy::createSurfaceImpl(
int sampleCnt, bool needsStencil,
GrSurfaceFlags flags, bool isMipMapped,
SkDestinationSurfaceColorMode mipColorMode) const {
-
+ SkASSERT(!isMipMapped);
GrSurfaceDesc desc;
desc.fFlags = flags;
if (fNeedsClear) {
@@ -74,8 +74,6 @@ sk_sp<GrSurface> GrSurfaceProxy::createSurfaceImpl(
desc.fHeight = fHeight;
desc.fConfig = fConfig;
desc.fSampleCnt = sampleCnt;
- SkASSERT(!isMipMapped);
- desc.fIsMipMapped = false;
sk_sp<GrSurface> surface;
if (SkBackingFit::kApprox == fFit) {
diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp
index f13e8505cb..361fd1a5f7 100644
--- a/src/gpu/GrTexture.cpp
+++ b/src/gpu/GrTexture.cpp
@@ -88,9 +88,8 @@ void GrTexturePriv::ComputeScratchKey(GrPixelConfig config, int width, int heigh
}
void GrTexturePriv::ComputeScratchKey(const GrSurfaceDesc& desc, GrScratchKey* key) {
- SkASSERT(!desc.fIsMipMapped);
// Note: the fOrigin field is not used in the scratch key
return ComputeScratchKey(desc.fConfig, desc.fWidth, desc.fHeight,
SkToBool(desc.fFlags & kRenderTarget_GrSurfaceFlag), desc.fSampleCnt,
- desc.fIsMipMapped, key);
+ false, key);
}
diff --git a/src/gpu/GrTextureProxy.cpp b/src/gpu/GrTextureProxy.cpp
index 9aeec8d2aa..8b9e58b594 100644
--- a/src/gpu/GrTextureProxy.cpp
+++ b/src/gpu/GrTextureProxy.cpp
@@ -15,11 +15,10 @@
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(false)
, fMipColorMode(SkDestinationSurfaceColorMode::kLegacy)
, fCache(nullptr) {
SkASSERT(!srcData); // currently handled in Make()
- SkASSERT(!fIsMipMapped);
}
GrTextureProxy::GrTextureProxy(sk_sp<GrSurface> surf, GrSurfaceOrigin origin)
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 7f956d67d2..5c26877101 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -197,9 +197,6 @@ sk_sp<GrTextureProxy> GrGenerateMipMapsAndUploadToTextureProxy(GrContext* ctx,
return nullptr;
}
- const bool isMipMapped = mipLevelCount > 1;
- desc.fIsMipMapped = isMipMapped;
-
std::unique_ptr<GrMipLevel[]> texels(new GrMipLevel[mipLevelCount]);
texels[0].fPixels = pmap->addr();
diff --git a/tests/GrSurfaceTest.cpp b/tests/GrSurfaceTest.cpp
index 7ead7cd971..8f5aa55685 100644
--- a/tests/GrSurfaceTest.cpp
+++ b/tests/GrSurfaceTest.cpp
@@ -125,7 +125,6 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(GrSurfaceRenderability, reporter, ctxInfo) {
texels[i].fPixels = pixelData.get();
texels[i].fRowBytes = rowBytes >> i;
}
- desc.fIsMipMapped = true;
sk_sp<GrTextureProxy> proxy = GrSurfaceProxy::MakeDeferredMipMap(resourceProvider,
desc, SkBudgeted::kNo,
texels.get(),
@@ -135,7 +134,6 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(GrSurfaceRenderability, reporter, ctxInfo) {
caps->mipMapSupport() &&
!GrPixelConfigIsSint(desc.fConfig)));
- desc.fIsMipMapped = false;
desc.fFlags = kRenderTarget_GrSurfaceFlag;
tex = resourceProvider->createTexture(desc, SkBudgeted::kNo);
REPORTER_ASSERT(reporter, SkToBool(tex.get()) == caps->isConfigRenderable(config, false));
@@ -168,7 +166,6 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(InitialTextureClear, reporter, context_info)
continue;
}
desc.fFlags |= rt ? kRenderTarget_GrSurfaceFlag : kNone_GrSurfaceFlags;
- desc.fIsMipMapped = false;
for (GrSurfaceOrigin origin :
{kTopLeft_GrSurfaceOrigin, kBottomLeft_GrSurfaceOrigin}) {
desc.fOrigin = origin;
diff --git a/tests/IntTextureTest.cpp b/tests/IntTextureTest.cpp
index 723d6b18b0..3baded97cb 100644
--- a/tests/IntTextureTest.cpp
+++ b/tests/IntTextureTest.cpp
@@ -66,8 +66,6 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(IntTexture, reporter, ctxInfo) {
levels[1].fPixels = testData.get();
levels[1].fRowBytes = (kS / 2) * sizeof(int32_t);
- desc.fIsMipMapped = true;
-
sk_sp<GrTextureProxy> temp(GrSurfaceProxy::MakeDeferredMipMap(context->resourceProvider(),
desc,
SkBudgeted::kYes,
@@ -75,7 +73,6 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(IntTexture, reporter, ctxInfo) {
REPORTER_ASSERT(reporter, !temp);
}
- desc.fIsMipMapped = false;
// Test that we can create an integer texture.
sk_sp<GrTextureProxy> proxy = GrSurfaceProxy::MakeDeferred(context->resourceProvider(),
desc, SkBudgeted::kYes,
diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp
index b636b9639d..af33f2d9bc 100644
--- a/tests/ResourceCacheTest.cpp
+++ b/tests/ResourceCacheTest.cpp
@@ -1668,7 +1668,6 @@ static sk_sp<GrTextureProxy> make_mipmap_proxy(GrResourceProvider* provider,
desc.fHeight = height;
desc.fConfig = kRGBA_8888_GrPixelConfig;
desc.fSampleCnt = sampleCnt;
- desc.fIsMipMapped = true;
return GrSurfaceProxy::MakeDeferredMipMap(provider, desc, SkBudgeted::kYes,
texels.get(), mipLevelCount);