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

Side by Side Diff: include/core/SkColorPriv.h

Issue 98343006: Fix 32/64 bit warnings on g++-4.2. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/ColorPrivTest.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkColorPriv_DEFINED 10 #ifndef SkColorPriv_DEFINED
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 const uint32_t mask = 0xFF00FF00; 296 const uint32_t mask = 0xFF00FF00;
297 return (ag & mask) | ((rb & mask) >> 8); 297 return (ag & mask) | ((rb & mask) >> 8);
298 } 298 }
299 299
300 /** 300 /**
301 * 0xAAxxGGxxRRxxBBxx -> 0xAARRGGBB 301 * 0xAAxxGGxxRRxxBBxx -> 0xAARRGGBB
302 * (note, AGRB -> ARGB) 302 * (note, AGRB -> ARGB)
303 */ 303 */
304 static inline SkPMColor SkUnsplay(uint64_t agrb) { 304 static inline SkPMColor SkUnsplay(uint64_t agrb) {
305 const uint32_t mask = 0xFF00FF00; 305 const uint32_t mask = 0xFF00FF00;
306 return ((agrb & mask) >> 8) | // 0x00RR00BB 306 return SkPMColor(
307 ((agrb >> 32) & mask); // 0xAARRGGBB 307 ((agrb & mask) >> 8) | // 0x00RR00BB
308 ((agrb >> 32) & mask)); // 0xAARRGGBB
308 } 309 }
309 310
310 static inline SkPMColor SkFastFourByteInterp256_32(SkPMColor src, SkPMColor dst, unsigned scale) { 311 static inline SkPMColor SkFastFourByteInterp256_32(SkPMColor src, SkPMColor dst, unsigned scale) {
311 SkASSERT(scale <= 256); 312 SkASSERT(scale <= 256);
312 313
313 // Two 8-bit blends per two 32-bit registers, with space to make sure the ma th doesn't collide. 314 // Two 8-bit blends per two 32-bit registers, with space to make sure the ma th doesn't collide.
314 uint32_t src_ag, src_rb, dst_ag, dst_rb; 315 uint32_t src_ag, src_rb, dst_ag, dst_rb;
315 SkSplay(src, &src_ag, &src_rb); 316 SkSplay(src, &src_ag, &src_rb);
316 SkSplay(dst, &dst_ag, &dst_rb); 317 SkSplay(dst, &dst_ag, &dst_rb);
317 318
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 int srcG = SkColorGetG(src); 907 int srcG = SkColorGetG(src);
907 int srcB = SkColorGetB(src); 908 int srcB = SkColorGetB(src);
908 909
909 for (int i = 0; i < width; i++) { 910 for (int i = 0; i < width; i++) {
910 dst[i] = SkBlendLCD16Opaque(srcR, srcG, srcB, dst[i], mask[i], 911 dst[i] = SkBlendLCD16Opaque(srcR, srcG, srcB, dst[i], mask[i],
911 opaqueDst); 912 opaqueDst);
912 } 913 }
913 } 914 }
914 915
915 #endif 916 #endif
OLDNEW
« no previous file with comments | « no previous file | tests/ColorPrivTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698