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

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

Issue 2386033002: Scale focus outline thickness with zoom level. (Closed)
Patch Set: merge conflicts Created 4 years, 2 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
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // This replicates the old skia behavior when it used to take radius for blur. 124 // This replicates the old skia behavior when it used to take radius for blur.
125 // Now it takes sigma. 125 // Now it takes sigma.
126 inline SkScalar skBlurRadiusToSigma(SkScalar radius) { 126 inline SkScalar skBlurRadiusToSigma(SkScalar radius) {
127 SkASSERT(radius >= 0); 127 SkASSERT(radius >= 0);
128 if (radius == 0) 128 if (radius == 0)
129 return 0.0f; 129 return 0.0f;
130 return 0.288675f * radius + 0.5f; 130 return 0.288675f * radius + 0.5f;
131 } 131 }
132 132
133 template <typename PrimitiveType> 133 template <typename PrimitiveType>
134 void drawPlatformFocusRing(const PrimitiveType&, SkCanvas*, SkColor, int width); 134 void drawPlatformFocusRing(const PrimitiveType&,
135 SkCanvas*,
136 SkColor,
137 float width);
135 138
136 // TODO(fmalita): remove in favor of direct SrcRectConstraint use. 139 // TODO(fmalita): remove in favor of direct SrcRectConstraint use.
137 inline SkCanvas::SrcRectConstraint WebCoreClampingModeToSkiaRectConstraint( 140 inline SkCanvas::SrcRectConstraint WebCoreClampingModeToSkiaRectConstraint(
138 Image::ImageClampingMode clampMode) { 141 Image::ImageClampingMode clampMode) {
139 return clampMode == Image::ClampImageToSourceRect 142 return clampMode == Image::ClampImageToSourceRect
140 ? SkCanvas::kStrict_SrcRectConstraint 143 ? SkCanvas::kStrict_SrcRectConstraint
141 : SkCanvas::kFast_SrcRectConstraint; 144 : SkCanvas::kFast_SrcRectConstraint;
142 } 145 }
143 146
144 // Skia's smart pointer APIs are preferable over their legacy raw pointer 147 // Skia's smart pointer APIs are preferable over their legacy raw pointer
(...skipping 26 matching lines...) Expand all
171 // paint.setShader(SkShader::MakeFoo(...)); 174 // paint.setShader(SkShader::MakeFoo(...));
172 // 175 //
173 // b) shared ownership 176 // b) shared ownership
174 // 177 //
175 // sk_sp<SkShader> shader = SkShader::MakeFoo(...); 178 // sk_sp<SkShader> shader = SkShader::MakeFoo(...);
176 // paint.setShader(shader); 179 // paint.setShader(shader);
177 180
178 } // namespace blink 181 } // namespace blink
179 182
180 #endif // SkiaUtils_h 183 #endif // SkiaUtils_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698