| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "GrSurface.h" | 8 #include "GrSurface.h" |
| 9 #include "GrSurfacePriv.h" | 9 #include "GrSurfacePriv.h" |
| 10 | 10 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 const GrTexture* thisTex = this->asTexture(); | 116 const GrTexture* thisTex = this->asTexture(); |
| 117 if (thisTex && thisTex->internalHasPendingIO()) { | 117 if (thisTex && thisTex->internalHasPendingIO()) { |
| 118 return true; | 118 return true; |
| 119 } | 119 } |
| 120 const GrRenderTarget* thisRT = this->asRenderTarget(); | 120 const GrRenderTarget* thisRT = this->asRenderTarget(); |
| 121 if (thisRT && thisRT->internalHasPendingIO()) { | 121 if (thisRT && thisRT->internalHasPendingIO()) { |
| 122 return true; | 122 return true; |
| 123 } | 123 } |
| 124 return false; | 124 return false; |
| 125 } | 125 } |
| 126 | |
| 127 bool GrSurface::isSameAs(const GrSurface* other) const { | |
| 128 const GrRenderTarget* thisRT = this->asRenderTarget(); | |
| 129 if (thisRT) { | |
| 130 return thisRT == other->asRenderTarget(); | |
| 131 } else { | |
| 132 const GrTexture* thisTex = this->asTexture(); | |
| 133 SkASSERT(thisTex); // We must be one or the other | |
| 134 return thisTex == other->asTexture(); | |
| 135 } | |
| 136 } | |
| OLD | NEW |