Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: src/image/SkImage.cpp

Issue 1282363002: Use SkImageCacherator in SkImages (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix rob comments Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/SkGrPriv.h ('k') | src/image/SkImage_Base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/gpu/SkGrPriv.h ('k') | src/image/SkImage_Base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698