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

Side by Side Diff: gm/blurrect.cpp

Issue 1117423003: remove redundant/deprecated TwoPointRadial gradiet -- use TwoPointConical (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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 | « bench/GradientBench.cpp ('k') | gm/blurroundrect.cpp » ('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 "gm.h" 8 #include "gm.h"
9 #include "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 const SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, }; 67 const SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, };
68 const SkScalar pos[] = { SK_Scalar1/4, SK_Scalar1*3/4 }; 68 const SkScalar pos[] = { SK_Scalar1/4, SK_Scalar1*3/4 };
69 SkMatrix scale; 69 SkMatrix scale;
70 scale.setScale(0.5f, 0.5f); 70 scale.setScale(0.5f, 0.5f);
71 scale.postTranslate(25.f, 25.f); 71 scale.postTranslate(25.f, 25.f);
72 SkPoint center0, center1; 72 SkPoint center0, center1;
73 center0.set(SkScalarAve(pts[0].fX, pts[1].fX), 73 center0.set(SkScalarAve(pts[0].fX, pts[1].fX),
74 SkScalarAve(pts[0].fY, pts[1].fY)); 74 SkScalarAve(pts[0].fY, pts[1].fY));
75 center1.set(SkScalarInterp(pts[0].fX, pts[1].fX, SkIntToScalar(3)/5), 75 center1.set(SkScalarInterp(pts[0].fX, pts[1].fX, SkIntToScalar(3)/5),
76 SkScalarInterp(pts[0].fY, pts[1].fY, SkIntToScalar(1)/4)); 76 SkScalarInterp(pts[0].fY, pts[1].fY, SkIntToScalar(1)/4));
77 return SkGradientShader::CreateTwoPointRadial(center1, (pts[1].fX - pts[0].f X) / 7, 77 return SkGradientShader::CreateTwoPointConical(center1, (pts[1].fX - pts[0]. fX) / 7,
78 center0, (pts[1].fX - pts[0].f X) / 2, 78 center0, (pts[1].fX - pts[0].f X) / 2,
79 colors, pos, SK_ARRAY_COUNT(co lors), tm, 79 colors, pos, SK_ARRAY_COUNT(co lors), tm,
80 0, &scale); 80 0, &scale);
81 } 81 }
82 82
83 typedef void (*PaintProc)(SkPaint*, SkScalar width); 83 typedef void (*PaintProc)(SkPaint*, SkScalar width);
84 84
85 class BlurRectGM : public skiagm::GM { 85 class BlurRectGM : public skiagm::GM {
86 SkAutoTUnref<SkMaskFilter> fMaskFilters[kLastEnum_SkBlurStyle + 1]; 86 SkAutoTUnref<SkMaskFilter> fMaskFilters[kLastEnum_SkBlurStyle + 1];
87 SkString fName; 87 SkString fName;
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 } 411 }
412 private: 412 private:
413 typedef BlurRectCompareGM INHERITED; 413 typedef BlurRectCompareGM INHERITED;
414 }; 414 };
415 415
416 416
417 ////////////////////////////////////////////////////////////////////////////// 417 //////////////////////////////////////////////////////////////////////////////
418 418
419 DEF_GM(return new BlurRectGM("blurrects", 0xFF);) 419 DEF_GM(return new BlurRectGM("blurrects", 0xFF);)
420 DEF_GM(return new BlurRectDirectGM("blurrect_gallery");) 420 DEF_GM(return new BlurRectDirectGM("blurrect_gallery");)
OLDNEW
« no previous file with comments | « bench/GradientBench.cpp ('k') | gm/blurroundrect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698