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

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

Issue 427693002: Add function for creating ASTC blitter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Naming conventions 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
« no previous file with comments | « src/utils/SkTextureCompressor_ASTC.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_Blitter_DEFINED 8 #ifndef SkTextureCompressor_Blitter_DEFINED
9 #define SkTextureCompressor_Blitter_DEFINED 9 #define SkTextureCompressor_Blitter_DEFINED
10 10
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 } 224 }
225 225
226 // Updates the block whose columns are stored in block. curAlphai is expecte d 226 // Updates the block whose columns are stored in block. curAlphai is expecte d
227 // to store the alpha values that will be placed within each of the columns in 227 // to store the alpha values that will be placed within each of the columns in
228 // the range [col, col+colsLeft). 228 // the range [col, col+colsLeft).
229 typedef uint32_t Column[BlockDim/4]; 229 typedef uint32_t Column[BlockDim/4];
230 typedef uint32_t Block[BlockDim][BlockDim/4]; 230 typedef uint32_t Block[BlockDim][BlockDim/4];
231 inline void updateBlockColumns(Block block, const int col, 231 inline void updateBlockColumns(Block block, const int col,
232 const int colsLeft, const Column curAlphai) { 232 const int colsLeft, const Column curAlphai) {
233 SkASSERT(NULL != block); 233 SkASSERT(NULL != block);
234 SkASSERT(col + colsLeft <= 4); 234 SkASSERT(col + colsLeft <= BlockDim);
235 235
236 for (int i = col; i < (col + colsLeft); ++i) { 236 for (int i = col; i < (col + colsLeft); ++i) {
237 memcpy(block[i], curAlphai, sizeof(Column)); 237 memcpy(block[i], curAlphai, sizeof(Column));
238 } 238 }
239 } 239 }
240 240
241 // The following function writes the buffered runs to compressed blocks. 241 // The following function writes the buffered runs to compressed blocks.
242 // If fNextRun < BlockDim, then we fill the runs that we haven't buffered wi th 242 // If fNextRun < BlockDim, then we fill the runs that we haven't buffered wi th
243 // the constant zero buffer. 243 // the constant zero buffer.
244 void flushRuns() { 244 void flushRuns() {
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 CompressionProc(outPtr, reinterpret_cast<uint8_t*>(block)); 396 CompressionProc(outPtr, reinterpret_cast<uint8_t*>(block));
397 } 397 }
398 398
399 fNextRun = 0; 399 fNextRun = 0;
400 } 400 }
401 }; 401 };
402 402
403 } // namespace SkTextureCompressor 403 } // namespace SkTextureCompressor
404 404
405 #endif // SkTextureCompressor_Blitter_DEFINED 405 #endif // SkTextureCompressor_Blitter_DEFINED
OLDNEW
« no previous file with comments | « src/utils/SkTextureCompressor_ASTC.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698