aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-28 16:25:35 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-28 16:25:35 +0000
commite396455d2d60ddf8e625b5037254f3c09fbcdcf5 (patch)
tree9654912812c8b942b89124b1ae2aa36372818663 /samplecode
parent2e0c32af0508a1e544c9953ea2fe128dbae7d429 (diff)
move common blur types into central header
BUG=skia: R=scroggo@google.com, djsollen@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/253833002 git-svn-id: http://skia.googlecode.com/svn/trunk@14411 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/SampleAll.cpp2
-rw-r--r--samplecode/SampleAnimBlur.cpp10
-rw-r--r--samplecode/SampleBigBlur.cpp2
-rw-r--r--samplecode/SampleBlur.cpp16
-rw-r--r--samplecode/SampleEffects.cpp2
-rw-r--r--samplecode/SampleFuzz.cpp5
-rw-r--r--samplecode/SampleSlides.cpp2
-rw-r--r--samplecode/SampleStrokePath.cpp10
-rw-r--r--samplecode/SampleTextAlpha.cpp2
-rw-r--r--samplecode/SampleTextureDomain.cpp4
-rw-r--r--samplecode/SampleXfermodesBlur.cpp2
11 files changed, 28 insertions, 29 deletions
diff --git a/samplecode/SampleAll.cpp b/samplecode/SampleAll.cpp
index 35eeabab12..96dcdae057 100644
--- a/samplecode/SampleAll.cpp
+++ b/samplecode/SampleAll.cpp
@@ -82,7 +82,7 @@ private:
///////////////////////////////////////////////////////////
static void r0(SkLayerRasterizer::Builder* rastBuilder, SkPaint& p) {
- p.setMaskFilter(SkBlurMaskFilter::Create(SkBlurMaskFilter::kNormal_BlurStyle,
+ p.setMaskFilter(SkBlurMaskFilter::Create(kNormal_SkBlurStyle,
SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(3)),
SkBlurMaskFilter::kNone_BlurFlag))->unref();
rastBuilder->addLayer(p, SkIntToScalar(3), SkIntToScalar(3));
diff --git a/samplecode/SampleAnimBlur.cpp b/samplecode/SampleAnimBlur.cpp
index 5d6638ad87..e00c46ddd1 100644
--- a/samplecode/SampleAnimBlur.cpp
+++ b/samplecode/SampleAnimBlur.cpp
@@ -37,11 +37,11 @@ protected:
25 * SK_Scalar1,
3 * SK_Scalar1);
- static const SkBlurMaskFilter::BlurStyle gStyles[] = {
- SkBlurMaskFilter::kNormal_BlurStyle,
- SkBlurMaskFilter::kInner_BlurStyle,
- SkBlurMaskFilter::kSolid_BlurStyle,
- SkBlurMaskFilter::kOuter_BlurStyle,
+ static const SkBlurStyle gStyles[] = {
+ kNormal_SkBlurStyle,
+ kInner_SkBlurStyle,
+ kSolid_SkBlurStyle,
+ kOuter_SkBlurStyle,
};
SkRandom random;
diff --git a/samplecode/SampleBigBlur.cpp b/samplecode/SampleBigBlur.cpp
index 928fc6fbb1..fcbd6ac4f9 100644
--- a/samplecode/SampleBigBlur.cpp
+++ b/samplecode/SampleBigBlur.cpp
@@ -31,7 +31,7 @@ protected:
canvas->save();
paint.setColor(SK_ColorBLUE);
SkMaskFilter* mf = SkBlurMaskFilter::Create(
- SkBlurMaskFilter::kNormal_BlurStyle,
+ kNormal_SkBlurStyle,
SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(128)),
SkBlurMaskFilter::kHighQuality_BlurFlag);
paint.setMaskFilter(mf)->unref();
diff --git a/samplecode/SampleBlur.cpp b/samplecode/SampleBlur.cpp
index a918bf217b..7607dfc9f3 100644
--- a/samplecode/SampleBlur.cpp
+++ b/samplecode/SampleBlur.cpp
@@ -76,16 +76,16 @@ protected:
virtual void onDrawContent(SkCanvas* canvas) {
drawBG(canvas);
- SkBlurMaskFilter::BlurStyle NONE = SkBlurMaskFilter::BlurStyle(-999);
+ SkBlurStyle NONE = SkBlurStyle(-999);
static const struct {
- SkBlurMaskFilter::BlurStyle fStyle;
- int fCx, fCy;
+ SkBlurStyle fStyle;
+ int fCx, fCy;
} gRecs[] = {
{ NONE, 0, 0 },
- { SkBlurMaskFilter::kInner_BlurStyle, -1, 0 },
- { SkBlurMaskFilter::kNormal_BlurStyle, 0, 1 },
- { SkBlurMaskFilter::kSolid_BlurStyle, 0, -1 },
- { SkBlurMaskFilter::kOuter_BlurStyle, 1, 0 },
+ { kInner_SkBlurStyle, -1, 0 },
+ { kNormal_SkBlurStyle, 0, 1 },
+ { kSolid_SkBlurStyle, 0, -1 },
+ { kOuter_SkBlurStyle, 1, 0 },
};
SkPaint paint;
@@ -111,7 +111,7 @@ protected:
}
// draw text
{
- SkMaskFilter* mf = SkBlurMaskFilter::Create(SkBlurMaskFilter::kNormal_BlurStyle,
+ SkMaskFilter* mf = SkBlurMaskFilter::Create(kNormal_SkBlurStyle,
SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(4)),
flags);
paint.setMaskFilter(mf)->unref();
diff --git a/samplecode/SampleEffects.cpp b/samplecode/SampleEffects.cpp
index cbefae8608..01a63adb75 100644
--- a/samplecode/SampleEffects.cpp
+++ b/samplecode/SampleEffects.cpp
@@ -24,7 +24,7 @@ static void paint_proc0(SkPaint*) {
static void paint_proc1(SkPaint* paint) {
paint->setMaskFilter(SkBlurMaskFilter::Create(
- SkBlurMaskFilter::kNormal_BlurStyle,
+ kNormal_SkBlurStyle,
SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(2))))->unref();
}
diff --git a/samplecode/SampleFuzz.cpp b/samplecode/SampleFuzz.cpp
index e66f086954..e690df1d92 100644
--- a/samplecode/SampleFuzz.cpp
+++ b/samplecode/SampleFuzz.cpp
@@ -190,9 +190,8 @@ static void do_fuzz(SkCanvas* canvas) {
case 7:
if (quick == true) break;
- SkSafeUnref(paint.setMaskFilter(SkBlurMaskFilter::Create(
- SkBlurMaskFilter::kNormal_BlurStyle,
- make_number())));
+ SkSafeUnref(paint.setMaskFilter(SkBlurMaskFilter::Create(kNormal_SkBlurStyle,
+ make_number())));
break;
case 8:
diff --git a/samplecode/SampleSlides.cpp b/samplecode/SampleSlides.cpp
index ece96849f9..d828ae601f 100644
--- a/samplecode/SampleSlides.cpp
+++ b/samplecode/SampleSlides.cpp
@@ -478,7 +478,7 @@ static void mesh_slide(SkCanvas* canvas) {
static void r0(SkLayerRasterizer::Builder* rastBuilder, SkPaint& p)
{
- p.setMaskFilter(SkBlurMaskFilter::Create(SkBlurMaskFilter::kNormal_BlurStyle,
+ p.setMaskFilter(SkBlurMaskFilter::Create(kNormal_SkBlurStyle,
SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(3))))->unref();
rastBuilder->addLayer(p, SkIntToScalar(3), SkIntToScalar(3));
diff --git a/samplecode/SampleStrokePath.cpp b/samplecode/SampleStrokePath.cpp
index ce6a010347..452651268f 100644
--- a/samplecode/SampleStrokePath.cpp
+++ b/samplecode/SampleStrokePath.cpp
@@ -160,11 +160,11 @@ protected:
paint.setColor(SK_ColorWHITE);
canvas->translate(10, 30);
- static const SkBlurMaskFilter::BlurStyle gStyle[] = {
- SkBlurMaskFilter::kNormal_BlurStyle,
- SkBlurMaskFilter::kInner_BlurStyle,
- SkBlurMaskFilter::kOuter_BlurStyle,
- SkBlurMaskFilter::kSolid_BlurStyle,
+ static const SkBlurStyle gStyle[] = {
+ kNormal_SkBlurStyle,
+ kInner_SkBlurStyle,
+ kOuter_SkBlurStyle,
+ kSolid_SkBlurStyle,
};
for (int x = 0; x < 5; x++) {
SkMaskFilter* mf;
diff --git a/samplecode/SampleTextAlpha.cpp b/samplecode/SampleTextAlpha.cpp
index 2732452c82..fcef92f315 100644
--- a/samplecode/SampleTextAlpha.cpp
+++ b/samplecode/SampleTextAlpha.cpp
@@ -70,7 +70,7 @@ protected:
paint.setARGB(fByte, 0xFF, 0xFF, 0xFF);
- paint.setMaskFilter(SkBlurMaskFilter::Create(SkBlurMaskFilter::kNormal_BlurStyle,
+ paint.setMaskFilter(SkBlurMaskFilter::Create(kNormal_SkBlurStyle,
SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(3))));
paint.getMaskFilter()->unref();
diff --git a/samplecode/SampleTextureDomain.cpp b/samplecode/SampleTextureDomain.cpp
index 47a3ab0a09..926c5596b0 100644
--- a/samplecode/SampleTextureDomain.cpp
+++ b/samplecode/SampleTextureDomain.cpp
@@ -78,7 +78,7 @@ protected:
srcRect.setXYWH(1, 1, 3, 3);
dstRect.setXYWH(5, 405, 305, 305);
SkMaskFilter* mf = SkBlurMaskFilter::Create(
- SkBlurMaskFilter::kNormal_BlurStyle,
+ kNormal_SkBlurStyle,
SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)),
SkBlurMaskFilter::kHighQuality_BlurFlag |
SkBlurMaskFilter::kIgnoreTransform_BlurFlag);
@@ -90,7 +90,7 @@ protected:
// but it will test a code path in SkGpuDevice::drawBitmap
// that handles blurs with rects transformed to non-
// orthogonal rects. It also tests the NULL src rect handling
- mf = SkBlurMaskFilter::Create(SkBlurMaskFilter::kNormal_BlurStyle,
+ mf = SkBlurMaskFilter::Create(kNormal_SkBlurStyle,
SkBlurMask::ConvertRadiusToSigma(5),
SkBlurMaskFilter::kHighQuality_BlurFlag);
paint.setMaskFilter(mf)->unref();
diff --git a/samplecode/SampleXfermodesBlur.cpp b/samplecode/SampleXfermodesBlur.cpp
index de75d059a8..620de54e0f 100644
--- a/samplecode/SampleXfermodesBlur.cpp
+++ b/samplecode/SampleXfermodesBlur.cpp
@@ -46,7 +46,7 @@ class XfermodesBlurView : public SampleView {
void draw_mode(SkCanvas* canvas, SkXfermode* mode, int alpha,
SkScalar x, SkScalar y) {
SkPaint p;
- SkMaskFilter* mf = SkBlurMaskFilter::Create(SkBlurMaskFilter::kNormal_BlurStyle,
+ SkMaskFilter* mf = SkBlurMaskFilter::Create(kNormal_SkBlurStyle,
SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)),
SkBlurMaskFilter::kNone_BlurFlag);
p.setMaskFilter(mf)->unref();