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

Side by Side Diff: gm/drawbitmaprect.cpp

Issue 253833002: move common blur types into central header (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 6 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 | Annotate | Revision Log
« no previous file with comments | « gm/circles.cpp ('k') | gm/drawlooper.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 // SkGpuDevice::drawPath() -> SkGpuDevice::drawWithMaskFilter() 156 // SkGpuDevice::drawPath() -> SkGpuDevice::drawWithMaskFilter()
157 SkIRect srcRect; 157 SkIRect srcRect;
158 SkPaint paint; 158 SkPaint paint;
159 SkBitmap bm; 159 SkBitmap bm;
160 160
161 bm = make_chessbm(5, 5); 161 bm = make_chessbm(5, 5);
162 paint.setFilterLevel(SkPaint::kLow_FilterLevel); 162 paint.setFilterLevel(SkPaint::kLow_FilterLevel);
163 163
164 srcRect.setXYWH(1, 1, 3, 3); 164 srcRect.setXYWH(1, 1, 3, 3);
165 SkMaskFilter* mf = SkBlurMaskFilter::Create( 165 SkMaskFilter* mf = SkBlurMaskFilter::Create(
166 SkBlurMaskFilter::kNormal_BlurStyle, 166 kNormal_SkBlurStyle,
167 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)), 167 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)),
168 SkBlurMaskFilter::kHighQuality_BlurFlag | 168 SkBlurMaskFilter::kHighQuality_BlurFlag |
169 SkBlurMaskFilter::kIgnoreTransform_BlurFlag); 169 SkBlurMaskFilter::kIgnoreTransform_BlurFlag);
170 paint.setMaskFilter(mf)->unref(); 170 paint.setMaskFilter(mf)->unref();
171 canvas->drawBitmapRect(bm, &srcRect, dstRect, &paint); 171 canvas->drawBitmapRect(bm, &srcRect, dstRect, &paint);
172 } 172 }
173 } 173 }
174 174
175 private: 175 private:
176 typedef GM INHERITED; 176 typedef GM INHERITED;
177 }; 177 };
178 178
179 ////////////////////////////////////////////////////////////////////////////// 179 //////////////////////////////////////////////////////////////////////////////
180 180
181 static GM* MyFactory(void*) { return new DrawBitmapRectGM; } 181 static GM* MyFactory(void*) { return new DrawBitmapRectGM; }
182 static GMRegistry reg(MyFactory); 182 static GMRegistry reg(MyFactory);
183 } 183 }
OLDNEW
« no previous file with comments | « gm/circles.cpp ('k') | gm/drawlooper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698