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

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

Issue 1869613003: add header guard to SkPM4fPriv.h to prevent accidental multiple inclusion (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 8 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 | « no previous file | no next file » | 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 2016 Google Inc. 2 * Copyright 2016 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 SkPM4fPriv_DEFINED
9 #define SkPM4fPriv_DEFINED
10
8 #include "SkColorPriv.h" 11 #include "SkColorPriv.h"
9 #include "SkPM4f.h" 12 #include "SkPM4f.h"
10 13
11 static inline float get_alpha(const Sk4f& f4) { 14 static inline float get_alpha(const Sk4f& f4) {
12 return f4[SkPM4f::A]; 15 return f4[SkPM4f::A];
13 } 16 }
14 17
15 static inline Sk4f set_alpha(const Sk4f& f4, float alpha) { 18 static inline Sk4f set_alpha(const Sk4f& f4, float alpha) {
16 static_assert(3 == SkPM4f::A, ""); 19 static_assert(3 == SkPM4f::A, "");
17 return Sk4f(f4[0], f4[1], f4[2], alpha); 20 return Sk4f(f4[0], f4[1], f4[2], alpha);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 return srgb_to_linear(to_4f(src) * Sk4f(1.0f/255)); 52 return srgb_to_linear(to_4f(src) * Sk4f(1.0f/255));
50 } 53 }
51 54
52 static inline uint32_t Sk4f_toL32(const Sk4f& x4) { 55 static inline uint32_t Sk4f_toL32(const Sk4f& x4) {
53 return to_4b(x4 * Sk4f(255) + Sk4f(0.5f)); 56 return to_4b(x4 * Sk4f(255) + Sk4f(0.5f));
54 } 57 }
55 58
56 static inline uint32_t Sk4f_toS32(const Sk4f& x4) { 59 static inline uint32_t Sk4f_toS32(const Sk4f& x4) {
57 return to_4b(linear_to_srgb(x4) * Sk4f(255) + Sk4f(0.5f)); 60 return to_4b(linear_to_srgb(x4) * Sk4f(255) + Sk4f(0.5f));
58 } 61 }
62
63 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698