| OLD | NEW |
| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 void GrRenderTarget::onAbandon() { | 65 void GrRenderTarget::onAbandon() { |
| 66 SkSafeSetNull(fStencilAttachment); | 66 SkSafeSetNull(fStencilAttachment); |
| 67 fLastDrawTarget = nullptr; | 67 fLastDrawTarget = nullptr; |
| 68 | 68 |
| 69 INHERITED::onAbandon(); | 69 INHERITED::onAbandon(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void GrRenderTarget::setLastDrawTarget(GrDrawTarget* dt) { | 72 void GrRenderTarget::setLastDrawTarget(GrDrawTarget* dt) { |
| 73 if (fLastDrawTarget) { | 73 if (fLastDrawTarget) { |
| 74 // The non-MDB world never closes so we can't check this condition | |
| 75 #ifdef ENABLE_MDB | |
| 76 SkASSERT(fLastDrawTarget->isClosed()); | 74 SkASSERT(fLastDrawTarget->isClosed()); |
| 77 #endif | |
| 78 } | 75 } |
| 79 | 76 |
| 80 fLastDrawTarget = dt; | 77 fLastDrawTarget = dt; |
| 81 } | 78 } |
| 82 | 79 |
| 83 /////////////////////////////////////////////////////////////////////////////// | 80 /////////////////////////////////////////////////////////////////////////////// |
| 84 | 81 |
| 85 bool GrRenderTargetPriv::attachStencilAttachment(GrStencilAttachment* stencil) { | 82 bool GrRenderTargetPriv::attachStencilAttachment(GrStencilAttachment* stencil) { |
| 86 if (!stencil && !fRenderTarget->fStencilAttachment) { | 83 if (!stencil && !fRenderTarget->fStencilAttachment) { |
| 87 // No need to do any work since we currently don't have a stencil attach
ment and | 84 // No need to do any work since we currently don't have a stencil attach
ment and |
| 88 // we're not acctually adding one. | 85 // we're not acctually adding one. |
| 89 return true; | 86 return true; |
| 90 } | 87 } |
| 91 fRenderTarget->fStencilAttachment = stencil; | 88 fRenderTarget->fStencilAttachment = stencil; |
| 92 if (!fRenderTarget->completeStencilAttachment()) { | 89 if (!fRenderTarget->completeStencilAttachment()) { |
| 93 SkSafeSetNull(fRenderTarget->fStencilAttachment); | 90 SkSafeSetNull(fRenderTarget->fStencilAttachment); |
| 94 return false; | 91 return false; |
| 95 } | 92 } |
| 96 return true; | 93 return true; |
| 97 } | 94 } |
| OLD | NEW |