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

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

Issue 1512803004: Use refs for GraphicsContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarTheme
Patch Set: Created 5 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
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 return RULE_NONZERO; 96 return RULE_NONZERO;
97 } 97 }
98 98
99 // Determine if a given WebKit point is contained in a path 99 // Determine if a given WebKit point is contained in a path
100 bool SkPathContainsPoint(const SkPath&, const FloatPoint&, SkPath::FillType); 100 bool SkPathContainsPoint(const SkPath&, const FloatPoint&, SkPath::FillType);
101 101
102 SkMatrix PLATFORM_EXPORT affineTransformToSkMatrix(const AffineTransform&); 102 SkMatrix PLATFORM_EXPORT affineTransformToSkMatrix(const AffineTransform&);
103 103
104 bool nearlyIntegral(float value); 104 bool nearlyIntegral(float value);
105 105
106 InterpolationQuality limitInterpolationQuality(const GraphicsContext*, Interpola tionQuality resampling); 106 InterpolationQuality limitInterpolationQuality(const GraphicsContext&, Interpola tionQuality resampling);
107 107
108 InterpolationQuality computeInterpolationQuality( 108 InterpolationQuality computeInterpolationQuality(
109 float srcWidth, 109 float srcWidth,
110 float srcHeight, 110 float srcHeight,
111 float destWidth, 111 float destWidth,
112 float destHeight, 112 float destHeight,
113 bool isDataComplete = true); 113 bool isDataComplete = true);
114 114
115 // This replicates the old skia behavior when it used to take radius for blur. N ow it takes sigma. 115 // This replicates the old skia behavior when it used to take radius for blur. N ow it takes sigma.
116 inline SkScalar skBlurRadiusToSigma(SkScalar radius) 116 inline SkScalar skBlurRadiusToSigma(SkScalar radius)
117 { 117 {
118 SkASSERT(radius >= 0); 118 SkASSERT(radius >= 0);
119 return 0.288675f * radius; 119 return 0.288675f * radius;
120 } 120 }
121 121
122 template<typename PrimitiveType> 122 template<typename PrimitiveType>
123 void drawPlatformFocusRing(const PrimitiveType&, SkCanvas*, SkColor, int width); 123 void drawPlatformFocusRing(const PrimitiveType&, SkCanvas*, SkColor, int width);
124 124
125 // TODO(fmalita): remove in favor of direct SrcRectConstraint use. 125 // TODO(fmalita): remove in favor of direct SrcRectConstraint use.
126 inline SkCanvas::SrcRectConstraint WebCoreClampingModeToSkiaRectConstraint(Image ::ImageClampingMode clampMode) 126 inline SkCanvas::SrcRectConstraint WebCoreClampingModeToSkiaRectConstraint(Image ::ImageClampingMode clampMode)
127 { 127 {
128 return clampMode == Image::ClampImageToSourceRect 128 return clampMode == Image::ClampImageToSourceRect
129 ? SkCanvas::kStrict_SrcRectConstraint 129 ? SkCanvas::kStrict_SrcRectConstraint
130 : SkCanvas::kFast_SrcRectConstraint; 130 : SkCanvas::kFast_SrcRectConstraint;
131 } 131 }
132 132
133 } // namespace blink 133 } // namespace blink
134 134
135 #endif // SkiaUtils_h 135 #endif // SkiaUtils_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698