aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ProxyTest.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-03-08 10:13:17 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-08 15:34:41 +0000
commitf7778979343998e4c10df8ebe43f02e60c700f0d (patch)
treed87e36994c7c74c1df49002bcb7d7b76b262c28a /tests/ProxyTest.cpp
parentc7c2baf0cf264b9d0d9c0f67cfb827a7e4a5e32c (diff)
Delazify wrapped backend textures/render target proxies
These methods will fail on DDL contexts. This is in preparation for removing the ability to specify origin for lazy proxies. Change-Id: Iadcedfd4fce8ea2590729c974128e5c58cec38a8 Reviewed-on: https://skia-review.googlesource.com/112802 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'tests/ProxyTest.cpp')
-rw-r--r--tests/ProxyTest.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/ProxyTest.cpp b/tests/ProxyTest.cpp
index 9d52281763..8f5eb13639 100644
--- a/tests/ProxyTest.cpp
+++ b/tests/ProxyTest.cpp
@@ -48,12 +48,17 @@ static void check_rendertarget(skiatest::Reporter* reporter,
REPORTER_ASSERT(reporter, rtProxy->numStencilSamples() == numSamples);
GrSurfaceProxy::UniqueID idBefore = rtProxy->uniqueID();
+ bool preinstantiated = rtProxy->priv().isInstantiated();
REPORTER_ASSERT(reporter, rtProxy->instantiate(provider));
GrRenderTarget* rt = rtProxy->priv().peekRenderTarget();
REPORTER_ASSERT(reporter, rtProxy->uniqueID() == idBefore);
// Deferred resources should always have a different ID from their instantiated rendertarget
- REPORTER_ASSERT(reporter, rtProxy->uniqueID().asUInt() != rt->uniqueID().asUInt());
+ if (preinstantiated) {
+ REPORTER_ASSERT(reporter, rtProxy->uniqueID().asUInt() == rt->uniqueID().asUInt());
+ } else {
+ REPORTER_ASSERT(reporter, rtProxy->uniqueID().asUInt() != rt->uniqueID().asUInt());
+ }
if (SkBackingFit::kExact == fit) {
REPORTER_ASSERT(reporter, rt->width() == rtProxy->width());
@@ -76,12 +81,17 @@ static void check_texture(skiatest::Reporter* reporter,
SkBackingFit fit) {
GrSurfaceProxy::UniqueID idBefore = texProxy->uniqueID();
+ bool preinstantiated = texProxy->priv().isInstantiated();
REPORTER_ASSERT(reporter, texProxy->instantiate(provider));
GrTexture* tex = texProxy->priv().peekTexture();
REPORTER_ASSERT(reporter, texProxy->uniqueID() == idBefore);
// Deferred resources should always have a different ID from their instantiated texture
- REPORTER_ASSERT(reporter, texProxy->uniqueID().asUInt() != tex->uniqueID().asUInt());
+ if (preinstantiated) {
+ REPORTER_ASSERT(reporter, texProxy->uniqueID().asUInt() == tex->uniqueID().asUInt());
+ } else {
+ REPORTER_ASSERT(reporter, texProxy->uniqueID().asUInt() != tex->uniqueID().asUInt());
+ }
if (SkBackingFit::kExact == fit) {
REPORTER_ASSERT(reporter, tex->width() == texProxy->width());