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 "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkData.h" | 10 #include "SkData.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 if (nullptr == subset && this->width() == newWidth && this->height() == newH
eight) { | 151 if (nullptr == subset && this->width() == newWidth && this->height() == newH
eight) { |
152 return SkRef(const_cast<SkImage*>(this)); | 152 return SkRef(const_cast<SkImage*>(this)); |
153 } | 153 } |
154 | 154 |
155 return as_IB(this)->onNewImage(newWidth, newHeight, subset, quality); | 155 return as_IB(this)->onNewImage(newWidth, newHeight, subset, quality); |
156 } | 156 } |
157 | 157 |
158 #if SK_SUPPORT_GPU | 158 #if SK_SUPPORT_GPU |
159 | 159 |
160 GrTexture* SkImage::getTexture() const { | 160 GrTexture* SkImage::getTexture() const { |
161 return as_IB(this)->getTexture(); | 161 return as_IB(this)->peekTexture(); |
162 } | 162 } |
163 | 163 |
164 bool SkImage::isTextureBacked() const { return SkToBool(as_IB(this)->getTexture(
)); } | 164 bool SkImage::isTextureBacked() const { return SkToBool(as_IB(this)->getTexture(
)); } |
165 | 165 |
166 GrBackendObject SkImage::getTextureHandle(bool flushPendingGrContextIO) const { | 166 GrBackendObject SkImage::getTextureHandle(bool flushPendingGrContextIO) const { |
167 GrTexture* texture = as_IB(this)->getTexture(); | 167 GrTexture* texture = as_IB(this)->getTexture(); |
168 if (texture) { | 168 if (texture) { |
169 GrContext* context = texture->getContext(); | 169 GrContext* context = texture->getContext(); |
170 if (context) { | 170 if (context) { |
171 if (flushPendingGrContextIO) { | 171 if (flushPendingGrContextIO) { |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 | 341 |
342 SkImage* SkImage::NewFromAdoptedTexture(GrContext*, const GrBackendTextureDesc&,
SkAlphaType) { | 342 SkImage* SkImage::NewFromAdoptedTexture(GrContext*, const GrBackendTextureDesc&,
SkAlphaType) { |
343 return nullptr; | 343 return nullptr; |
344 } | 344 } |
345 | 345 |
346 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk
AlphaType) { | 346 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk
AlphaType) { |
347 return nullptr; | 347 return nullptr; |
348 } | 348 } |
349 | 349 |
350 #endif | 350 #endif |
OLD | NEW |