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

Side by Side Diff: src/effects/gradients/SkLinearGradient.cpp

Issue 1489233005: Don't use the Sk4f gradient impl without SIMD (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: SKNX_IS_FAST 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
« no previous file with comments | « no previous file | src/opts/SkNx_avx.h » ('j') | 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 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkLinearGradient.h" 8 #include "SkLinearGradient.h"
9 9
10 static const float kInv255Float = 1.0f / 255; 10 static const float kInv255Float = 1.0f / 255;
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 } while (--count != 0); 275 } while (--count != 0);
276 } 276 }
277 277
278 } 278 }
279 279
280 void SkLinearGradient::LinearGradientContext::shadeSpan(int x, int y, SkPMColor* SK_RESTRICT dstC, 280 void SkLinearGradient::LinearGradientContext::shadeSpan(int x, int y, SkPMColor* SK_RESTRICT dstC,
281 int count) { 281 int count) {
282 SkASSERT(count > 0); 282 SkASSERT(count > 0);
283 const SkLinearGradient& linearGradient = static_cast<const SkLinearGradient& >(fShader); 283 const SkLinearGradient& linearGradient = static_cast<const SkLinearGradient& >(fShader);
284 284
285 #ifndef SK_SUPPORT_LEGACY_LINEAR_GRADIENT_TABLE 285 // Only use the Sk4f impl when known to be fast.
286 #if defined(SKNX_IS_FAST)
286 if (SkShader::kClamp_TileMode == linearGradient.fTileMode && 287 if (SkShader::kClamp_TileMode == linearGradient.fTileMode &&
287 kLinear_MatrixClass == fDstToIndexClass) 288 kLinear_MatrixClass == fDstToIndexClass)
288 { 289 {
289 this->shade4_clamp(x, y, dstC, count); 290 this->shade4_clamp(x, y, dstC, count);
290 return; 291 return;
291 } 292 }
292 #endif 293 #endif
293 294
294 SkPoint srcPt; 295 SkPoint srcPt;
295 SkMatrix::MapXYProc dstProc = fDstToIndexProc; 296 SkMatrix::MapXYProc dstProc = fDstToIndexProc;
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 } 916 }
916 } else { 917 } else {
917 if (fApplyAlphaAfterInterp) { 918 if (fApplyAlphaAfterInterp) {
918 this->shade4_dx_clamp<true, false>(dstC, count, fx, dx, invDx, dithe r); 919 this->shade4_dx_clamp<true, false>(dstC, count, fx, dx, invDx, dithe r);
919 } else { 920 } else {
920 this->shade4_dx_clamp<false, false>(dstC, count, fx, dx, invDx, dith er); 921 this->shade4_dx_clamp<false, false>(dstC, count, fx, dx, invDx, dith er);
921 } 922 }
922 } 923 }
923 } 924 }
924 925
OLDNEW
« no previous file with comments | « no previous file | src/opts/SkNx_avx.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698