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/bitmapmatrix.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 2012 Google Inc. 3 * Copyright 2012 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 "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 canvas->drawBitmapMatrix(bm, matrix, &paint); 76 canvas->drawBitmapMatrix(bm, matrix, &paint);
77 77
78 { 78 {
79 // test the following code path: 79 // test the following code path:
80 // SkGpuDevice::drawPath() -> SkGpuDevice::drawWithMaskFilter() 80 // SkGpuDevice::drawPath() -> SkGpuDevice::drawWithMaskFilter()
81 SkPaint paint; 81 SkPaint paint;
82 82
83 paint.setFilterBitmap(true); 83 paint.setFilterBitmap(true);
84 84
85 SkMaskFilter* mf = SkBlurMaskFilter::Create( 85 SkMaskFilter* mf = SkBlurMaskFilter::Create(
86 5,
87 SkBlurMaskFilter::kNormal_BlurStyle, 86 SkBlurMaskFilter::kNormal_BlurStyle,
87 SkFloatToScalar(3.38675f),
88 SkBlurMaskFilter::kHighQuality_BlurFlag | 88 SkBlurMaskFilter::kHighQuality_BlurFlag |
89 SkBlurMaskFilter::kIgnoreTransform_BlurFlag); 89 SkBlurMaskFilter::kIgnoreTransform_BlurFlag);
90 paint.setMaskFilter(mf)->unref(); 90 paint.setMaskFilter(mf)->unref();
91 91
92 canvas->translate(SkIntToScalar(bm.width()*2 + 20), 0); 92 canvas->translate(SkIntToScalar(bm.width()*2 + 20), 0);
93 93
94 matrix.reset(); 94 matrix.reset();
95 matrix.setRotate(SkIntToScalar(45), SkIntToScalar(bm.width() / 2), 95 matrix.setRotate(SkIntToScalar(45), SkIntToScalar(bm.width() / 2),
96 SkIntToScalar(bm.height() / 2)); 96 SkIntToScalar(bm.height() / 2));
97 97
(...skipping 24 matching lines...) Expand all
122 canvas.drawPath(path, paint); 122 canvas.drawPath(path, paint);
123 } 123 }
124 }; 124 };
125 125
126 //////////////////////////////////////////////////////////////////////////////// 126 ////////////////////////////////////////////////////////////////////////////////
127 127
128 static GM* MyFactory(void*) { return new DrawBitmapMatrixGM; } 128 static GM* MyFactory(void*) { return new DrawBitmapMatrixGM; }
129 static GMRegistry reg(MyFactory); 129 static GMRegistry reg(MyFactory);
130 130
131 } 131 }
OLDNEW
« bench/BlurBench.cpp ('K') | « bench/RectoriBench.cpp ('k') | gm/bleed.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698