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

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

Issue 2256023002: Flush denorm half floats to zero. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix threshold, clean up tests Created 4 years, 3 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/SkRasterPipelineBlitter.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_finite(x); 88 return SkHalfToFloat_finite_ftz(x);
89 } 89 }
90 static uint64_t Compact(const Sk4f& x) { 90 static uint64_t Compact(const Sk4f& x) {
91 uint64_t r; 91 uint64_t r;
92 SkFloatToHalf_finite(x).store(&r); 92 SkFloatToHalf_finite_ftz(x).store(&r);
93 return r; 93 return r;
94 } 94 }
95 }; 95 };
96 96
97 template <typename T> T add_121(const T& a, const T& b, const T& c) { 97 template <typename T> T add_121(const T& a, const T& b, const T& c) {
98 return a + b + b + c; 98 return a + b + b + c;
99 } 99 }
100 100
101 template <typename T> T shift_right(const T& x, int bits) { 101 template <typename T> T shift_right(const T& x, int bits) {
102 return x >> bits; 102 return x >> bits;
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 return false; 627 return false;
628 } 628 }
629 if (index > fCount - 1) { 629 if (index > fCount - 1) {
630 return false; 630 return false;
631 } 631 }
632 if (levelPtr) { 632 if (levelPtr) {
633 *levelPtr = fLevels[index]; 633 *levelPtr = fLevels[index];
634 } 634 }
635 return true; 635 return true;
636 } 636 }
OLDNEW
« no previous file with comments | « src/core/SkLinearBitmapPipeline_sample.h ('k') | src/core/SkRasterPipelineBlitter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698