Store GrRenderTarget rather than just its ID in GrRenderTargetOpList::RecordedOp.
This will allow us to feed the op's their render target when they don't have a pipeline before execution.
Change-Id: I01f16bec32e930c0152105a9179306159cb14dc4
Reviewed-on: https://skia-review.googlesource.com/8693
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/tests/ProxyRefTest.cpp b/tests/ProxyRefTest.cpp
index c285721..6cd4cb0 100644
--- a/tests/ProxyRefTest.cpp
+++ b/tests/ProxyRefTest.cpp
@@ -93,6 +93,8 @@
GrTextureProvider* provider = ctxInfo.grContext()->textureProvider();
const GrCaps& caps = *ctxInfo.grContext()->caps();
+ // Currently the op itself takes a pending write and the render target op list does as well.
+ static const int kWritesForDiscard = 2;
for (auto make : { make_deferred, make_wrapped }) {
// A single write
{
@@ -106,7 +108,7 @@
// extra ref and write
bool proxyGetsDiscardRef = !sProxy->isWrapped_ForTesting() &&
caps.discardRenderTargetSupport();
- int expectedWrites = proxyGetsDiscardRef ? 2 : 1;
+ int expectedWrites = 1 + (proxyGetsDiscardRef ? kWritesForDiscard : 0);
sProxy->instantiate(provider);
@@ -126,7 +128,7 @@
// extra ref and write
bool proxyGetsDiscardRef = !sProxy->isWrapped_ForTesting() &&
caps.discardRenderTargetSupport();
- int expectedWrites = proxyGetsDiscardRef ? 1 : 0;
+ int expectedWrites = proxyGetsDiscardRef ? kWritesForDiscard : 0;
sProxy->instantiate(provider);
@@ -146,7 +148,7 @@
// extra ref and write
bool proxyGetsDiscardRef = !sProxy->isWrapped_ForTesting() &&
caps.discardRenderTargetSupport();
- int expectedWrites = proxyGetsDiscardRef ? 2 : 1;
+ int expectedWrites = 1 + (proxyGetsDiscardRef ? kWritesForDiscard : 0);
sProxy->instantiate(provider);
@@ -164,7 +166,7 @@
bool proxyGetsDiscardRef = !sProxy->isWrapped_ForTesting() &&
caps.discardRenderTargetSupport();
- int expectedWrites = proxyGetsDiscardRef ? 1 : 0;
+ int expectedWrites = proxyGetsDiscardRef ? kWritesForDiscard : 0;
sProxy->instantiate(provider);
@@ -186,7 +188,7 @@
bool proxyGetsDiscardRef = !sProxy->isWrapped_ForTesting() &&
caps.discardRenderTargetSupport();
- int expectedWrites = proxyGetsDiscardRef ? 2 : 1;
+ int expectedWrites = 1 + (proxyGetsDiscardRef ? kWritesForDiscard : 0);
sProxy->instantiate(provider);