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

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

Issue 412353003: Remove convertToSkiaFilterLevel() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 bool nearlyIntegral(float value) 192 bool nearlyIntegral(float value)
193 { 193 {
194 return fabs(value - floorf(value)) < std::numeric_limits<float>::epsilon(); 194 return fabs(value - floorf(value)) < std::numeric_limits<float>::epsilon();
195 } 195 }
196 196
197 InterpolationQuality limitInterpolationQuality(const GraphicsContext* context, I nterpolationQuality resampling) 197 InterpolationQuality limitInterpolationQuality(const GraphicsContext* context, I nterpolationQuality resampling)
198 { 198 {
199 return std::min(resampling, context->imageInterpolationQuality()); 199 return std::min(resampling, context->imageInterpolationQuality());
200 } 200 }
201 201
202 SkPaint::FilterLevel convertToSkiaFilterLevel(bool useBicubicFilter, Interpolati onQuality resampling)
f(malita) 2014/07/25 15:06:37 Should also delete the declaration from the header
hj.r.chung 2014/07/26 14:22:51 oops! Done
203 {
204 // FIXME: If we get rid of this special case, this function can go away enti rely.
205 if (useBicubicFilter)
206 return SkPaint::kHigh_FilterLevel;
207
208 // InterpolationHigh if useBicubicFilter is false means that we do
209 // a manual high quality resampling before drawing to Skia.
210 if (resampling == InterpolationHigh)
211 return SkPaint::kNone_FilterLevel;
212
213 return static_cast<SkPaint::FilterLevel>(resampling);
214 }
215
216 InterpolationQuality computeInterpolationQuality( 202 InterpolationQuality computeInterpolationQuality(
217 const SkMatrix& matrix, 203 const SkMatrix& matrix,
218 float srcWidth, 204 float srcWidth,
219 float srcHeight, 205 float srcHeight,
220 float destWidth, 206 float destWidth,
221 float destHeight, 207 float destHeight,
222 bool isDataComplete) 208 bool isDataComplete)
223 { 209 {
224 // The percent change below which we will not resample. This usually means 210 // The percent change below which we will not resample. This usually means
225 // an off-by-one error on the web page, and just doing nearest neighbor 211 // an off-by-one error on the web page, and just doing nearest neighbor
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 // though - that's why it's not always on. 311 // though - that's why it's not always on.
326 SkScalar widthExpansion, heightExpansion; 312 SkScalar widthExpansion, heightExpansion;
327 if (totalMatrix.getType() & SkMatrix::kAffine_Mask) 313 if (totalMatrix.getType() & SkMatrix::kAffine_Mask)
328 widthExpansion = totalMatrix[SkMatrix::kMSkewY], heightExpansion = total Matrix[SkMatrix::kMSkewX]; 314 widthExpansion = totalMatrix[SkMatrix::kMSkewY], heightExpansion = total Matrix[SkMatrix::kMSkewX];
329 else 315 else
330 widthExpansion = totalMatrix[SkMatrix::kMScaleX], heightExpansion = tota lMatrix[SkMatrix::kMScaleY]; 316 widthExpansion = totalMatrix[SkMatrix::kMScaleX], heightExpansion = tota lMatrix[SkMatrix::kMScaleY];
331 return destRect.width() * fabs(widthExpansion) < 1 || destRect.height() * fa bs(heightExpansion) < 1; 317 return destRect.width() * fabs(widthExpansion) < 1 || destRect.height() * fa bs(heightExpansion) < 1;
332 } 318 }
333 319
334 } // namespace blink 320 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698