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

Side by Side Diff: gm/bigblurs.cpp

Issue 1852113003: switch maskfilters to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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/RectoriBench.cpp ('k') | gm/bleed.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 2013 Google Inc. 2 * Copyright 2013 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 outlinePaint.setStyle(SkPaint::kStroke_Style); 63 outlinePaint.setStyle(SkPaint::kStroke_Style);
64 64
65 SkPaint blurPaint; 65 SkPaint blurPaint;
66 blurPaint.setAntiAlias(true); 66 blurPaint.setAntiAlias(true);
67 blurPaint.setColor(SK_ColorBLACK); 67 blurPaint.setColor(SK_ColorBLACK);
68 68
69 int desiredX = 0, desiredY = 0; 69 int desiredX = 0, desiredY = 0;
70 70
71 for (int i = 0; i < 2; ++i) { 71 for (int i = 0; i < 2; ++i) {
72 for (int j = 0; j <= kLastEnum_SkBlurStyle; ++j) { 72 for (int j = 0; j <= kLastEnum_SkBlurStyle; ++j) {
73 SkMaskFilter* mf = SkBlurMaskFilter::Create((SkBlurStyle)j, kSig ma); 73 blurPaint.setMaskFilter(SkBlurMaskFilter::Make((SkBlurStyle)j, k Sigma));
74 blurPaint.setMaskFilter(mf)->unref();
75 74
76 for (int k = 0; k < (int)SK_ARRAY_COUNT(origins); ++k) { 75 for (int k = 0; k < (int)SK_ARRAY_COUNT(origins); ++k) {
77 canvas->save(); 76 canvas->save();
78 77
79 SkRect clipRect = SkRect::MakeXYWH(SkIntToScalar(desiredX), 78 SkRect clipRect = SkRect::MakeXYWH(SkIntToScalar(desiredX),
80 SkIntToScalar(desiredY), 79 SkIntToScalar(desiredY),
81 SkIntToScalar(kCloseUpSiz e), 80 SkIntToScalar(kCloseUpSiz e),
82 SkIntToScalar(kCloseUpSiz e)); 81 SkIntToScalar(kCloseUpSiz e));
83 82
84 canvas->clipRect(clipRect, SkRegion::kReplace_Op, false); 83 canvas->clipRect(clipRect, SkRegion::kReplace_Op, false);
(...skipping 21 matching lines...) Expand all
106 private: 105 private:
107 static const int kCloseUpSize = 64; 106 static const int kCloseUpSize = 64;
108 static const int kWidth = 5 * kCloseUpSize; 107 static const int kWidth = 5 * kCloseUpSize;
109 static const int kHeight = 2 * (kLastEnum_SkBlurStyle + 1) * kCloseUpSize; 108 static const int kHeight = 2 * (kLastEnum_SkBlurStyle + 1) * kCloseUpSize;
110 109
111 typedef GM INHERITED; 110 typedef GM INHERITED;
112 }; 111 };
113 112
114 DEF_GM(return new BigBlursGM;) 113 DEF_GM(return new BigBlursGM;)
115 } 114 }
OLDNEW
« no previous file with comments | « bench/RectoriBench.cpp ('k') | gm/bleed.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698