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

Unified Diff: src/gpu/SkGr.cpp

Issue 303273008: Revert of Initial work to get ETC1 data up to the GPU (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 | « src/gpu/GrGpu.cpp ('k') | src/gpu/gl/GrGpuGL.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGr.cpp
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 6a68c44be4c88b6c4625667c5d8b02b22bf6569d..6bd04dec3a841ac8186b8644ab212aca6512fba8 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -8,14 +8,9 @@
#include "SkGr.h"
#include "SkColorFilter.h"
#include "SkConfig8888.h"
-#include "SkData.h"
#include "SkMessageBus.h"
#include "SkPixelRef.h"
#include "GrResourceCache.h"
-#include "GrGpu.h"
-#include "GrDrawTargetCaps.h"
-
-#include "etc1.h"
/* Fill out buffer with the compressed format Ganesh expects from a colortable
based bitmap. [palette (colortable) + indices].
@@ -127,48 +122,6 @@
static void add_genID_listener(GrResourceKey key, SkPixelRef* pixelRef) {
SkASSERT(NULL != pixelRef);
pixelRef->addGenIDChangeListener(SkNEW_ARGS(GrResourceInvalidator, (key)));
-}
-
-static GrTexture *load_etc1_texture(GrContext* ctx,
- const GrTextureParams* params,
- const SkBitmap &bm, GrTextureDesc desc) {
- SkData *data = bm.pixelRef()->refEncodedData();
-
- // Is this even encoded data?
- if (NULL == data) {
- return NULL;
- }
-
- // Is this a valid PKM encoded data?
- const uint8_t *bytes = data->bytes();
- if (!etc1_pkm_is_valid(bytes)) {
- return NULL;
- }
-
- uint32_t encodedWidth = etc1_pkm_get_width(bytes);
- uint32_t encodedHeight = etc1_pkm_get_height(bytes);
-
- // Does the data match the dimensions of the bitmap? If not,
- // then we don't know how to scale the image to match it...
- if (encodedWidth != static_cast<uint32_t>(bm.width()) ||
- encodedHeight != static_cast<uint32_t>(bm.height())) {
- return NULL;
- }
-
- // Everything seems good... skip ahead to the data.
- bytes += ETC_PKM_HEADER_SIZE;
- desc.fConfig = kETC1_GrPixelConfig;
-
- // This texture is likely to be used again so leave it in the cache
- GrCacheID cacheID;
- generate_bitmap_cache_id(bm, &cacheID);
-
- GrResourceKey key;
- GrTexture* result = ctx->createTexture(params, desc, cacheID, bytes, 0, &key);
- if (NULL != result) {
- add_genID_listener(key, bm.pixelRef());
- }
- return result;
}
static GrTexture* sk_gr_create_bitmap_texture(GrContext* ctx,
@@ -219,13 +172,6 @@
bitmap = &tmpBitmap;
desc.fConfig = SkImageInfo2GrPixelConfig(bitmap->info());
}
-
- // Is this an ETC1 encoded texture?
- } else if (cache && ctx->getGpu()->caps()->isConfigTexturable(kETC1_GrPixelConfig)) {
- GrTexture *texture = load_etc1_texture(ctx, params, *bitmap, desc);
- if (NULL != texture) {
- return texture;
- }
}
SkAutoLockPixels alp(*bitmap);
« no previous file with comments | « src/gpu/GrGpu.cpp ('k') | src/gpu/gl/GrGpuGL.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698