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

Side by Side Diff: src/core/SkImageCacherator.cpp

Issue 1225923010: Refugee from Dead Machine 4: MDB Monster Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Last update from dead machine Created 4 years, 7 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/core/SkComposeShader.cpp ('k') | src/core/SkImageFilter.cpp » ('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 2015 Google Inc. 2 * Copyright 2015 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 "SkImage_Base.h" 10 #include "SkImage_Base.h"
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 SkIRect::MakeWH(this->width(), this->height())) ; 285 SkIRect::MakeWH(this->width(), this->height())) ;
286 } 286 }
287 } 287 }
288 288
289 protected: 289 protected:
290 // TODO: consider overriding this, for the case where the underlying generat or might be 290 // TODO: consider overriding this, for the case where the underlying generat or might be
291 // able to efficiently produce a "stretched" texture natively (e.g. pi cture-backed) 291 // able to efficiently produce a "stretched" texture natively (e.g. pi cture-backed)
292 // GrTexture* generateTextureForParams(GrContext*, const SkGrStretch&) ov erride; 292 // GrTexture* generateTextureForParams(GrContext*, const SkGrStretch&) ov erride;
293 293
294 GrTexture* refOriginalTexture(GrContext* ctx) override { 294 GrTexture* refOriginalTexture(GrContext* ctx) override {
295 return fCacher->lockTexture(ctx, fOriginalKey, fClient); 295 GrTexture* tmp = fCacher->lockTexture(ctx, fOriginalKey, fClient);
296
297 if (!fOriginalKey.isValid() && tmp->fromRawPixels2()) {
298 tmp->setException(true);
299 }
300
301 return tmp;
296 } 302 }
297 303
298 void makeCopyKey(const CopyParams& stretch, GrUniqueKey* paramsCopyKey) over ride { 304 void makeCopyKey(const CopyParams& stretch, GrUniqueKey* paramsCopyKey) over ride {
299 if (fOriginalKey.isValid()) { 305 if (fOriginalKey.isValid()) {
300 MakeCopyKeyFromOrigKey(fOriginalKey, stretch, paramsCopyKey); 306 MakeCopyKeyFromOrigKey(fOriginalKey, stretch, paramsCopyKey);
301 } 307 }
302 } 308 }
303 309
304 void didCacheCopy(const GrUniqueKey& copyKey) override { 310 void didCacheCopy(const GrUniqueKey& copyKey) override {
305 if (fClient) { 311 if (fClient) {
(...skipping 19 matching lines...) Expand all
325 } 331 }
326 332
327 #else 333 #else
328 334
329 GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParam s&, 335 GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParam s&,
330 const SkImage* client) { 336 const SkImage* client) {
331 return nullptr; 337 return nullptr;
332 } 338 }
333 339
334 #endif 340 #endif
OLDNEW
« no previous file with comments | « src/core/SkComposeShader.cpp ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698