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

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

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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 result.set(SkMatrix::kMPersp2, SK_Scalar1); 236 result.set(SkMatrix::kMPersp2, SK_Scalar1);
237 237
238 return result; 238 return result;
239 } 239 }
240 240
241 bool nearlyIntegral(float value) 241 bool nearlyIntegral(float value)
242 { 242 {
243 return fabs(value - floorf(value)) < std::numeric_limits<float>::epsilon(); 243 return fabs(value - floorf(value)) < std::numeric_limits<float>::epsilon();
244 } 244 }
245 245
246 InterpolationQuality limitInterpolationQuality(const GraphicsContext* context, I nterpolationQuality resampling) 246 InterpolationQuality limitInterpolationQuality(const GraphicsContext& context, I nterpolationQuality resampling)
247 { 247 {
248 return std::min(resampling, context->imageInterpolationQuality()); 248 return std::min(resampling, context.imageInterpolationQuality());
249 } 249 }
250 250
251 InterpolationQuality computeInterpolationQuality( 251 InterpolationQuality computeInterpolationQuality(
252 float srcWidth, 252 float srcWidth,
253 float srcHeight, 253 float srcHeight,
254 float destWidth, 254 float destWidth,
255 float destHeight, 255 float destHeight,
256 bool isDataComplete) 256 bool isDataComplete)
257 { 257 {
258 // The percent change below which we will not resample. This usually means 258 // The percent change below which we will not resample. This usually means
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 paint.setAlpha(128); 397 paint.setAlpha(128);
398 paint.setStrokeWidth(paint.getStrokeWidth() * 0.5f); 398 paint.setStrokeWidth(paint.getStrokeWidth() * 0.5f);
399 drawFocusRingPrimitive(primitive, canvas, paint, cornerRadius); 399 drawFocusRingPrimitive(primitive, canvas, paint, cornerRadius);
400 #endif 400 #endif
401 } 401 }
402 402
403 template void PLATFORM_EXPORT drawPlatformFocusRing<SkRect>(const SkRect&, SkCan vas*, SkColor, int width); 403 template void PLATFORM_EXPORT drawPlatformFocusRing<SkRect>(const SkRect&, SkCan vas*, SkColor, int width);
404 template void PLATFORM_EXPORT drawPlatformFocusRing<SkPath>(const SkPath&, SkCan vas*, SkColor, int width); 404 template void PLATFORM_EXPORT drawPlatformFocusRing<SkPath>(const SkPath&, SkCan vas*, SkColor, int width);
405 405
406 } // namespace blink 406 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698