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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |