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

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

Issue 1229933003: add runtime option to provide data->imagegenerator factory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 5 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
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 69 }
70 70
71 SkData* SkImage::refEncoded() const { 71 SkData* SkImage::refEncoded() const {
72 return as_IB(this)->onRefEncoded(); 72 return as_IB(this)->onRefEncoded();
73 } 73 }
74 74
75 SkImage* SkImage::NewFromEncoded(SkData* encoded, const SkIRect* subset) { 75 SkImage* SkImage::NewFromEncoded(SkData* encoded, const SkIRect* subset) {
76 if (NULL == encoded || 0 == encoded->size()) { 76 if (NULL == encoded || 0 == encoded->size()) {
77 return NULL; 77 return NULL;
78 } 78 }
79 SkImageGenerator* generator = SkImageGenerator::NewFromData(encoded); 79 SkImageGenerator* generator = SkImageGenerator::NewFromEncoded(encoded);
80 return generator ? SkImage::NewFromGenerator(generator, subset) : NULL; 80 return generator ? SkImage::NewFromGenerator(generator, subset) : NULL;
81 } 81 }
82 82
83 SkSurface* SkImage::newSurface(const SkImageInfo& info, const SkSurfaceProps* pr ops) const { 83 SkSurface* SkImage::newSurface(const SkImageInfo& info, const SkSurfaceProps* pr ops) const {
84 if (NULL == props) { 84 if (NULL == props) {
85 props = &as_IB(this)->props(); 85 props = &as_IB(this)->props();
86 } 86 }
87 return as_IB(this)->onNewSurface(info, *props); 87 return as_IB(this)->onNewSurface(info, *props);
88 } 88 }
89 89
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 291
292 SkImage* SkImage::NewFromAdoptedTexture(GrContext*, const GrBackendTextureDesc&, SkAlphaType) { 292 SkImage* SkImage::NewFromAdoptedTexture(GrContext*, const GrBackendTextureDesc&, SkAlphaType) {
293 return NULL; 293 return NULL;
294 } 294 }
295 295
296 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk AlphaType) { 296 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk AlphaType) {
297 return NULL; 297 return NULL;
298 } 298 }
299 299
300 #endif 300 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698