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

Side by Side Diff: src/utils/SkTextureCompressor_ASTC.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 3 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.cpp ('k') | src/utils/SkTextureCompressor_Blitter.h » ('j') | 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 #include "SkTextureCompressor_ASTC.h" 8 #include "SkTextureCompressor_ASTC.h"
9 #include "SkTextureCompressor_Blitter.h" 9 #include "SkTextureCompressor_Blitter.h"
10 10
(...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 numValues += ((cemInt >> 2) + 1) * 2; 1168 numValues += ((cemInt >> 2) + 1) * 2;
1169 } 1169 }
1170 1170
1171 return numValues; 1171 return numValues;
1172 } 1172 }
1173 1173
1174 // Figures out the number of bits available for color values, and fills 1174 // Figures out the number of bits available for color values, and fills
1175 // in the maximum encoding that will fit the number of color values that 1175 // in the maximum encoding that will fit the number of color values that
1176 // we need. Returns false on error. (See section C.2.22 of the spec) 1176 // we need. Returns false on error. (See section C.2.22 of the spec)
1177 bool getColorValueEncoding(int *nBits, int *nTrits, int *nQuints) const { 1177 bool getColorValueEncoding(int *nBits, int *nTrits, int *nQuints) const {
1178 if (NULL == nBits || NULL == nTrits || NULL == nQuints) { 1178 if (nullptr == nBits || nullptr == nTrits || nullptr == nQuints) {
1179 return false; 1179 return false;
1180 } 1180 }
1181 1181
1182 const int nColorVals = this->numColorValues(); 1182 const int nColorVals = this->numColorValues();
1183 if (nColorVals <= 0) { 1183 if (nColorVals <= 0) {
1184 return false; 1184 return false;
1185 } 1185 }
1186 1186
1187 const int colorBits = fColorEndBit - fColorStartBit; 1187 const int colorBits = fColorEndBit - fColorStartBit;
1188 SkASSERT(colorBits > 0); 1188 SkASSERT(colorBits > 0);
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
2050 compress_a8_astc_block<GetAlpha>(dstPtr, src + y*rowBytes + x, rowBy tes); 2050 compress_a8_astc_block<GetAlpha>(dstPtr, src + y*rowBytes + x, rowBy tes);
2051 } 2051 }
2052 } 2052 }
2053 2053
2054 return true; 2054 return true;
2055 } 2055 }
2056 2056
2057 SkBlitter* CreateASTCBlitter(int width, int height, void* outputBuffer, 2057 SkBlitter* CreateASTCBlitter(int width, int height, void* outputBuffer,
2058 SkTBlitterAllocator* allocator) { 2058 SkTBlitterAllocator* allocator) {
2059 if ((width % 12) != 0 || (height % 12) != 0) { 2059 if ((width % 12) != 0 || (height % 12) != 0) {
2060 return NULL; 2060 return nullptr;
2061 } 2061 }
2062 2062
2063 // Memset the output buffer to an encoding that decodes to zero. We must do this 2063 // Memset the output buffer to an encoding that decodes to zero. We must do this
2064 // in order to avoid having uninitialized values in the buffer if the blitte r 2064 // in order to avoid having uninitialized values in the buffer if the blitte r
2065 // decides not to write certain scanlines (and skip entire rows of blocks). 2065 // decides not to write certain scanlines (and skip entire rows of blocks).
2066 // In the case of ASTC, if everything index is zero, then the interpolated v alue 2066 // In the case of ASTC, if everything index is zero, then the interpolated v alue
2067 // will decode to zero provided we have the right header. We use the encodin g 2067 // will decode to zero provided we have the right header. We use the encodin g
2068 // from recognizing all zero blocks from above. 2068 // from recognizing all zero blocks from above.
2069 const int nBlocks = (width * height / 144); 2069 const int nBlocks = (width * height / 144);
2070 uint8_t *dst = reinterpret_cast<uint8_t *>(outputBuffer); 2070 uint8_t *dst = reinterpret_cast<uint8_t *>(outputBuffer);
(...skipping 21 matching lines...) Expand all
2092 read_astc_block(&data, src); 2092 read_astc_block(&data, src);
2093 decompress_astc_block(reinterpret_cast<uint8_t*>(colorPtr + x), dstR owBytes, data); 2093 decompress_astc_block(reinterpret_cast<uint8_t*>(colorPtr + x), dstR owBytes, data);
2094 2094
2095 // ASTC encoded blocks are 16 bytes (128 bits) large. 2095 // ASTC encoded blocks are 16 bytes (128 bits) large.
2096 src += 16; 2096 src += 16;
2097 } 2097 }
2098 } 2098 }
2099 } 2099 }
2100 2100
2101 } // SkTextureCompressor 2101 } // SkTextureCompressor
OLDNEW
« no previous file with comments | « src/utils/SkTextureCompressor.cpp ('k') | src/utils/SkTextureCompressor_Blitter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698