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

Side by Side Diff: src/opts/SkTextureCompression_opts_neon.cpp

Issue 800993002: Even more win64 warning fixes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more Created 6 years 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/opts/SkTextureCompression_opts_neon.h ('k') | src/pdf/SkPDFFont.cpp » ('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 2 * Copyright 2014
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.h" 8 #include "SkTextureCompressor.h"
9 #include "SkTextureCompression_opts.h" 9 #include "SkTextureCompression_opts.h"
10 10
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 #if defined (SK_CPU_BENDIAN) 140 #if defined (SK_CPU_BENDIAN)
141 static inline uint64x2_t fix_endianness(uint64x2_t x) { 141 static inline uint64x2_t fix_endianness(uint64x2_t x) {
142 return x; 142 return x;
143 } 143 }
144 #else 144 #else
145 static inline uint64x2_t fix_endianness(uint64x2_t x) { 145 static inline uint64x2_t fix_endianness(uint64x2_t x) {
146 return vreinterpretq_u64_u8(vrev64q_u8(vreinterpretq_u8_u64(x))); 146 return vreinterpretq_u64_u8(vrev64q_u8(vreinterpretq_u8_u64(x)));
147 } 147 }
148 #endif 148 #endif
149 149
150 static void compress_r11eac_blocks(uint64_t* dst, const uint8_t* src, int rowByt es) { 150 static void compress_r11eac_blocks(uint64_t* dst, const uint8_t* src, size_t row Bytes) {
151 151
152 // Try to avoid switching between vector and non-vector ops... 152 // Try to avoid switching between vector and non-vector ops...
153 const uint8_t *const src1 = src; 153 const uint8_t *const src1 = src;
154 const uint8_t *const src2 = src + rowBytes; 154 const uint8_t *const src2 = src + rowBytes;
155 const uint8_t *const src3 = src + 2*rowBytes; 155 const uint8_t *const src3 = src + 2*rowBytes;
156 const uint8_t *const src4 = src + 3*rowBytes; 156 const uint8_t *const src4 = src + 3*rowBytes;
157 uint64_t *const dst1 = dst; 157 uint64_t *const dst1 = dst;
158 uint64_t *const dst2 = dst + 2; 158 uint64_t *const dst2 = dst + 2;
159 159
160 const uint8x16_t alphaRow1 = vld1q_u8(src1); 160 const uint8x16_t alphaRow1 = vld1q_u8(src1);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 const uint64x2_t indicesLeft = fix_endianness(pack_indices(blockIndicesLeft) ); 201 const uint64x2_t indicesLeft = fix_endianness(pack_indices(blockIndicesLeft) );
202 const uint64x2_t indicesRight = fix_endianness(pack_indices(blockIndicesRigh t)); 202 const uint64x2_t indicesRight = fix_endianness(pack_indices(blockIndicesRigh t));
203 203
204 const uint64x2_t d1 = vcombine_u64(vget_low_u64(indicesLeft), vget_low_u64(i ndicesRight)); 204 const uint64x2_t d1 = vcombine_u64(vget_low_u64(indicesLeft), vget_low_u64(i ndicesRight));
205 const uint64x2_t d2 = vcombine_u64(vget_high_u64(indicesLeft), vget_high_u64 (indicesRight)); 205 const uint64x2_t d2 = vcombine_u64(vget_high_u64(indicesLeft), vget_high_u64 (indicesRight));
206 vst1q_u64(dst1, d1); 206 vst1q_u64(dst1, d1);
207 vst1q_u64(dst2, d2); 207 vst1q_u64(dst2, d2);
208 } 208 }
209 209
210 bool CompressA8toR11EAC_NEON(uint8_t* dst, const uint8_t* src, 210 bool CompressA8toR11EAC_NEON(uint8_t* dst, const uint8_t* src,
211 int width, int height, int rowBytes) { 211 int width, int height, size_t rowBytes) {
212 212
213 // Since we're going to operate on 4 blocks at a time, the src width 213 // Since we're going to operate on 4 blocks at a time, the src width
214 // must be a multiple of 16. However, the height only needs to be a 214 // must be a multiple of 16. However, the height only needs to be a
215 // multiple of 4 215 // multiple of 4
216 if (0 == width || 0 == height || (width % 16) != 0 || (height % 4) != 0) { 216 if (0 == width || 0 == height || (width % 16) != 0 || (height % 4) != 0) {
217 return SkTextureCompressor::CompressBufferToFormat( 217 return SkTextureCompressor::CompressBufferToFormat(
218 dst, src, 218 dst, src,
219 kAlpha_8_SkColorType, 219 kAlpha_8_SkColorType,
220 width, height, rowBytes, 220 width, height, rowBytes,
221 SkTextureCompressor::kR11_EAC_Format, false); 221 SkTextureCompressor::kR11_EAC_Format, false);
222 } 222 }
223 223
224 const int blocksX = width >> 2; 224 const int blocksX = width >> 2;
225 const int blocksY = height >> 2; 225 const int blocksY = height >> 2;
226 226
227 SkASSERT((blocksX % 4) == 0); 227 SkASSERT((blocksX % 4) == 0);
228 228
229 uint64_t* encPtr = reinterpret_cast<uint64_t*>(dst); 229 uint64_t* encPtr = reinterpret_cast<uint64_t*>(dst);
230 for (int y = 0; y < blocksY; ++y) { 230 for (int y = 0; y < blocksY; ++y) {
231 for (int x = 0; x < blocksX; x+=4) { 231 for (int x = 0; x < blocksX; x+=4) {
232 // Compress it 232 // Compress it
233 compress_r11eac_blocks(encPtr, src + 4*x, rowBytes); 233 compress_r11eac_blocks(encPtr, src + 4*x, rowBytes);
234 encPtr += 4; 234 encPtr += 4;
235 } 235 }
236 src += 4 * rowBytes; 236 src += 4 * rowBytes;
237 } 237 }
238 return true; 238 return true;
239 } 239 }
OLDNEW
« no previous file with comments | « src/opts/SkTextureCompression_opts_neon.h ('k') | src/pdf/SkPDFFont.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698