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

Side by Side Diff: gm/blurroundrect.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 | « gm/blurredclippedcircle.cpp ('k') | gm/color4f.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 2013 Google Inc. 2 * Copyright 2013 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 "gm.h" 8 #include "gm.h"
9 #include "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 | SkLayerDrawLooper::kColorFilter_Bit; 53 | SkLayerDrawLooper::kColorFilter_Bit;
54 info.fColorMode = SkXfermode::kSrc_Mode; 54 info.fColorMode = SkXfermode::kSrc_Mode;
55 info.fOffset = SkPoint::Make(SkIntToScalar(-1), SkIntToScalar(0)); 55 info.fOffset = SkPoint::Make(SkIntToScalar(-1), SkIntToScalar(0));
56 info.fPostTranslate = false; 56 info.fPostTranslate = false;
57 SkPaint* paint = looperBuilder.addLayerOnTop(info); 57 SkPaint* paint = looperBuilder.addLayerOnTop(info);
58 SkMaskFilter* maskFilter = SkBlurMaskFilter::Create( 58 SkMaskFilter* maskFilter = SkBlurMaskFilter::Create(
59 kNormal_SkBlurStyle, 59 kNormal_SkBlurStyle,
60 SkBlurMask::ConvertRadiusToSigma(SK_ScalarHalf), 60 SkBlurMask::ConvertRadiusToSigma(SK_ScalarHalf),
61 SkBlurMaskFilter::kHighQuality_BlurFlag); 61 SkBlurMaskFilter::kHighQuality_BlurFlag);
62 paint->setMaskFilter(maskFilter)->unref(); 62 paint->setMaskFilter(maskFilter)->unref();
63 SkColorFilter* colorFilter = SkColorFilter::CreateModeFilter( 63 paint->setColorFilter(SkColorFilter::MakeModeFilter(
64 sk_tool_utils::color_to_565(SK_ColorLTGRAY), 64 sk_tool_utils::color_to_565(SK_ColorLTGRAY),
65 SkXfermode::kSrcIn_Mode); 65 SkXfermode::kSrcIn_Mode));
66 paint->setColorFilter(colorFilter)->unref();
67 paint->setColor(sk_tool_utils::color_to_565(SK_ColorGRAY)); 66 paint->setColor(sk_tool_utils::color_to_565(SK_ColorGRAY));
68 } 67 }
69 { 68 {
70 SkLayerDrawLooper::LayerInfo info; 69 SkLayerDrawLooper::LayerInfo info;
71 looperBuilder.addLayerOnTop(info); 70 looperBuilder.addLayerOnTop(info);
72 } 71 }
73 SkPaint paint; 72 SkPaint paint;
74 canvas->drawRect(fRRect.rect(), paint); 73 canvas->drawRect(fRRect.rect(), paint);
75 74
76 paint.setLooper(looperBuilder.detach()); 75 paint.setLooper(looperBuilder.detach());
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 // TODO(scroggo): Disabled in an attempt to rememdy 175 // TODO(scroggo): Disabled in an attempt to rememdy
177 // https://code.google.com/p/skia/issues/detail?id=1801 ('Win7 Test bots all fai ling GenerateGMs: 176 // https://code.google.com/p/skia/issues/detail?id=1801 ('Win7 Test bots all fai ling GenerateGMs:
178 // ran wrong number of tests') 177 // ran wrong number of tests')
179 //DEF_GM(return new BlurRoundRectGM(600, 5514, 6);) 178 //DEF_GM(return new BlurRoundRectGM(600, 5514, 6);)
180 179
181 // Rounded rect with two opposite corners with large radii, the other two 180 // Rounded rect with two opposite corners with large radii, the other two
182 // small. 181 // small.
183 DEF_GM(return new BlurRoundRectGM(100, 100);) 182 DEF_GM(return new BlurRoundRectGM(100, 100);)
184 183
185 DEF_GM(return new SimpleBlurRoundRectGM();) 184 DEF_GM(return new SimpleBlurRoundRectGM();)
OLDNEW
« no previous file with comments | « gm/blurredclippedcircle.cpp ('k') | gm/color4f.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698