| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 PaintCanvas*, | 134 PaintCanvas*, |
| 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 PaintCanvas::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 ? PaintCanvas::kStrict_SrcRectConstraint |
| 143 : SkCanvas::kFast_SrcRectConstraint; | 143 : PaintCanvas::kFast_SrcRectConstraint; |
| 144 } | 144 } |
| 145 | 145 |
| 146 // Skia's smart pointer APIs are preferable over their legacy raw pointer | 146 // Skia's smart pointer APIs are preferable over their legacy raw pointer |
| 147 // counterparts. | 147 // counterparts. |
| 148 // | 148 // |
| 149 // General guidelines | 149 // General guidelines |
| 150 // | 150 // |
| 151 // When receiving ref counted objects from Skia: | 151 // When receiving ref counted objects from Skia: |
| 152 // | 152 // |
| 153 // 1) Use sk_sp-based Skia factories if available (e.g. SkShader::MakeFoo() | 153 // 1) Use sk_sp-based Skia factories if available (e.g. SkShader::MakeFoo() |
| (...skipping 19 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 |