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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "GrRenderTarget.h" 10 #include "GrRenderTarget.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 INHERITED::onAbandon(); 66 INHERITED::onAbandon();
67 } 67 }
68 68
69 /////////////////////////////////////////////////////////////////////////////// 69 ///////////////////////////////////////////////////////////////////////////////
70 70
71 void GrRenderTargetPriv::didAttachStencilAttachment(GrStencilAttachment* stencil Attachment) { 71 void GrRenderTargetPriv::didAttachStencilAttachment(GrStencilAttachment* stencil Attachment) {
72 SkRefCnt_SafeAssign(fRenderTarget->fStencilAttachment, stencilAttachment); 72 SkRefCnt_SafeAssign(fRenderTarget->fStencilAttachment, stencilAttachment);
73 } 73 }
74 74
75 GrStencilAttachment* GrRenderTargetPriv::attachStencilAttachment() const { 75 GrStencilAttachment* GrRenderTargetPriv::attachStencilAttachment() {
76 if (fRenderTarget->fStencilAttachment) { 76 if (fRenderTarget->fStencilAttachment) {
77 return fRenderTarget->fStencilAttachment; 77 return fRenderTarget->fStencilAttachment;
78 } 78 }
79 if (!fRenderTarget->wasDestroyed() && fRenderTarget->canAttemptStencilAttach ment()) { 79 if (!fRenderTarget->wasDestroyed() && fRenderTarget->canAttemptStencilAttach ment()) {
80 fRenderTarget->getGpu()->attachStencilAttachmentToRenderTarget(fRenderTa rget); 80 bool newStencil = fRenderTarget->getGpu()->getStencilAttachment(
81 fRenderTarget, &fRenderTarget->fStencilAttachment);
jvanverth1 2015/09/14 18:35:07 Indent to (, or at least further over.
82 if (!fRenderTarget->completeStencilAttachment()) {
83 SkSafeSetNull(fRenderTarget->fStencilAttachment);
84 } else {
85 if (newStencil) {
86 // Right now we're clearing the stencil attachment here after it is
87 // attached to an RT for the first time. When we start matching
88 // stencil buffers with smaller color targets this will no longe r
89 // be correct because it won't be guaranteed to clear the entire
90 // sb.
91 // We used to clear down in the GL subclass using a special purp ose
92 // FBO. But iOS doesn't allow a stencil-only FBO. It reports uns upported
93 // FBO status.
94 fRenderTarget->getGpu()->clearStencil(fRenderTarget);
95 }
96 }
81 } 97 }
82 return fRenderTarget->fStencilAttachment; 98 return fRenderTarget->fStencilAttachment;
83 } 99 }
100
OLDNEW
« no previous file with comments | « src/gpu/GrGpu.cpp ('k') | src/gpu/GrRenderTargetPriv.h » ('j') | src/gpu/gl/GrGLGpu.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698