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

Side by Side Diff: src/core/SkHalf.h

Issue 762923003: Add support for half float alpha textures. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix config setup Created 6 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
« no previous file with comments | « include/gpu/GrTypes.h ('k') | src/gpu/GrDrawTarget.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 2014 Google Inc. 2 * Copyright 2014 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 #ifndef SkHalf_DEFINED 8 #ifndef SkHalf_DEFINED
9 #define SkHalf_DEFINED 9 #define SkHalf_DEFINED
10 10
11 #include "SkTypes.h" 11 #include "SkTypes.h"
12 12
13 // 16-bit floating point value 13 // 16-bit floating point value
14 // format is 1 bit sign, 5 bits exponent, 10 bits mantissa 14 // format is 1 bit sign, 5 bits exponent, 10 bits mantissa
15 // only used for storage 15 // only used for storage
16 typedef uint16_t SkHalf; 16 typedef uint16_t SkHalf;
17 17
18 #define SK_HalfMin 0x0400 // 2^-24 (minimum positive normal value)
19 #define SK_HalfMax 0x7bff // 65504
20 #define SK_HalfEpsilon 0x1400 // 2^-10
21
18 // convert between half and single precision floating point 22 // convert between half and single precision floating point
19 float SkHalfToFloat(SkHalf h); 23 float SkHalfToFloat(SkHalf h);
20 SkHalf SkFloatToHalf(float f); 24 SkHalf SkFloatToHalf(float f);
21 25
22 #endif 26 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrTypes.h ('k') | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698