aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrTextureProducer.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-10-06 15:59:27 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-06 20:28:00 +0000
commite1da1d9a7dfa6c9ebdcbd2845acebd045edd2a6f (patch)
tree9d7b53269a0b9d96a43358377d9906b774af3a29 /src/gpu/GrTextureProducer.cpp
parent567d6f4b4bd9ef50fa09c1449d6789ed701fc079 (diff)
Add option to create a deferred render target context with mips
We need this since we have texture generators that draw the base level but nothing more. Thus we want them to be able to directly draw into a pre allocated mipped target instead of doing a copy later. TBR: bsalomon@google.com Bug: skia: Change-Id: I1dfae0da7153b21b30fdfa51a7061fc255739a1e Reviewed-on: https://skia-review.googlesource.com/54100 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/GrTextureProducer.cpp')
-rw-r--r--src/gpu/GrTextureProducer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gpu/GrTextureProducer.cpp b/src/gpu/GrTextureProducer.cpp
index 91e196da12..2b9679a478 100644
--- a/src/gpu/GrTextureProducer.cpp
+++ b/src/gpu/GrTextureProducer.cpp
@@ -17,7 +17,8 @@
sk_sp<GrTextureProxy> GrTextureProducer::CopyOnGpu(GrContext* context,
sk_sp<GrTextureProxy> inputProxy,
const SkIRect* subset,
- const CopyParams& copyParams) {
+ const CopyParams& copyParams,
+ bool dstWillRequireMipMaps) {
SkASSERT(!subset || !subset->isEmpty());
SkASSERT(context);
@@ -25,7 +26,7 @@ sk_sp<GrTextureProxy> GrTextureProducer::CopyOnGpu(GrContext* context,
sk_sp<GrRenderTargetContext> copyRTC = context->makeDeferredRenderTargetContextWithFallback(
SkBackingFit::kExact, dstRect.width(), dstRect.height(), inputProxy->config(), nullptr,
- 0, inputProxy->origin());
+ 0, dstWillRequireMipMaps, inputProxy->origin());
if (!copyRTC) {
return nullptr;
}