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

Unified Diff: src/core/SkImageCacherator.cpp

Issue 1970773002: compressed texture support has been broken/untested for a while, remove cruft (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « resources/mandrill_512.pkm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkImageCacherator.cpp
diff --git a/src/core/SkImageCacherator.cpp b/src/core/SkImageCacherator.cpp
index 0df14df95c5f8f3542acbee5060f84f14a6549d2..4a8521743d3acad2ab9c0cf2a2e734e8319ae629 100644
--- a/src/core/SkImageCacherator.cpp
+++ b/src/core/SkImageCacherator.cpp
@@ -25,6 +25,13 @@
#include "SkGrPriv.h"
#endif
+// Until we actually have codecs/etc. that can contain/support a GPU texture format
+// skip this step, since for some generators, returning their encoded data as a SkData
+// can be somewhat expensive, and this call doesn't indicate to the generator that we're
+// only interested in GPU datas...
+// see skbug.com/ 4971, 5128, ...
+//#define SK_SUPPORT_COMPRESSED_TEXTURES_IN_CACHERATOR
+
SkImageCacherator* SkImageCacherator::NewFromGenerator(SkImageGenerator* gen,
const SkIRect* subset) {
if (!gen) {
@@ -195,6 +202,7 @@ bool SkImageCacherator::lockAsBitmap(SkBitmap* bitmap, const SkImage* client,
#if SK_SUPPORT_GPU
+#ifdef SK_SUPPORT_COMPRESSED_TEXTURES_IN_CACHERATOR
static GrTexture* load_compressed_into_texture(GrContext* ctx, SkData* data, GrSurfaceDesc desc) {
const void* rawStart;
GrPixelConfig config = GrIsCompressedTextureDataSupported(ctx, data, desc.fWidth, desc.fHeight,
@@ -206,6 +214,7 @@ static GrTexture* load_compressed_into_texture(GrContext* ctx, SkData* data, GrS
desc.fConfig = config;
return ctx->textureProvider()->createTexture(desc, SkBudgeted::kYes, rawStart, 0);
}
+#endif
class Generator_GrYUVProvider : public GrYUVProvider {
SkImageGenerator* fGen;
@@ -276,6 +285,7 @@ GrTexture* SkImageCacherator::lockTexture(GrContext* ctx, const GrUniqueKey& key
const GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(fInfo, *ctx->caps());
+#ifdef SK_SUPPORT_COMPRESSED_TEXTURES_IN_CACHERATOR
// 3. Ask the generator to return a compressed form that the GPU might support
SkAutoTUnref<SkData> data(this->refEncoded(ctx));
if (data) {
@@ -286,6 +296,7 @@ GrTexture* SkImageCacherator::lockTexture(GrContext* ctx, const GrUniqueKey& key
return set_key_and_return(tex, key);
}
}
+#endif
// 4. Ask the generator to return YUV planes, which the GPU can convert
{
« no previous file with comments | « resources/mandrill_512.pkm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698