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

Side by Side Diff: gm/drawbitmaprect.cpp

Issue 23701006: Push sigma-based blur interface into our GMs/benches/tests/samplecode (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Cleaned up Created 7 years, 3 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
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 "SkShader.h" 9 #include "SkShader.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 // SkGpuDevice::drawPath() -> SkGpuDevice::drawWithMaskFilter() 162 // SkGpuDevice::drawPath() -> SkGpuDevice::drawWithMaskFilter()
163 SkIRect srcRect; 163 SkIRect srcRect;
164 SkPaint paint; 164 SkPaint paint;
165 SkBitmap bm; 165 SkBitmap bm;
166 166
167 bm = make_chessbm(5, 5); 167 bm = make_chessbm(5, 5);
168 paint.setFilterBitmap(true); 168 paint.setFilterBitmap(true);
169 169
170 srcRect.setXYWH(1, 1, 3, 3); 170 srcRect.setXYWH(1, 1, 3, 3);
171 SkMaskFilter* mf = SkBlurMaskFilter::Create( 171 SkMaskFilter* mf = SkBlurMaskFilter::Create(
172 5,
173 SkBlurMaskFilter::kNormal_BlurStyle, 172 SkBlurMaskFilter::kNormal_BlurStyle,
173 SkFloatToScalar(3.38675f),
174 SkBlurMaskFilter::kHighQuality_BlurFlag | 174 SkBlurMaskFilter::kHighQuality_BlurFlag |
175 SkBlurMaskFilter::kIgnoreTransform_BlurFlag); 175 SkBlurMaskFilter::kIgnoreTransform_BlurFlag);
176 paint.setMaskFilter(mf)->unref(); 176 paint.setMaskFilter(mf)->unref();
177 canvas->drawBitmapRect(bm, &srcRect, dstRect, &paint); 177 canvas->drawBitmapRect(bm, &srcRect, dstRect, &paint);
178 } 178 }
179 } 179 }
180 180
181 private: 181 private:
182 typedef GM INHERITED; 182 typedef GM INHERITED;
183 }; 183 };
184 184
185 ////////////////////////////////////////////////////////////////////////////// 185 //////////////////////////////////////////////////////////////////////////////
186 186
187 #ifndef SK_BUILD_FOR_ANDROID 187 #ifndef SK_BUILD_FOR_ANDROID
188 static GM* MyFactory(void*) { return new DrawBitmapRectGM; } 188 static GM* MyFactory(void*) { return new DrawBitmapRectGM; }
189 static GMRegistry reg(MyFactory); 189 static GMRegistry reg(MyFactory);
190 #endif 190 #endif
191 } 191 }
OLDNEW
« bench/BlurBench.cpp ('K') | « gm/circles.cpp ('k') | gm/drawlooper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698