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

Side by Side Diff: src/core/SkMipMap.cpp

Issue 2145663003: Expand _01 half<->float limitation to _finite. Simplify. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: drop _mm_packus_epi32 for now. Created 4 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
« no previous file with comments | « src/core/SkLinearBitmapPipeline_sample.h ('k') | src/core/SkSpanProcs.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 2013 Google Inc. 2 * Copyright 2013 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 "SkMipMap.h" 8 #include "SkMipMap.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 return x; 78 return x;
79 } 79 }
80 static uint8_t Compact(unsigned x) { 80 static uint8_t Compact(unsigned x) {
81 return (uint8_t)x; 81 return (uint8_t)x;
82 } 82 }
83 }; 83 };
84 84
85 struct ColorTypeFilter_F16 { 85 struct ColorTypeFilter_F16 {
86 typedef uint64_t Type; // SkHalf x4 86 typedef uint64_t Type; // SkHalf x4
87 static Sk4f Expand(uint64_t x) { 87 static Sk4f Expand(uint64_t x) {
88 return SkHalfToFloat_01(x); 88 return SkHalfToFloat_finite(x);
89 } 89 }
90 static uint64_t Compact(const Sk4f& x) { 90 static uint64_t Compact(const Sk4f& x) {
91 return SkFloatToHalf_01(x); 91 return SkFloatToHalf_finite(x);
92 } 92 }
93 }; 93 };
94 94
95 template <typename T> T add_121(const T& a, const T& b, const T& c) { 95 template <typename T> T add_121(const T& a, const T& b, const T& c) {
96 return a + b + b + c; 96 return a + b + b + c;
97 } 97 }
98 98
99 template <typename T> T shift_right(const T& x, int bits) { 99 template <typename T> T shift_right(const T& x, int bits) {
100 return x >> bits; 100 return x >> bits;
101 } 101 }
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 return false; 625 return false;
626 } 626 }
627 if (index > fCount - 1) { 627 if (index > fCount - 1) {
628 return false; 628 return false;
629 } 629 }
630 if (levelPtr) { 630 if (levelPtr) {
631 *levelPtr = fLevels[index]; 631 *levelPtr = fLevels[index];
632 } 632 }
633 return true; 633 return true;
634 } 634 }
OLDNEW
« no previous file with comments | « src/core/SkLinearBitmapPipeline_sample.h ('k') | src/core/SkSpanProcs.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698