blob: 38fb5eade2904e0a64a64d02e8dac0e5ce3c4239 [file] [log] [blame]
krajcevskiae614402014-06-10 14:52:28 -07001/*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkTextureCompressor_DEFINED
9#define SkTextureCompressor_DEFINED
10
11class SkBitmap;
12class SkData;
13
14namespace SkTextureCompressor {
15 // Various texture compression formats that we support.
16 enum Format {
17 // Alpha only format.
18 kLATC_Format,
19
20 kLast_Format = kLATC_Format
21 };
22 static const int kFormatCnt = kLast_Format + 1;
23
24 // Returns an SkData holding a blob of compressed data that corresponds
25 // to the bitmap. If the bitmap colorType cannot be compressed using the
26 // associated format, then we return NULL. The caller is responsible for
27 // calling unref() on the returned data.
28 SkData* CompressBitmapToFormat(const SkBitmap& bitmap, Format format);
29}
30
31#endif