aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/GrTypes.h
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-30 18:41:39 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-30 18:41:39 +0000
commitaf091a176dbf900a9ff4526ef3b6966a1de44775 (patch)
tree744c1bb783b141ea1e9c333cd6c1b38bdaaab82f /include/gpu/GrTypes.h
parentb3281585bb6ee3ad8385bf4ba46513af609fa11b (diff)
Initial work to get ETC1 data up to the GPU
R=bsalomon@google.com, robertphillips@google.com Author: krajcevski@google.com Review URL: https://codereview.chromium.org/302783002 git-svn-id: http://skia.googlecode.com/svn/trunk@15001 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/gpu/GrTypes.h')
-rw-r--r--include/gpu/GrTypes.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h
index 53e633da57..34f4e2827d 100644
--- a/include/gpu/GrTypes.h
+++ b/include/gpu/GrTypes.h
@@ -641,6 +641,26 @@ 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:
+ SkFAIL("Unknown compressed pixel config");
+ return 4 * width * height;
+ }
+}
+
+/**
* This value translates to reseting all the context state for any backend.
*/
static const uint32_t kAll_GrBackendState = 0xffffffff;