aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrProxyProvider.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-02-09 16:08:30 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-10 01:22:11 +0000
commit308150821517a4dc73e43db1022d3e8bd589d2db (patch)
tree1f2f2ffe45959de562eaeeda8033bde3779e9bdb /src/gpu/GrProxyProvider.cpp
parentdfb3a169605dc340658070fbeb3c5490c7f3ded6 (diff)
Remove unused code resulted from deleting DeferredTextureImage
Bug: skia: Change-Id: Iaedc09880bd6a2d8fda4ce52f1644a944dd72605 Reviewed-on: https://skia-review.googlesource.com/106266 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/GrProxyProvider.cpp')
-rw-r--r--src/gpu/GrProxyProvider.cpp61
1 files changed, 12 insertions, 49 deletions
diff --git a/src/gpu/GrProxyProvider.cpp b/src/gpu/GrProxyProvider.cpp
index dd2a1b7e13..e000dd4979 100644
--- a/src/gpu/GrProxyProvider.cpp
+++ b/src/gpu/GrProxyProvider.cpp
@@ -244,51 +244,31 @@ sk_sp<GrTextureProxy> GrProxyProvider::createTextureProxy(sk_sp<SkImage> srcImag
return proxy;
}
-sk_sp<GrTextureProxy> GrProxyProvider::createMipMapProxy(
- const GrSurfaceDesc& desc, SkBudgeted budgeted,
- const GrMipLevel texels[], int mipLevelCount,
- SkDestinationSurfaceColorMode mipColorMode) {
+sk_sp<GrTextureProxy> GrProxyProvider::createMipMapProxy(const GrSurfaceDesc& desc,
+ SkBudgeted budgeted) {
ASSERT_SINGLE_OWNER
if (this->isAbandoned()) {
return nullptr;
}
- if (!mipLevelCount) {
- if (texels) {
- return nullptr;
- }
+ // SkMipMap doesn't include the base level in the level count so we have to add 1
+ int mipCount = SkMipMap::ComputeLevelCount(desc.fWidth, desc.fHeight) + 1;
+ if (1 == mipCount) {
return this->createProxy(desc, SkBackingFit::kExact, budgeted);
}
- if (!texels) {
- return nullptr;
- }
- if (1 == mipLevelCount) {
- return this->createTextureProxy(desc, budgeted, texels[0].fPixels, texels[0].fRowBytes);
- }
+ std::unique_ptr<GrMipLevel[]> texels(new GrMipLevel[mipCount]);
-#ifdef SK_DEBUG
- // There are only three states we want to be in when uploading data to a mipped surface.
- // 1) We have data to upload to all layers
- // 2) We are not uploading data to any layers
- // 3) We are only uploading data to the base layer
- // We check here to make sure we do not have any other state.
- bool firstLevelHasData = SkToBool(texels[0].fPixels);
- bool allOtherLevelsHaveData = true, allOtherLevelsLackData = true;
- for (int i = 1; i < mipLevelCount; ++i) {
- if (texels[i].fPixels) {
- allOtherLevelsLackData = false;
- } else {
- allOtherLevelsHaveData = false;
- }
+ // We don't want to upload any texel data
+ for (int i = 0; i < mipCount; i++) {
+ texels[i].fPixels = nullptr;
+ texels[i].fRowBytes = 0;
}
- SkASSERT((firstLevelHasData && allOtherLevelsHaveData) || allOtherLevelsLackData);
-#endif
sk_sp<GrTexture> tex(fResourceProvider->createTexture(desc, budgeted,
- texels, mipLevelCount,
- mipColorMode));
+ texels.get(), mipCount,
+ SkDestinationSurfaceColorMode::kLegacy));
if (!tex) {
return nullptr;
}
@@ -296,23 +276,6 @@ sk_sp<GrTextureProxy> GrProxyProvider::createMipMapProxy(
return this->createWrapped(std::move(tex), desc.fOrigin);
}
-sk_sp<GrTextureProxy> GrProxyProvider::createMipMapProxy(const GrSurfaceDesc& desc,
- SkBudgeted budgeted) {
- // SkMipMap doesn't include the base level in the level count so we have to add 1
- int mipCount = SkMipMap::ComputeLevelCount(desc.fWidth, desc.fHeight) + 1;
-
- std::unique_ptr<GrMipLevel[]> texels(new GrMipLevel[mipCount]);
-
- // We don't want to upload any texel data
- for (int i = 0; i < mipCount; i++) {
- texels[i].fPixels = nullptr;
- texels[i].fRowBytes = 0;
- }
-
- return this->createMipMapProxy(desc, budgeted, texels.get(), mipCount,
- SkDestinationSurfaceColorMode::kLegacy);
-}
-
sk_sp<GrTextureProxy> GrProxyProvider::createMipMapProxyFromBitmap(const SkBitmap& bitmap,
SkColorSpace* dstColorSpace) {
SkDestinationSurfaceColorMode mipColorMode = dstColorSpace