Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(855)

Unified Diff: src/gpu/GrRenderTarget.cpp

Issue 1406173003: Loosen requirement that there be only one GrDrawTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix comment Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrRenderTarget.cpp
diff --git a/src/gpu/GrRenderTarget.cpp b/src/gpu/GrRenderTarget.cpp
index e81a9cfd8382700485dc6f98463d9301b81e6e79..ad56cf761fff6e62afc5380d2532d9c82af48708 100644
--- a/src/gpu/GrRenderTarget.cpp
+++ b/src/gpu/GrRenderTarget.cpp
@@ -11,6 +11,7 @@
#include "GrContext.h"
#include "GrDrawContext.h"
+#include "GrDrawTarget.h"
#include "GrGpu.h"
#include "GrRenderTargetPriv.h"
#include "GrStencilAttachment.h"
@@ -56,16 +57,26 @@ void GrRenderTarget::overrideResolveRect(const SkIRect rect) {
void GrRenderTarget::onRelease() {
SkSafeSetNull(fStencilAttachment);
+ fLastDrawTarget = nullptr;
INHERITED::onRelease();
}
void GrRenderTarget::onAbandon() {
SkSafeSetNull(fStencilAttachment);
+ fLastDrawTarget = nullptr;
INHERITED::onAbandon();
}
+void GrRenderTarget::setLastDrawTarget(GrDrawTarget* dt) {
+ if (fLastDrawTarget) {
+ SkASSERT(fLastDrawTarget->isClosed());
+ }
+
+ fLastDrawTarget = dt;
+}
+
///////////////////////////////////////////////////////////////////////////////
bool GrRenderTargetPriv::attachStencilAttachment(GrStencilAttachment* stencil) {
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698