diff options
author | 2018-06-12 15:18:00 -0400 | |
---|---|---|
committer | 2018-06-13 13:50:36 +0000 | |
commit | db3b979ba18e11052c4f88856dacc0bb7799525a (patch) | |
tree | 87ba9d297568f6ff3676935d4ffa5a6b4766a237 /src/gpu/GrProxyProvider.cpp | |
parent | fdcfb8b7c23fbf18f872d2c31d27978235033876 (diff) |
Fix IsFunctionallyExact
Bug: 849034
Change-Id: Icfef534433495e5ad5ab1f3abad05957a0e70a31
Reviewed-on: https://skia-review.googlesource.com/134333
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrProxyProvider.cpp')
-rw-r--r-- | src/gpu/GrProxyProvider.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gpu/GrProxyProvider.cpp b/src/gpu/GrProxyProvider.cpp index a2b97d173a..a1f14df3e9 100644 --- a/src/gpu/GrProxyProvider.cpp +++ b/src/gpu/GrProxyProvider.cpp @@ -625,7 +625,15 @@ sk_sp<GrTextureProxy> GrProxyProvider::createFullyLazyProxy(LazyInstantiateCallb } bool GrProxyProvider::IsFunctionallyExact(GrSurfaceProxy* proxy) { - return proxy->priv().isExact() || (SkIsPow2(proxy->width()) && SkIsPow2(proxy->height())); + const bool isInstantiated = proxy->priv().isInstantiated(); + // A proxy is functionally exact if: + // it is exact (obvs) + // when it is instantiated it will be exact (i.e., power of two dimensions) + // it is already instantiated and the proxy covers the entire backing surface + return proxy->priv().isExact() || + (!isInstantiated && SkIsPow2(proxy->width()) && SkIsPow2(proxy->height())) || + (isInstantiated && proxy->worstCaseWidth() == proxy->width() && + proxy->worstCaseHeight() == proxy->height()); } void GrProxyProvider::processInvalidProxyUniqueKey(const GrUniqueKey& key) { |