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

Side by Side Diff: gm/drawbitmaprect.cpp

Issue 51033004: add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warning (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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/blurquickreject.cpp ('k') | gm/giantbitmap.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 } 156 }
157 157
158 { 158 {
159 // test the following code path: 159 // test the following code path:
160 // SkGpuDevice::drawPath() -> SkGpuDevice::drawWithMaskFilter() 160 // SkGpuDevice::drawPath() -> SkGpuDevice::drawWithMaskFilter()
161 SkIRect srcRect; 161 SkIRect srcRect;
162 SkPaint paint; 162 SkPaint paint;
163 SkBitmap bm; 163 SkBitmap bm;
164 164
165 bm = make_chessbm(5, 5); 165 bm = make_chessbm(5, 5);
166 paint.setFilterBitmap(true); 166 paint.setFilterLevel(SkPaint::kLow_FilterLevel);
167 167
168 srcRect.setXYWH(1, 1, 3, 3); 168 srcRect.setXYWH(1, 1, 3, 3);
169 SkMaskFilter* mf = SkBlurMaskFilter::Create( 169 SkMaskFilter* mf = SkBlurMaskFilter::Create(
170 SkBlurMaskFilter::kNormal_BlurStyle, 170 SkBlurMaskFilter::kNormal_BlurStyle,
171 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)), 171 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)),
172 SkBlurMaskFilter::kHighQuality_BlurFlag | 172 SkBlurMaskFilter::kHighQuality_BlurFlag |
173 SkBlurMaskFilter::kIgnoreTransform_BlurFlag); 173 SkBlurMaskFilter::kIgnoreTransform_BlurFlag);
174 paint.setMaskFilter(mf)->unref(); 174 paint.setMaskFilter(mf)->unref();
175 canvas->drawBitmapRect(bm, &srcRect, dstRect, &paint); 175 canvas->drawBitmapRect(bm, &srcRect, dstRect, &paint);
176 } 176 }
177 } 177 }
178 178
179 private: 179 private:
180 typedef GM INHERITED; 180 typedef GM INHERITED;
181 }; 181 };
182 182
183 ////////////////////////////////////////////////////////////////////////////// 183 //////////////////////////////////////////////////////////////////////////////
184 184
185 #ifndef SK_BUILD_FOR_ANDROID 185 #ifndef SK_BUILD_FOR_ANDROID
186 static GM* MyFactory(void*) { return new DrawBitmapRectGM; } 186 static GM* MyFactory(void*) { return new DrawBitmapRectGM; }
187 static GMRegistry reg(MyFactory); 187 static GMRegistry reg(MyFactory);
188 #endif 188 #endif
189 } 189 }
OLDNEW
« no previous file with comments | « gm/blurquickreject.cpp ('k') | gm/giantbitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698