aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ProxyTest.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2016-11-17 14:43:51 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-17 20:47:18 +0000
commitb4460886905cc3b86987c6366a9721de77101111 (patch)
tree56d347bd093771a903a06e91cc697ee9621884e6 /tests/ProxyTest.cpp
parent684d7cef02121a42e217c0f63bdb4799d9ae4b53 (diff)
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>
Diffstat (limited to 'tests/ProxyTest.cpp')
-rw-r--r--tests/ProxyTest.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ProxyTest.cpp b/tests/ProxyTest.cpp
index 8d59cae2bf..a228e166e5 100644
--- a/tests/ProxyTest.cpp
+++ b/tests/ProxyTest.cpp
@@ -136,6 +136,13 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DeferredProxyTest, reporter, ctxInfo) {
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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DeferredProxyTest, reporter, ctxInfo) {
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);