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>
This commit is contained in:
parent
fdcfb8b7c2
commit
db3b979ba1
@ -461,6 +461,7 @@ public:
|
||||
0 == subset->fLeft && 0 == subset->fTop &&
|
||||
fTextureProxy->width() == subset->width() &&
|
||||
fTextureProxy->height() == subset->height()) {
|
||||
fTextureProxy->priv().exactify();
|
||||
// The existing GrTexture is already tight so reuse it in the SkImage
|
||||
return wrap_proxy_in_image(fContext, fTextureProxy, fAlphaType, fColorSpace);
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user