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

Side by Side Diff: include/core/SkColor.h

Issue 2264643002: Added SkColor4f::FromColor3f(SkColor3f, float a) (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Removed header include from .cpp file Created 4 years, 4 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 | src/core/SkColor.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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 SkColor_DEFINED 8 #ifndef SkColor_DEFINED
9 #define SkColor_DEFINED 9 #define SkColor_DEFINED
10 10
11 #include "SkScalar.h" 11 #include "SkScalar.h"
12 #include "SkPoint3.h"
12 #include "SkTypes.h" 13 #include "SkTypes.h"
13 14
14 /** \file SkColor.h 15 /** \file SkColor.h
15 16
16 Types and macros for colors 17 Types and macros for colors
17 */ 18 */
18 19
19 /** 8-bit type for an alpha value. 0xFF is 100% opaque, 0x00 is 100% transparent . 20 /** 8-bit type for an alpha value. 0xFF is 100% opaque, 0x00 is 100% transparent .
20 */ 21 */
21 typedef uint8_t SkAlpha; 22 typedef uint8_t SkAlpha;
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 } 177 }
177 bool operator!=(const SkColor4f& other) const { 178 bool operator!=(const SkColor4f& other) const {
178 return !(*this == other); 179 return !(*this == other);
179 } 180 }
180 181
181 const float* vec() const { return &fR; } 182 const float* vec() const { return &fR; }
182 float* vec() { return &fR; } 183 float* vec() { return &fR; }
183 184
184 static SkColor4f Pin(float r, float g, float b, float a); 185 static SkColor4f Pin(float r, float g, float b, float a);
185 static SkColor4f FromColor(SkColor); 186 static SkColor4f FromColor(SkColor);
187 static SkColor4f FromColor3f(SkColor3f, float a);
186 188
187 SkColor toSkColor() const; 189 SkColor toSkColor() const;
188 190
189 SkColor4f pin() const { 191 SkColor4f pin() const {
190 return Pin(fR, fG, fB, fA); 192 return Pin(fR, fG, fB, fA);
191 } 193 }
192 194
193 SkPM4f premul() const; 195 SkPM4f premul() const;
194 }; 196 };
195 197
196 #endif 198 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkColor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698