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

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

Issue 17847010: Commented SSE blend functions and cleaned-up variable naming. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/opts/SkBlitRow_opts_SSE2.cpp » ('j') | src/opts/SkBlitRow_opts_SSE2.cpp » ('J')
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 820 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 int dstB = SkGetPackedB32(dst); 831 int dstB = SkGetPackedB32(dst);
832 832
833 // LCD blitting is only supported if the dst is known/required 833 // LCD blitting is only supported if the dst is known/required
834 // to be opaque 834 // to be opaque
835 return SkPackARGB32(0xFF, 835 return SkPackARGB32(0xFF,
836 SkBlend32(srcR, dstR, maskR), 836 SkBlend32(srcR, dstR, maskR),
837 SkBlend32(srcG, dstG, maskG), 837 SkBlend32(srcG, dstG, maskG),
838 SkBlend32(srcB, dstB, maskB)); 838 SkBlend32(srcB, dstB, maskB));
839 } 839 }
840 840
841 static inline void SkBlitLCD16Row(SkPMColor dst[], const uint16_t src[], 841 static inline void SkBlitLCD16Row(SkPMColor dst[], const uint16_t mask[],
842 SkColor color, int width, SkPMColor) { 842 SkColor src, int width, SkPMColor) {
843 int srcA = SkColorGetA(color); 843 int srcA = SkColorGetA(src);
844 int srcR = SkColorGetR(color); 844 int srcR = SkColorGetR(src);
845 int srcG = SkColorGetG(color); 845 int srcG = SkColorGetG(src);
846 int srcB = SkColorGetB(color); 846 int srcB = SkColorGetB(src);
847 847
848 srcA = SkAlpha255To256(srcA); 848 srcA = SkAlpha255To256(srcA);
849 849
850 for (int i = 0; i < width; i++) { 850 for (int i = 0; i < width; i++) {
851 dst[i] = SkBlendLCD16(srcA, srcR, srcG, srcB, dst[i], src[i]); 851 dst[i] = SkBlendLCD16(srcA, srcR, srcG, srcB, dst[i], mask[i]);
852 } 852 }
853 } 853 }
854 854
855 static inline void SkBlitLCD16OpaqueRow(SkPMColor dst[], const uint16_t src[], 855 static inline void SkBlitLCD16OpaqueRow(SkPMColor dst[], const uint16_t mask[],
856 SkColor color, int width, 856 SkColor src, int width,
857 SkPMColor opaqueDst) { 857 SkPMColor opaqueDst) {
858 int srcR = SkColorGetR(color); 858 int srcR = SkColorGetR(src);
859 int srcG = SkColorGetG(color); 859 int srcG = SkColorGetG(src);
860 int srcB = SkColorGetB(color); 860 int srcB = SkColorGetB(src);
861 861
862 for (int i = 0; i < width; i++) { 862 for (int i = 0; i < width; i++) {
863 dst[i] = SkBlendLCD16Opaque(srcR, srcG, srcB, dst[i], src[i], 863 dst[i] = SkBlendLCD16Opaque(srcR, srcG, srcB, dst[i], mask[i],
864 opaqueDst); 864 opaqueDst);
865 } 865 }
866 } 866 }
867 867
868 #endif 868 #endif
OLDNEW
« no previous file with comments | « no previous file | src/opts/SkBlitRow_opts_SSE2.cpp » ('j') | src/opts/SkBlitRow_opts_SSE2.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698