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

Unified Diff: src/gpu/SkGrPriv.h

Issue 1862133002: Add whitelist parameter to refEncodedData (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make test pass regardless of CTX build flag 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
Index: src/gpu/SkGrPriv.h
diff --git a/src/gpu/SkGrPriv.h b/src/gpu/SkGrPriv.h
index 46be3a53cfb0b322ab5832ac3867c338dc9fd46d..d9e6178421cfbd869e72dc16d2d97e8b7101d6d8 100644
--- a/src/gpu/SkGrPriv.h
+++ b/src/gpu/SkGrPriv.h
@@ -10,6 +10,7 @@
#include "GrTypes.h"
#include "GrBlend.h"
+#include "SkEncodedFormat.h"
#include "SkImageInfo.h"
#include "SkMatrix.h"
#include "SkXfermode.h"
@@ -105,6 +106,22 @@ GrSurfaceDesc GrImageInfoToSurfaceDesc(const SkImageInfo&, const GrCaps&);
bool GrPixelConfig2ColorAndProfileType(GrPixelConfig, SkColorType*, SkColorProfileType*);
/**
+ * Returns true if the specified encoded format might be supported on this GPU.
+ */
+bool GrIsCompressedFormatPossiblySupported(GrContext*, SkEncodedFormat);
+
+/**
+ * Sniffs the provided data, and returns true if it might be supported by the gpu.
+ * If the format is not recognized, this returns false.
+ *
+ * Note: it is possible that even if true is returned, that the gpu may fail to actually support
+ * it as a texture, once the width/height are considered.
+ *
+ * See GrIsCompressedTextureDataPossiblySupported()
+ */
+bool GrIsCompressedTextureDataPossiblySupported(GrContext* ctx, const void* data, size_t size);
+
+/**
* If the compressed data in the SkData is supported (as a texture format, this returns
* the pixel-config that should be used, and sets outStartOfDataToUpload to the ptr into
* the data where the actual raw data starts (skipping any header bytes).

Powered by Google App Engine
This is Rietveld 408576698