| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 void GrRenderTarget::onAbandon() { | 63 void GrRenderTarget::onAbandon() { |
| 64 SkSafeSetNull(fStencilAttachment); | 64 SkSafeSetNull(fStencilAttachment); |
| 65 | 65 |
| 66 INHERITED::onAbandon(); | 66 INHERITED::onAbandon(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 /////////////////////////////////////////////////////////////////////////////// | 69 /////////////////////////////////////////////////////////////////////////////// |
| 70 | 70 |
| 71 bool GrRenderTargetPriv::attachStencilAttachment(GrStencilAttachment* stencil) { | 71 bool GrRenderTargetPriv::attachStencilAttachment(GrStencilAttachment* stencil) { |
| 72 if (!stencil && !fRenderTarget->fStencilAttachment) { |
| 73 // No need to do any work since we currently don't have a stencil attach
ment and |
| 74 // we're not acctually adding one. |
| 75 return true; |
| 76 } |
| 72 fRenderTarget->fStencilAttachment = stencil; | 77 fRenderTarget->fStencilAttachment = stencil; |
| 73 if (!fRenderTarget->completeStencilAttachment()) { | 78 if (!fRenderTarget->completeStencilAttachment()) { |
| 74 SkSafeSetNull(fRenderTarget->fStencilAttachment); | 79 SkSafeSetNull(fRenderTarget->fStencilAttachment); |
| 75 return false; | 80 return false; |
| 76 } | 81 } |
| 77 return true; | 82 return true; |
| 78 } | 83 } |
| OLD | NEW |