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

Side by Side Diff: tests/PaintTest.cpp

Issue 1827433002: Reland of [2] of "switch colorfilters to sk_sp (patchset #11 id:200001 of https://codereview.chromium.o… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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/ImageFilterTest.cpp ('k') | tests/PictureTest.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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 353
354 paint.setAlpha(0xFF); 354 paint.setAlpha(0xFF);
355 paint.setXfermodeMode(SkXfermode::kDst_Mode); 355 paint.setXfermodeMode(SkXfermode::kDst_Mode);
356 REPORTER_ASSERT(r, paint.nothingToDraw()); 356 REPORTER_ASSERT(r, paint.nothingToDraw());
357 357
358 paint.setAlpha(0); 358 paint.setAlpha(0);
359 paint.setXfermodeMode(SkXfermode::kSrcOver_Mode); 359 paint.setXfermodeMode(SkXfermode::kSrcOver_Mode);
360 360
361 SkColorMatrix cm; 361 SkColorMatrix cm;
362 cm.setIdentity(); // does not change alpha 362 cm.setIdentity(); // does not change alpha
363 paint.setColorFilter(SkColorMatrixFilter::Create(cm))->unref(); 363 paint.setColorFilter(SkColorFilter::MakeMatrixFilterRowMajor255(cm.fMat));
364 REPORTER_ASSERT(r, paint.nothingToDraw()); 364 REPORTER_ASSERT(r, paint.nothingToDraw());
365 365
366 cm.postTranslate(0, 0, 0, 1); // wacks alpha 366 cm.postTranslate(0, 0, 0, 1); // wacks alpha
367 paint.setColorFilter(SkColorMatrixFilter::Create(cm))->unref(); 367 paint.setColorFilter(SkColorFilter::MakeMatrixFilterRowMajor255(cm.fMat));
368 REPORTER_ASSERT(r, !paint.nothingToDraw()); 368 REPORTER_ASSERT(r, !paint.nothingToDraw());
369 } 369 }
370 370
OLDNEW
« no previous file with comments | « tests/ImageFilterTest.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698