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

Unified Diff: include/gpu/GrTypes.h

Issue 302783002: Initial work to get ETC1 data up to the GPU (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix GCC warning 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
Index: include/gpu/GrTypes.h
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h
index 53e633da573207f77d632209683051323e1eb8bd..0d85652b55145ccd33bbd676419dd8f480ad16d1 100644
--- a/include/gpu/GrTypes.h
+++ b/include/gpu/GrTypes.h
@@ -641,6 +641,27 @@ enum GrGLBackendState {
};
/**
+ * Returns the data size for the given compressed pixel config
+ */
+static inline size_t GrCompressedFormatDataSize(GrPixelConfig config,
+ int width, int height) {
+ SkASSERT(GrPixelConfigIsCompressed(config));
+
+ switch (config) {
+ case kLATC_GrPixelConfig:
+ case kETC1_GrPixelConfig:
+ SkASSERT((width & 3) == 0);
+ SkASSERT((height & 3) == 0);
+ return (width >> 2) * (height >> 2) * 8;
+
+ default:
+ // Unknown pixel config...
robertphillips 2014/05/30 15:00:22 SkFAIL here?
krajcevski 2014/05/30 16:21:50 Done.
+ SkASSERT(false);
+ return 4 * width * height;
+ }
+}
+
+/**
* This value translates to reseting all the context state for any backend.
*/
static const uint32_t kAll_GrBackendState = 0xffffffff;
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/gpu/GrContext.cpp » ('j') | src/gpu/GrGpu.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698