OLD | NEW |
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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 196 |
197 static GrTexture* load_compressed_into_texture(GrContext* ctx, SkData* data, GrS
urfaceDesc desc) { | 197 static GrTexture* load_compressed_into_texture(GrContext* ctx, SkData* data, GrS
urfaceDesc desc) { |
198 const void* rawStart; | 198 const void* rawStart; |
199 GrPixelConfig config = GrIsCompressedTextureDataSupported(ctx, data, desc.fW
idth, desc.fHeight, | 199 GrPixelConfig config = GrIsCompressedTextureDataSupported(ctx, data, desc.fW
idth, desc.fHeight, |
200 &rawStart); | 200 &rawStart); |
201 if (kUnknown_GrPixelConfig == config) { | 201 if (kUnknown_GrPixelConfig == config) { |
202 return nullptr; | 202 return nullptr; |
203 } | 203 } |
204 | 204 |
205 desc.fConfig = config; | 205 desc.fConfig = config; |
206 return ctx->textureProvider()->createTexture(desc, SkBudgeted::kYes, rawStar
t, 0); | 206 return ctx->textureProvider()->createTexture(desc, true, rawStart, 0); |
207 } | 207 } |
208 | 208 |
209 class Generator_GrYUVProvider : public GrYUVProvider { | 209 class Generator_GrYUVProvider : public GrYUVProvider { |
210 SkImageGenerator* fGen; | 210 SkImageGenerator* fGen; |
211 | 211 |
212 public: | 212 public: |
213 Generator_GrYUVProvider(SkImageGenerator* gen) : fGen(gen) {} | 213 Generator_GrYUVProvider(SkImageGenerator* gen) : fGen(gen) {} |
214 | 214 |
215 uint32_t onGetID() override { return fGen->uniqueID(); } | 215 uint32_t onGetID() override { return fGen->uniqueID(); } |
216 bool onGetYUVSizes(SkISize sizes[3]) override { | 216 bool onGetYUVSizes(SkISize sizes[3]) override { |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 } | 325 } |
326 | 326 |
327 #else | 327 #else |
328 | 328 |
329 GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParam
s&, | 329 GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParam
s&, |
330 const SkImage* client, SkImage::Cach
ingHint) { | 330 const SkImage* client, SkImage::Cach
ingHint) { |
331 return nullptr; | 331 return nullptr; |
332 } | 332 } |
333 | 333 |
334 #endif | 334 #endif |
OLD | NEW |