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

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

Issue 2173083002: Always use kFast_SrcRectConstraint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 return 0.0f; 118 return 0.0f;
119 return 0.288675f * radius + 0.5f; 119 return 0.288675f * radius + 0.5f;
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 SkCanvas::kFast_SrcRectConstraint;
129 ? SkCanvas::kStrict_SrcRectConstraint
130 : SkCanvas::kFast_SrcRectConstraint;
131 } 129 }
132 130
133 // Skia's smart pointer APIs are preferable over their legacy raw pointer counte rparts. 131 // Skia's smart pointer APIs are preferable over their legacy raw pointer counte rparts.
134 // The following helpers ensure interoperability between Skia's SkRefCnt wrapper sk_sp<T> and 132 // The following helpers ensure interoperability between Skia's SkRefCnt wrapper sk_sp<T> and
135 // Blink's RefPtr<T>/PassRefPtr<T>. 133 // Blink's RefPtr<T>/PassRefPtr<T>.
136 // 134 //
137 // - fromSkSp(sk_sp<T>): adopts an sk_sp into a PassRefPtr (to be used w hen transferring 135 // - fromSkSp(sk_sp<T>): adopts an sk_sp into a PassRefPtr (to be used w hen transferring
138 // ownership from Skia to Blink). 136 // ownership from Skia to Blink).
139 // - toSkSp(PassRefPtr<T>): releases a PassRefPtr into a sk_sp (to be used when transferring 137 // - toSkSp(PassRefPtr<T>): releases a PassRefPtr into a sk_sp (to be used when transferring
140 // ownership from Blink to Skia). 138 // ownership from Blink to Skia).
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 } 201 }
204 202
205 template <typename T> sk_sp<T> toSkSp(const RefPtr<T>& ref) 203 template <typename T> sk_sp<T> toSkSp(const RefPtr<T>& ref)
206 { 204 {
207 return toSkSp(PassRefPtr<T>(ref)); 205 return toSkSp(PassRefPtr<T>(ref));
208 } 206 }
209 207
210 } // namespace blink 208 } // namespace blink
211 209
212 #endif // SkiaUtils_h 210 #endif // SkiaUtils_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698