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

Unified Diff: src/gpu/GrRenderTarget.cpp

Issue 1333383002: Move some of the adding stencil attachment logic of Gpu and into Render Target. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: spelling Created 5 years, 3 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/GrGpu.cpp ('k') | src/gpu/GrRenderTargetPriv.h » ('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 5cb34e849aa1ed601fe908d7c201066aa554198d..c16738e795d8d1698609b5d9c64f2a0a323780f1 100644
--- a/src/gpu/GrRenderTarget.cpp
+++ b/src/gpu/GrRenderTarget.cpp
@@ -55,29 +55,24 @@ void GrRenderTarget::overrideResolveRect(const SkIRect rect) {
}
void GrRenderTarget::onRelease() {
- this->renderTargetPriv().didAttachStencilAttachment(nullptr);
+ SkSafeSetNull(fStencilAttachment);
INHERITED::onRelease();
}
void GrRenderTarget::onAbandon() {
- this->renderTargetPriv().didAttachStencilAttachment(nullptr);
+ SkSafeSetNull(fStencilAttachment);
INHERITED::onAbandon();
}
///////////////////////////////////////////////////////////////////////////////
-void GrRenderTargetPriv::didAttachStencilAttachment(GrStencilAttachment* stencilAttachment) {
- SkRefCnt_SafeAssign(fRenderTarget->fStencilAttachment, stencilAttachment);
-}
-
-GrStencilAttachment* GrRenderTargetPriv::attachStencilAttachment() const {
- if (fRenderTarget->fStencilAttachment) {
- return fRenderTarget->fStencilAttachment;
- }
- if (!fRenderTarget->wasDestroyed() && fRenderTarget->canAttemptStencilAttachment()) {
- fRenderTarget->getGpu()->attachStencilAttachmentToRenderTarget(fRenderTarget);
- }
- return fRenderTarget->fStencilAttachment;
+bool GrRenderTargetPriv::attachStencilAttachment(GrStencilAttachment* stencil) {
+ fRenderTarget->fStencilAttachment = stencil;
+ if (!fRenderTarget->completeStencilAttachment()) {
+ SkSafeSetNull(fRenderTarget->fStencilAttachment);
+ return false;
+ }
+ return true;
}
« no previous file with comments | « src/gpu/GrGpu.cpp ('k') | src/gpu/GrRenderTargetPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698