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

Side by Side Diff: Source/platform/graphics/skia/SkiaUtils.h

Issue 1236363003: Drop WebCoreInterpolationQualityToSkFilterQuality (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Space Created 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/graphics/GraphicsContextState.cpp ('k') | 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 (c) 2006,2007,2008, Google Inc. All rights reserved. 2 * Copyright (c) 2006,2007,2008, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 int PLATFORM_EXPORT clampedAlphaForBlending(float); 54 int PLATFORM_EXPORT clampedAlphaForBlending(float);
55 55
56 // Multiply a color's alpha channel by an additional alpha factor where 56 // Multiply a color's alpha channel by an additional alpha factor where
57 // alpha is in the range [0, 1]. 57 // alpha is in the range [0, 1].
58 SkColor PLATFORM_EXPORT scaleAlpha(SkColor, float); 58 SkColor PLATFORM_EXPORT scaleAlpha(SkColor, float);
59 59
60 // Multiply a color's alpha channel by an additional alpha factor where 60 // Multiply a color's alpha channel by an additional alpha factor where
61 // alpha is in the range [0, 256]. 61 // alpha is in the range [0, 256].
62 SkColor PLATFORM_EXPORT scaleAlpha(SkColor, int); 62 SkColor PLATFORM_EXPORT scaleAlpha(SkColor, int);
63 63
64 inline SkFilterQuality WebCoreInterpolationQualityToSkFilterQuality(Interpolatio nQuality quality)
65 {
66 // FIXME: this reflects existing client mappings, but should probably
67 // be expanded to map higher level interpolations more accurately.
68 return quality != InterpolationNone ? kLow_SkFilterQuality : kNone_SkFilterQ uality;
69 }
70
71 // Skia has problems when passed infinite, etc floats, filter them to 0. 64 // Skia has problems when passed infinite, etc floats, filter them to 0.
72 inline SkScalar WebCoreFloatToSkScalar(float f) 65 inline SkScalar WebCoreFloatToSkScalar(float f)
73 { 66 {
74 return SkFloatToScalar(std::isfinite(f) ? f : 0); 67 return SkFloatToScalar(std::isfinite(f) ? f : 0);
75 } 68 }
76 69
77 inline SkScalar WebCoreDoubleToSkScalar(double d) 70 inline SkScalar WebCoreDoubleToSkScalar(double d)
78 { 71 {
79 return SkDoubleToScalar(std::isfinite(d) ? d : 0); 72 return SkDoubleToScalar(std::isfinite(d) ? d : 0);
80 } 73 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 SkASSERT(radius >= 0); 123 SkASSERT(radius >= 0);
131 return 0.288675f * radius + 0.5f; 124 return 0.288675f * radius + 0.5f;
132 } 125 }
133 126
134 template<typename PrimitiveType> 127 template<typename PrimitiveType>
135 void drawPlatformFocusRing(const PrimitiveType&, SkCanvas*, SkColor, int width); 128 void drawPlatformFocusRing(const PrimitiveType&, SkCanvas*, SkColor, int width);
136 129
137 } // namespace blink 130 } // namespace blink
138 131
139 #endif // SkiaUtils_h 132 #endif // SkiaUtils_h
OLDNEW
« no previous file with comments | « Source/platform/graphics/GraphicsContextState.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698