Fix computation of texture size for approximately-fit deferred proxies
For approximate-fit deferred proxies asserts were firing when the instantiated size was larger than the pre-computed exact-fit size.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4972
Change-Id: I879e16b86ab4d9ef9834163c24ccd6507fe4b94a
Reviewed-on: https://skia-review.googlesource.com/4972
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/tests/ProxyTest.cpp b/tests/ProxyTest.cpp
index 8d59cae..a228e16 100644
--- a/tests/ProxyTest.cpp
+++ b/tests/ProxyTest.cpp
@@ -136,6 +136,13 @@
sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeDeferred(
caps, desc,
fit, budgeted));
+ // This forces the proxy to compute and cache its pre-instantiation
+ // size guess. Later, when it is actually instantiated, it checks
+ // that the instantiated size is <= to the pre-computation.
+ // If the proxy never computed its pre-instantiation size then the
+ // check is skipped.
+ sProxy->gpuMemorySize();
+
check_surface(reporter, sProxy.get(), origin,
widthHeight, widthHeight, config,
kInvalidResourceID, budgeted);
@@ -151,6 +158,13 @@
desc,
fit,
budgeted));
+ // This forces the proxy to compute and cache its pre-instantiation
+ // size guess. Later, when it is actually instantiated, it checks
+ // that the instantiated size is <= to the pre-computation.
+ // If the proxy never computed its pre-instantiation size then the
+ // check is skipped.
+ sProxy->gpuMemorySize();
+
check_surface(reporter, sProxy.get(), origin,
widthHeight, widthHeight, config,
kInvalidResourceID, budgeted);