aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-10-24 09:17:00 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-24 13:33:51 +0000
commit027815fb7815d960a494d1eee38cf67da9b415cb (patch)
treefa9cac2aab84c516ddde7c0d000f7275771fe4e3
parent1ca6c51dd069cab8feef70fbf260bed8dc89f8da (diff)
Respect if texture proxy will have mips or not when computing size
Bug: skia: Change-Id: I47239ae68c103f29a8c8c2a2a5d8940c2c1d95fc Reviewed-on: https://skia-review.googlesource.com/63001 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
-rw-r--r--src/gpu/GrTextureProxy.cpp4
-rw-r--r--src/gpu/GrTextureRenderTargetProxy.cpp5
2 files changed, 2 insertions, 7 deletions
diff --git a/src/gpu/GrTextureProxy.cpp b/src/gpu/GrTextureProxy.cpp
index 4617285b1c..9afa63f374 100644
--- a/src/gpu/GrTextureProxy.cpp
+++ b/src/gpu/GrTextureProxy.cpp
@@ -109,9 +109,7 @@ GrSamplerState::Filter GrTextureProxy::highestFilterMode() const {
}
size_t GrTextureProxy::onUninstantiatedGpuMemorySize() const {
- // TODO: add tracking of mipmap state to improve the estimate. We track whether we are created
- // with mip maps but not whether a texture read from the proxy will lazily generate mip maps.
- return GrSurface::ComputeSize(fConfig, fWidth, fHeight, 1, GrMipMapped::kYes,
+ return GrSurface::ComputeSize(fConfig, fWidth, fHeight, 1, this->mipMapped(),
SkBackingFit::kApprox == fFit);
}
diff --git a/src/gpu/GrTextureRenderTargetProxy.cpp b/src/gpu/GrTextureRenderTargetProxy.cpp
index 7d4040e3f1..dd79bfefff 100644
--- a/src/gpu/GrTextureRenderTargetProxy.cpp
+++ b/src/gpu/GrTextureRenderTargetProxy.cpp
@@ -36,11 +36,8 @@ GrTextureRenderTargetProxy::GrTextureRenderTargetProxy(sk_sp<GrSurface> surf,
size_t GrTextureRenderTargetProxy::onUninstantiatedGpuMemorySize() const {
int colorSamplesPerPixel = this->numColorSamples() + 1;
- // TODO: add tracking of mipmap state to improve the estimate. We track whether we are created
- // with mip maps but not whether a texture read from the proxy will lazily generate mip maps.
-
// TODO: do we have enough information to improve this worst case estimate?
- return GrSurface::ComputeSize(fConfig, fWidth, fHeight, colorSamplesPerPixel, GrMipMapped::kYes,
+ return GrSurface::ComputeSize(fConfig, fWidth, fHeight, colorSamplesPerPixel, this->mipMapped(),
SkBackingFit::kApprox == fFit);
}