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

Unified Diff: src/utils/SkTextureCompressor.h

Issue 432503002: Add initial pipeline for decompressors (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | src/utils/SkTextureCompressor.cpp » ('j') | src/utils/SkTextureCompressor.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkTextureCompressor.h
diff --git a/src/utils/SkTextureCompressor.h b/src/utils/SkTextureCompressor.h
index c6305bab45172c2ca869f9b1ce16bad11f397a1e..db0ca6b28b87c29165b6002f867c451ed875afff 100644
--- a/src/utils/SkTextureCompressor.h
+++ b/src/utils/SkTextureCompressor.h
@@ -44,6 +44,24 @@ namespace SkTextureCompressor {
int width, int height, int rowBytes, Format format,
bool opt = true /* Use optimization if available */);
robertphillips 2014/07/31 15:01:01 typo.
krajcevski 2014/07/31 15:12:18 Done.
+ // Decomrpesses the given src data from the format specified into the
+ // destination buffer. The width and height of the data passed corresponds
+ // to the width and height of the uncompressed image. The destination buffer (dst)
+ // is assumed to be large enough to hold the entire decompressed image. The
+ // decompressed image colors are determined based on the passed format:
+ //
+ // LATC -> Alpha 8
+ // R11_EAC -> Alpha 8
+ // ASTC -> RGBA
+ //
+ // Note, CompressBufferToFormat compresses A8 data into ASTC. However,
+ // general ASTC data encodes RGBA data, so that is what the decompressor
+ // operates on.
+ //
+ // Returns true if successfully decompresses the src data.
+ bool DecompressBufferFromFormat(uint8_t* dst, int dstRowBytes, const uint8_t* src,
+ int width, int height, Format format);
+
// This typedef defines what the nominal aspects of a compression function
// are. The typedef is not meant to be used by clients of the API, but rather
// allows SIMD optimized compression functions to be implemented.
@@ -59,8 +77,9 @@ namespace SkTextureCompressor {
// Returns the desired dimensions of the block size for the given format. These dimensions
// don't necessarily correspond to the hardware-specified dimensions, since there may
// be specialized algorithms that operate on multiple blocks at once. These dimensions
- // reflect that optimization and return the appropriate operable dimensions.
- void GetBlockDimensions(Format format, int* dimX, int* dimY);
+ // reflect that optimization and return the appropriate operable dimensions. If the
+ // flag 'hardware' is true, then the actual hardware dimensions are returned.
+ void GetBlockDimensions(Format format, int* dimX, int* dimY, bool hardware = false);
}
#endif
« no previous file with comments | « no previous file | src/utils/SkTextureCompressor.cpp » ('j') | src/utils/SkTextureCompressor.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698