| 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 9 #include "SkBitmapCache.h" | 9 #include "SkBitmapCache.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 } | 162 } |
| 163 return as_IB(this)->onNewSubset(subset); | 163 return as_IB(this)->onNewSubset(subset); |
| 164 } | 164 } |
| 165 | 165 |
| 166 #if SK_SUPPORT_GPU | 166 #if SK_SUPPORT_GPU |
| 167 | 167 |
| 168 GrTexture* SkImage::getTexture() const { | 168 GrTexture* SkImage::getTexture() const { |
| 169 return as_IB(this)->peekTexture(); | 169 return as_IB(this)->peekTexture(); |
| 170 } | 170 } |
| 171 | 171 |
| 172 bool SkImage::isTextureBacked() const { return SkToBool(as_IB(this)->getTexture(
)); } | 172 bool SkImage::isTextureBacked() const { return SkToBool(as_IB(this)->peekTexture
()); } |
| 173 | 173 |
| 174 GrBackendObject SkImage::getTextureHandle(bool flushPendingGrContextIO) const { | 174 GrBackendObject SkImage::getTextureHandle(bool flushPendingGrContextIO) const { |
| 175 GrTexture* texture = as_IB(this)->getTexture(); | 175 GrTexture* texture = as_IB(this)->peekTexture(); |
| 176 if (texture) { | 176 if (texture) { |
| 177 GrContext* context = texture->getContext(); | 177 GrContext* context = texture->getContext(); |
| 178 if (context) { | 178 if (context) { |
| 179 if (flushPendingGrContextIO) { | 179 if (flushPendingGrContextIO) { |
| 180 context->prepareSurfaceForExternalIO(texture); | 180 context->prepareSurfaceForExternalIO(texture); |
| 181 } | 181 } |
| 182 } | 182 } |
| 183 return texture->getTextureHandle(); | 183 return texture->getTextureHandle(); |
| 184 } | 184 } |
| 185 return 0; | 185 return 0; |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 | 354 |
| 355 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk
AlphaType) { | 355 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk
AlphaType) { |
| 356 return nullptr; | 356 return nullptr; |
| 357 } | 357 } |
| 358 | 358 |
| 359 SkImage* SkImage::newTextureImage(GrContext*) const { | 359 SkImage* SkImage::newTextureImage(GrContext*) const { |
| 360 return nullptr; | 360 return nullptr; |
| 361 } | 361 } |
| 362 | 362 |
| 363 #endif | 363 #endif |
| OLD | NEW |