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

Unified Diff: src/utils/SkTextureCompressor.h

Issue 325733004: Add texture compression utility (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Code review changes Created 6 years, 6 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/utils/SkTextureCompressor.h
diff --git a/src/utils/SkTextureCompressor.h b/src/utils/SkTextureCompressor.h
new file mode 100644
index 0000000000000000000000000000000000000000..4fd858728e64b963a2056870ab9276d1fef2649d
--- /dev/null
+++ b/src/utils/SkTextureCompressor.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkTextureCompressor_DEFINED
+#define SkTextureCompressor_DEFINED
+
+class SkBitmap;
+class SkData;
+
+namespace SkTextureCompressor {
+ // Various texture compression formats that we support.
+ enum Format {
+ // Alpha only format.
+ kLATC_Format,
+
+ kLast_Format = kLATC_Format
+ };
+ static const int kFormatCnt = kLast_Format + 1;
+
+ // Returns an SKData holding a blob of compressed data that corresponds
scroggo 2014/06/09 20:54:18 nit: SkData.
krajcevski 2014/06/09 21:06:02 Done.
+ // to the bitmap. If the bitmap config cannot be compressed using the
scroggo 2014/06/09 20:54:18 SkBitmap::Config is deprecated. Use SkColorType.
krajcevski 2014/06/09 21:06:02 Done.
+ // associated format, then we return NULL. The returned SkData will have
+ // a refcount of one.
scroggo 2014/06/09 20:54:18 Typically I think we state that the caller is resp
krajcevski 2014/06/09 21:06:02 Done.
+ SkData *CompressBitmapToFormat(const SkBitmap &bitmap, Format format);
scroggo 2014/06/09 20:54:18 nit: SkData* CompressBitmapToFormat const SkBitmap
krajcevski 2014/06/09 21:06:02 Done.
+}
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698