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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 return true; | 76 return true; |
77 } | 77 } |
78 | 78 |
79 void GrSurface::flushWrites() { | 79 void GrSurface::flushWrites() { |
80 if (!this->wasDestroyed()) { | 80 if (!this->wasDestroyed()) { |
81 this->getContext()->flushSurfaceWrites(this); | 81 this->getContext()->flushSurfaceWrites(this); |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
| 85 void GrSurface::prepareForExternalRead() { |
| 86 if (!this->wasDestroyed()) { |
| 87 this->getContext()->prepareSurfaceForExternalRead(this); |
| 88 } |
| 89 } |
| 90 |
85 bool GrSurface::hasPendingRead() const { | 91 bool GrSurface::hasPendingRead() const { |
86 const GrTexture* thisTex = this->asTexture(); | 92 const GrTexture* thisTex = this->asTexture(); |
87 if (thisTex && thisTex->internalHasPendingRead()) { | 93 if (thisTex && thisTex->internalHasPendingRead()) { |
88 return true; | 94 return true; |
89 } | 95 } |
90 const GrRenderTarget* thisRT = this->asRenderTarget(); | 96 const GrRenderTarget* thisRT = this->asRenderTarget(); |
91 if (thisRT && thisRT->internalHasPendingRead()) { | 97 if (thisRT && thisRT->internalHasPendingRead()) { |
92 return true; | 98 return true; |
93 } | 99 } |
94 return false; | 100 return false; |
(...skipping 26 matching lines...) Expand all Loading... |
121 bool GrSurface::isSameAs(const GrSurface* other) const { | 127 bool GrSurface::isSameAs(const GrSurface* other) const { |
122 const GrRenderTarget* thisRT = this->asRenderTarget(); | 128 const GrRenderTarget* thisRT = this->asRenderTarget(); |
123 if (thisRT) { | 129 if (thisRT) { |
124 return thisRT == other->asRenderTarget(); | 130 return thisRT == other->asRenderTarget(); |
125 } else { | 131 } else { |
126 const GrTexture* thisTex = this->asTexture(); | 132 const GrTexture* thisTex = this->asTexture(); |
127 SkASSERT(thisTex); // We must be one or the other | 133 SkASSERT(thisTex); // We must be one or the other |
128 return thisTex == other->asTexture(); | 134 return thisTex == other->asTexture(); |
129 } | 135 } |
130 } | 136 } |
OLD | NEW |