aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
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 /src/gpu
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>
Diffstat (limited to 'src/gpu')
-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
6 files changed, 3 insertions, 15 deletions
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();