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

Side by Side Diff: src/utils/SkTextureCompressor.h

Issue 417933005: Add preliminary ASTC encoder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix comments Created 6 years, 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkTextureCompressor_DEFINED 8 #ifndef SkTextureCompressor_DEFINED
9 #define SkTextureCompressor_DEFINED 9 #define SkTextureCompressor_DEFINED
10 10
11 #include "SkImageInfo.h" 11 #include "SkImageInfo.h"
12 #include "SkBlitter.h" 12 #include "SkBlitter.h"
13 13
14 class SkBitmap; 14 class SkBitmap;
15 class SkData; 15 class SkData;
16 16
17 namespace SkTextureCompressor { 17 namespace SkTextureCompressor {
18 // Various texture compression formats that we support. 18 // Various texture compression formats that we support.
19 enum Format { 19 enum Format {
20 // Alpha only formats. 20 // Alpha only formats.
21 kLATC_Format, // 4x4 blocks, compresses A8 21 kLATC_Format, // 4x4 blocks, compresses A8
22 kR11_EAC_Format, // 4x4 blocks, compresses A8 22 kR11_EAC_Format, // 4x4 blocks, compresses A8
23 kASTC_12x12_Format, // 12x12 blocks, compresses A8
23 24
robertphillips 2014/07/24 17:47:39 Change kLast_Format too ?
krajcevski 2014/07/24 19:59:07 Done.
24 kLast_Format = kR11_EAC_Format 25 kLast_Format = kR11_EAC_Format
25 }; 26 };
26 static const int kFormatCnt = kLast_Format + 1; 27 static const int kFormatCnt = kLast_Format + 1;
27 28
28 // Returns the size of the compressed data given the width, height, and 29 // Returns the size of the compressed data given the width, height, and
29 // desired compression format. If the width and height are not an appropriat e 30 // desired compression format. If the width and height are not an appropriat e
30 // multiple of the block size, then this function returns an error (-1). 31 // multiple of the block size, then this function returns an error (-1).
31 int GetCompressedDataSize(Format fmt, int width, int height); 32 int GetCompressedDataSize(Format fmt, int width, int height);
32 33
33 // Returns an SkData holding a blob of compressed data that corresponds 34 // Returns an SkData holding a blob of compressed data that corresponds
(...skipping 16 matching lines...) Expand all
50 int width, int height, int rowBytes); 51 int width, int height, int rowBytes);
51 52
52 // Returns the blitter for the given compression format. Note, the blitter 53 // Returns the blitter for the given compression format. Note, the blitter
53 // is intended to be used with the proper input. I.e. if you try to blit 54 // is intended to be used with the proper input. I.e. if you try to blit
54 // RGB source data into an R11 EAC texture, you're gonna have a bad time. 55 // RGB source data into an R11 EAC texture, you're gonna have a bad time.
55 SkBlitter* CreateBlitterForFormat(int width, int height, void* compressedBuf fer, 56 SkBlitter* CreateBlitterForFormat(int width, int height, void* compressedBuf fer,
56 Format format); 57 Format format);
57 } 58 }
58 59
59 #endif 60 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698