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

Side by Side Diff: tests/PaintTest.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 | « tests/BlurTest.cpp ('k') | tools/debugger/SkDrawCommand.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 2011 Google Inc. 2 * Copyright 2011 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 "SkBlurMask.h" 8 #include "SkBlurMask.h"
9 #include "SkBlurMaskFilter.h" 9 #include "SkBlurMaskFilter.h"
10 #include "SkLayerDrawLooper.h" 10 #include "SkLayerDrawLooper.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 DEF_TEST(Paint_copy, reporter) { 141 DEF_TEST(Paint_copy, reporter) {
142 SkPaint paint; 142 SkPaint paint;
143 // set a few member variables 143 // set a few member variables
144 paint.setStyle(SkPaint::kStrokeAndFill_Style); 144 paint.setStyle(SkPaint::kStrokeAndFill_Style);
145 paint.setTextAlign(SkPaint::kLeft_Align); 145 paint.setTextAlign(SkPaint::kLeft_Align);
146 paint.setStrokeWidth(SkIntToScalar(2)); 146 paint.setStrokeWidth(SkIntToScalar(2));
147 // set a few pointers 147 // set a few pointers
148 SkLayerDrawLooper::Builder looperBuilder; 148 SkLayerDrawLooper::Builder looperBuilder;
149 paint.setLooper(looperBuilder.detach()); 149 paint.setLooper(looperBuilder.detach());
150 SkMaskFilter* mask = SkBlurMaskFilter::Create(kNormal_SkBlurStyle, 150 paint.setMaskFilter(SkBlurMaskFilter::Make(kNormal_SkBlurStyle,
151 SkBlurMask::ConvertRadiusToSigma(SkIntToSc alar(1))); 151 SkBlurMask::ConvertRadiusToSigma( 1)));
152 paint.setMaskFilter(mask)->unref();
153 152
154 // copy the paint using the copy constructor and check they are the same 153 // copy the paint using the copy constructor and check they are the same
155 SkPaint copiedPaint = paint; 154 SkPaint copiedPaint = paint;
156 REPORTER_ASSERT(reporter, paint == copiedPaint); 155 REPORTER_ASSERT(reporter, paint == copiedPaint);
157 156
158 // copy the paint using the equal operator and check they are the same 157 // copy the paint using the equal operator and check they are the same
159 copiedPaint = paint; 158 copiedPaint = paint;
160 REPORTER_ASSERT(reporter, paint == copiedPaint); 159 REPORTER_ASSERT(reporter, paint == copiedPaint);
161 160
162 // clean the paint and check they are back to their initial states 161 // clean the paint and check they are back to their initial states
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 359
361 SkColorMatrix cm; 360 SkColorMatrix cm;
362 cm.setIdentity(); // does not change alpha 361 cm.setIdentity(); // does not change alpha
363 paint.setColorFilter(SkColorFilter::MakeMatrixFilterRowMajor255(cm.fMat)); 362 paint.setColorFilter(SkColorFilter::MakeMatrixFilterRowMajor255(cm.fMat));
364 REPORTER_ASSERT(r, paint.nothingToDraw()); 363 REPORTER_ASSERT(r, paint.nothingToDraw());
365 364
366 cm.postTranslate(0, 0, 0, 1); // wacks alpha 365 cm.postTranslate(0, 0, 0, 1); // wacks alpha
367 paint.setColorFilter(SkColorFilter::MakeMatrixFilterRowMajor255(cm.fMat)); 366 paint.setColorFilter(SkColorFilter::MakeMatrixFilterRowMajor255(cm.fMat));
368 REPORTER_ASSERT(r, !paint.nothingToDraw()); 367 REPORTER_ASSERT(r, !paint.nothingToDraw());
369 } 368 }
OLDNEW
« no previous file with comments | « tests/BlurTest.cpp ('k') | tools/debugger/SkDrawCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698