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

Side by Side Diff: src/opts/Sk4px_none.h

Issue 1565223002: Clean up SkXfermode_opts.h (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: &&&&&& Created 4 years, 11 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/opts/Sk4px_SSE2.h ('k') | src/opts/SkXfermode_opts.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 2015 Google Inc. 2 * Copyright 2015 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 "SkUtils.h" 8 #include "SkUtils.h"
9 9
10 namespace { // See Sk4px.h 10 namespace { // See Sk4px.h
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } 99 }
100 100
101 inline Sk4px Sk4px::zeroColors() const { 101 inline Sk4px Sk4px::zeroColors() const {
102 static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian."); 102 static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian.");
103 return Sk16b(0,0,0, this->kth< 3>(), 103 return Sk16b(0,0,0, this->kth< 3>(),
104 0,0,0, this->kth< 7>(), 104 0,0,0, this->kth< 7>(),
105 0,0,0, this->kth<11>(), 105 0,0,0, this->kth<11>(),
106 0,0,0, this->kth<15>()); 106 0,0,0, this->kth<15>());
107 } 107 }
108 108
109 inline Sk4px Sk4px::Load4(const SkPMColor16 src[4]) {
110 SkPMColor src32[4];
111 for (int i = 0; i < 4; i++) { src32[i] = SkPixel16ToPixel32(src[i]); }
112 return Load4(src32);
113 }
114 inline Sk4px Sk4px::Load2(const SkPMColor16 src[2]) {
115 SkPMColor src32[2];
116 for (int i = 0; i < 2; i++) { src32[i] = SkPixel16ToPixel32(src[i]); }
117 return Load2(src32);
118 }
119 inline Sk4px Sk4px::Load1(const SkPMColor16 src[1]) {
120 SkPMColor src32 = SkPixel16ToPixel32(src[0]);
121 return Load1(&src32);
122 }
123
124 inline void Sk4px::store4(SkPMColor16 dst[4]) const {
125 SkPMColor dst32[4];
126 this->store4(dst32);
127 for (int i = 0; i < 4; i++) { dst[i] = SkPixel32ToPixel16(dst32[i]); }
128 }
129 inline void Sk4px::store2(SkPMColor16 dst[2]) const {
130 SkPMColor dst32[2];
131 this->store2(dst32);
132 for (int i = 0; i < 2; i++) { dst[i] = SkPixel32ToPixel16(dst32[i]); }
133 }
134 inline void Sk4px::store1(SkPMColor16 dst[1]) const {
135 SkPMColor dst32;
136 this->store1(&dst32);
137 dst[0] = SkPixel32ToPixel16(dst32);
138 }
139
140 } // namespace 109 } // namespace
OLDNEW
« no previous file with comments | « src/opts/Sk4px_SSE2.h ('k') | src/opts/SkXfermode_opts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698