| 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 return ctx->textureProvider()->createTexture(desc, SkBudgeted::kYes, rawStar
t, 0); | 206 return ctx->textureProvider()->createTexture(desc, SkBudgeted::kYes, rawStar
t, 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 onQueryYUV8(SkYUVSizeInfo* sizeInfo, SkYUVColorSpace* colorSpace) const
override { |
| 217 return fGen->getYUV8Planes(sizes, nullptr, nullptr, nullptr); | 217 return fGen->queryYUV8(sizeInfo, colorSpace); |
| 218 } | 218 } |
| 219 bool onGetYUVPlanes(SkISize sizes[3], void* planes[3], size_t rowBytes[3], | 219 bool onGetYUV8Planes(const SkYUVSizeInfo& sizeInfo, void* planes[3]) overrid
e { |
| 220 SkYUVColorSpace* space) override { | 220 return fGen->getYUV8Planes(sizeInfo, planes); |
| 221 return fGen->getYUV8Planes(sizes, planes, rowBytes, space); | |
| 222 } | 221 } |
| 223 }; | 222 }; |
| 224 | 223 |
| 225 static GrTexture* set_key_and_return(GrTexture* tex, const GrUniqueKey& key) { | 224 static GrTexture* set_key_and_return(GrTexture* tex, const GrUniqueKey& key) { |
| 226 if (key.isValid()) { | 225 if (key.isValid()) { |
| 227 tex->resourcePriv().setUniqueKey(key); | 226 tex->resourcePriv().setUniqueKey(key); |
| 228 } | 227 } |
| 229 return tex; | 228 return tex; |
| 230 } | 229 } |
| 231 | 230 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 } | 332 } |
| 334 | 333 |
| 335 #else | 334 #else |
| 336 | 335 |
| 337 GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParam
s&, | 336 GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParam
s&, |
| 338 const SkImage* client, SkImage::Cach
ingHint) { | 337 const SkImage* client, SkImage::Cach
ingHint) { |
| 339 return nullptr; | 338 return nullptr; |
| 340 } | 339 } |
| 341 | 340 |
| 342 #endif | 341 #endif |
| OLD | NEW |