| OLD | NEW |
| 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 Loading... |
| 124 // Now it takes sigma. | 124 // Now it takes sigma. |
| 125 inline SkScalar skBlurRadiusToSigma(SkScalar radius) { | 125 inline SkScalar skBlurRadiusToSigma(SkScalar radius) { |
| 126 SkASSERT(radius >= 0); | 126 SkASSERT(radius >= 0); |
| 127 if (radius == 0) | 127 if (radius == 0) |
| 128 return 0.0f; | 128 return 0.0f; |
| 129 return 0.288675f * radius + 0.5f; | 129 return 0.288675f * radius + 0.5f; |
| 130 } | 130 } |
| 131 | 131 |
| 132 template <typename PrimitiveType> | 132 template <typename PrimitiveType> |
| 133 void drawPlatformFocusRing(const PrimitiveType&, | 133 void drawPlatformFocusRing(const PrimitiveType&, |
| 134 SkCanvas*, | 134 CdlCanvas*, |
| 135 SkColor, | 135 SkColor, |
| 136 float width); | 136 float width); |
| 137 | 137 |
| 138 // TODO(fmalita): remove in favor of direct SrcRectConstraint use. | 138 // TODO(fmalita): remove in favor of direct SrcRectConstraint use. |
| 139 inline SkCanvas::SrcRectConstraint WebCoreClampingModeToSkiaRectConstraint( | 139 inline SkCanvas::SrcRectConstraint WebCoreClampingModeToSkiaRectConstraint( |
| 140 Image::ImageClampingMode clampMode) { | 140 Image::ImageClampingMode clampMode) { |
| 141 return clampMode == Image::ClampImageToSourceRect | 141 return clampMode == Image::ClampImageToSourceRect |
| 142 ? SkCanvas::kStrict_SrcRectConstraint | 142 ? SkCanvas::kStrict_SrcRectConstraint |
| 143 : SkCanvas::kFast_SrcRectConstraint; | 143 : SkCanvas::kFast_SrcRectConstraint; |
| 144 } | 144 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 173 // paint.setShader(SkShader::MakeFoo(...)); | 173 // paint.setShader(SkShader::MakeFoo(...)); |
| 174 // | 174 // |
| 175 // b) shared ownership | 175 // b) shared ownership |
| 176 // | 176 // |
| 177 // sk_sp<SkShader> shader = SkShader::MakeFoo(...); | 177 // sk_sp<SkShader> shader = SkShader::MakeFoo(...); |
| 178 // paint.setShader(shader); | 178 // paint.setShader(shader); |
| 179 | 179 |
| 180 } // namespace blink | 180 } // namespace blink |
| 181 | 181 |
| 182 #endif // SkiaUtils_h | 182 #endif // SkiaUtils_h |
| OLD | NEW |