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

Unified Diff: src/gpu/SkGr.cpp

Issue 1862133002: Add whitelist parameter to refEncodedData (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix comments Created 4 years, 8 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/core/SkImageCacherator.cpp ('k') | src/gpu/SkGrPriv.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 716909133a733d28bb03efafe13d214384e47d98..4f7af1566c7670cb5373f7f76d9f19af43ef0de0 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -22,6 +22,7 @@
#include "SkConfig8888.h"
#include "SkCanvas.h"
#include "SkData.h"
+#include "SkEncodedFormat.h"
#include "SkErrorInternals.h"
#include "SkGrPixelRef.h"
#include "SkMessageBus.h"
@@ -66,6 +67,21 @@ void GrMakeKeyFromImageID(GrUniqueKey* key, uint32_t imageID, const SkIRect& ima
builder[4] = imageBounds.fBottom;
}
+bool GrIsCompressedFormatPossiblySupported(GrContext* ctx, SkEncodedFormat format) {
+#ifndef SK_IGNORE_ETC1_SUPPORT
+ if (!ctx->caps()->isConfigTexturable(kETC1_GrPixelConfig)) {
+ return false;
+ }
+ switch (format) {
+ case kPKM_SkEncodedFormat: // file format for ETC1
+ return true;
+ default:
+ return false;
+ }
+#endif
+ return false;
+}
+
GrPixelConfig GrIsCompressedTextureDataSupported(GrContext* ctx, SkData* data,
int expectedW, int expectedH,
const void** outStartOfDataToUpload) {
« no previous file with comments | « src/core/SkImageCacherator.cpp ('k') | src/gpu/SkGrPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698