SkPaint::FilterLevel -> SkFilterQuality
clone (+rebase) of https://codereview.chromium.org/1009183002/
BUG=skia:
TBR=scroggo@google.com
Review URL: https://codereview.chromium.org/1014533004
diff --git a/bench/AlternatingColorPatternBench.cpp b/bench/AlternatingColorPatternBench.cpp
index fccc494..3d812aa 100644
--- a/bench/AlternatingColorPatternBench.cpp
+++ b/bench/AlternatingColorPatternBench.cpp
@@ -149,7 +149,7 @@
void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE {
SkPaint paint;
paint.setAntiAlias(false);
- paint.setFilterLevel(SkPaint::kLow_FilterLevel);
+ paint.setFilterQuality(kLow_SkFilterQuality);
for (int i = 0; i < loops; ++i) {
for (int j = 0; j < NUM_DRAWS; ++j) {
diff --git a/bench/Benchmark.cpp b/bench/Benchmark.cpp
index 6040f91..bf622b0 100644
--- a/bench/Benchmark.cpp
+++ b/bench/Benchmark.cpp
@@ -53,7 +53,7 @@
void Benchmark::setupPaint(SkPaint* paint) {
paint->setAlpha(fForceAlpha);
paint->setAntiAlias(true);
- paint->setFilterLevel(SkPaint::kNone_FilterLevel);
+ paint->setFilterQuality(kNone_SkFilterQuality);
paint->setFlags((paint->getFlags() & ~fClearMask) | fOrMask);
diff --git a/bench/BitmapBench.cpp b/bench/BitmapBench.cpp
index c5efe9e..1ac1992 100644
--- a/bench/BitmapBench.cpp
+++ b/bench/BitmapBench.cpp
@@ -257,13 +257,13 @@
if (fFlags & kBicubic_Flag) {
index |= 2;
}
- static const SkPaint::FilterLevel gLevels[] = {
- SkPaint::kNone_FilterLevel,
- SkPaint::kLow_FilterLevel,
- SkPaint::kMedium_FilterLevel,
- SkPaint::kHigh_FilterLevel
+ static const SkFilterQuality gQualitys[] = {
+ kNone_SkFilterQuality,
+ kLow_SkFilterQuality,
+ kMedium_SkFilterQuality,
+ kHigh_SkFilterQuality
};
- paint->setFilterLevel(gLevels[index]);
+ paint->setFilterQuality(gQualitys[index]);
}
private:
diff --git a/bench/BitmapRectBench.cpp b/bench/BitmapRectBench.cpp
index fb3ebda..e2c2e34 100644
--- a/bench/BitmapRectBench.cpp
+++ b/bench/BitmapRectBench.cpp
@@ -42,17 +42,17 @@
SkBitmap fBitmap;
bool fSlightMatrix;
uint8_t fAlpha;
- SkPaint::FilterLevel fFilterLevel;
+ SkFilterQuality fFilterQuality;
SkString fName;
SkRect fSrcR, fDstR;
static const int kWidth = 128;
static const int kHeight = 128;
public:
- BitmapRectBench(U8CPU alpha, SkPaint::FilterLevel filterLevel,
+ BitmapRectBench(U8CPU alpha, SkFilterQuality filterQuality,
bool slightMatrix) {
fAlpha = SkToU8(alpha);
- fFilterLevel = filterLevel;
+ fFilterQuality = filterQuality;
fSlightMatrix = slightMatrix;
fBitmap.setInfo(SkImageInfo::MakeN32Premul(kWidth, kHeight));
@@ -62,7 +62,7 @@
const char* onGetName() SK_OVERRIDE {
fName.printf("bitmaprect_%02X_%sfilter_%s",
fAlpha,
- SkPaint::kNone_FilterLevel == fFilterLevel ? "no" : "",
+ kNone_SkFilterQuality == fFilterQuality ? "no" : "",
fSlightMatrix ? "trans" : "identity");
return fName.c_str();
}
@@ -92,7 +92,7 @@
SkPaint paint;
this->setupPaint(&paint);
- paint.setFilterLevel(fFilterLevel);
+ paint.setFilterQuality(fFilterQuality);
paint.setAlpha(fAlpha);
for (int i = 0; i < loops; i++) {
@@ -104,10 +104,10 @@
typedef Benchmark INHERITED;
};
-DEF_BENCH(return new BitmapRectBench(0xFF, SkPaint::kNone_FilterLevel, false))
-DEF_BENCH(return new BitmapRectBench(0x80, SkPaint::kNone_FilterLevel, false))
-DEF_BENCH(return new BitmapRectBench(0xFF, SkPaint::kLow_FilterLevel, false))
-DEF_BENCH(return new BitmapRectBench(0x80, SkPaint::kLow_FilterLevel, false))
+DEF_BENCH(return new BitmapRectBench(0xFF, kNone_SkFilterQuality, false))
+DEF_BENCH(return new BitmapRectBench(0x80, kNone_SkFilterQuality, false))
+DEF_BENCH(return new BitmapRectBench(0xFF, kLow_SkFilterQuality, false))
+DEF_BENCH(return new BitmapRectBench(0x80, kLow_SkFilterQuality, false))
-DEF_BENCH(return new BitmapRectBench(0xFF, SkPaint::kNone_FilterLevel, true))
-DEF_BENCH(return new BitmapRectBench(0xFF, SkPaint::kLow_FilterLevel, true))
+DEF_BENCH(return new BitmapRectBench(0xFF, kNone_SkFilterQuality, true))
+DEF_BENCH(return new BitmapRectBench(0xFF, kLow_SkFilterQuality, true))
diff --git a/bench/BitmapScaleBench.cpp b/bench/BitmapScaleBench.cpp
index e5cd587..5bd5b52 100644
--- a/bench/BitmapScaleBench.cpp
+++ b/bench/BitmapScaleBench.cpp
@@ -92,7 +92,7 @@
SkCanvas canvas( fOutputBitmap );
SkPaint paint;
- paint.setFilterLevel(SkPaint::kHigh_FilterLevel);
+ paint.setFilterQuality(kHigh_SkFilterQuality);
fInputBitmap.notifyPixelsChanged();
canvas.concat(fMatrix);
canvas.drawBitmap(fInputBitmap, 0, 0, &paint );
diff --git a/bench/GameBench.cpp b/bench/GameBench.cpp
index bf70b5c..eb1d9b9 100644
--- a/bench/GameBench.cpp
+++ b/bench/GameBench.cpp
@@ -134,11 +134,11 @@
SkPaint p;
p.setColor(0xFF000000);
- p.setFilterLevel(SkPaint::kLow_FilterLevel);
+ p.setFilterQuality(kLow_SkFilterQuality);
SkPaint p2; // for drawVertices path
p2.setColor(0xFF000000);
- p2.setFilterLevel(SkPaint::kLow_FilterLevel);
+ p2.setFilterQuality(kLow_SkFilterQuality);
p2.setShader(SkShader::CreateBitmapShader(fAtlas,
SkShader::kClamp_TileMode,
SkShader::kClamp_TileMode))->unref();
diff --git a/bench/TileBench.cpp b/bench/TileBench.cpp
index 9acef8c..cf35760 100644
--- a/bench/TileBench.cpp
+++ b/bench/TileBench.cpp
@@ -83,8 +83,8 @@
virtual void onDraw(const int loops, SkCanvas* canvas) {
SkPaint paint(fPaint);
this->setupPaint(&paint);
- paint.setFilterLevel(fDoFilter ? SkPaint::kLow_FilterLevel
- : SkPaint::kNone_FilterLevel);
+ paint.setFilterQuality(fDoFilter ? kLow_SkFilterQuality
+ : kNone_SkFilterQuality);
if (fDoTrans) {
paint.setColor(SkColorSetARGBMacro(0x80, 0xFF, 0xFF, 0xFF));
}
diff --git a/debugger/QT/SkSettingsWidget.cpp b/debugger/QT/SkSettingsWidget.cpp
index 90e358b..59b7920 100644
--- a/debugger/QT/SkSettingsWidget.cpp
+++ b/debugger/QT/SkSettingsWidget.cpp
@@ -64,11 +64,11 @@
fVerticalLayout.addRow(&fGLGroup);
#endif
- fFilterCombo.addItem("As encoded", QVariant(SkPaint::kNone_FilterLevel));
- fFilterCombo.addItem("None", QVariant(SkPaint::kNone_FilterLevel));
- fFilterCombo.addItem("Low", QVariant(SkPaint::kLow_FilterLevel));
- fFilterCombo.addItem("Medium", QVariant(SkPaint::kMedium_FilterLevel));
- fFilterCombo.addItem("High", QVariant(SkPaint::kHigh_FilterLevel));
+ fFilterCombo.addItem("As encoded", QVariant(kNone_SkFilterQuality));
+ fFilterCombo.addItem("None", QVariant(kNone_SkFilterQuality));
+ fFilterCombo.addItem("Low", QVariant(kLow_SkFilterQuality));
+ fFilterCombo.addItem("Medium", QVariant(kMedium_SkFilterQuality));
+ fFilterCombo.addItem("High", QVariant(kHigh_SkFilterQuality));
connect(&fFilterCombo, SIGNAL(activated(int)), this, SIGNAL(texFilterSettingsChanged()));
fVerticalLayout.addRow("Filtering", &fFilterCombo);
diff --git a/gm/bigmatrix.cpp b/gm/bigmatrix.cpp
index df542fd..32e637b 100644
--- a/gm/bigmatrix.cpp
+++ b/gm/bigmatrix.cpp
@@ -77,7 +77,7 @@
&s);
paint.setShader(shader)->unref();
paint.setAntiAlias(false);
- paint.setFilterLevel(SkPaint::kLow_FilterLevel);
+ paint.setFilterQuality(kLow_SkFilterQuality);
rect.setLTRB(pt.fX - small, pt.fY - small,
pt.fX + small, pt.fY + small);
canvas->drawRect(rect, paint);
diff --git a/gm/bitmapfilters.cpp b/gm/bitmapfilters.cpp
index f1348b1..8b68d3b 100644
--- a/gm/bitmapfilters.cpp
+++ b/gm/bitmapfilters.cpp
@@ -41,7 +41,7 @@
static SkScalar draw_set(SkCanvas* c, const SkBitmap& bm, SkScalar x,
SkPaint* p) {
x += draw_bm(c, bm, x, 0, p);
- p->setFilterLevel(SkPaint::kLow_FilterLevel);
+ p->setFilterQuality(kLow_SkFilterQuality);
x += draw_bm(c, bm, x, 0, p);
p->setDither(true);
return x + draw_bm(c, bm, x, 0, p);
diff --git a/gm/bleed.cpp b/gm/bleed.cpp
index f39f3a1..7fd2a15 100644
--- a/gm/bleed.cpp
+++ b/gm/bleed.cpp
@@ -104,14 +104,14 @@
// Draw only the center of the small bitmap
void drawCase1(SkCanvas* canvas, int transX, int transY,
- SkCanvas::DrawBitmapRectFlags flags, SkPaint::FilterLevel filter) {
+ SkCanvas::DrawBitmapRectFlags flags, SkFilterQuality filter) {
SkRect src = SkRect::MakeXYWH(2, 2,
SkIntToScalar(kSmallTextureSize-4),
SkIntToScalar(kSmallTextureSize-4));
SkRect dst = SkRect::MakeXYWH(0, 0, SkIntToScalar(kBlockSize), SkIntToScalar(kBlockSize));
SkPaint paint;
- paint.setFilterLevel(filter);
+ paint.setFilterQuality(filter);
canvas->save();
canvas->translate(SkIntToScalar(transX), SkIntToScalar(transY));
@@ -121,14 +121,14 @@
// Draw almost all of the large bitmap
void drawCase2(SkCanvas* canvas, int transX, int transY,
- SkCanvas::DrawBitmapRectFlags flags, SkPaint::FilterLevel filter) {
+ SkCanvas::DrawBitmapRectFlags flags, SkFilterQuality filter) {
SkRect src = SkRect::MakeXYWH(2, 2,
SkIntToScalar(fBitmapBig.width()-4),
SkIntToScalar(fBitmapBig.height()-4));
SkRect dst = SkRect::MakeXYWH(0, 0, SkIntToScalar(kBlockSize), SkIntToScalar(kBlockSize));
SkPaint paint;
- paint.setFilterLevel(filter);
+ paint.setFilterQuality(filter);
canvas->save();
canvas->translate(SkIntToScalar(transX), SkIntToScalar(transY));
@@ -138,14 +138,14 @@
// Draw ~1/4 of the large bitmap
void drawCase3(SkCanvas* canvas, int transX, int transY,
- SkCanvas::DrawBitmapRectFlags flags, SkPaint::FilterLevel filter) {
+ SkCanvas::DrawBitmapRectFlags flags, SkFilterQuality filter) {
SkRect src = SkRect::MakeXYWH(2, 2,
SkIntToScalar(fBitmapBig.width()/2-2),
SkIntToScalar(fBitmapBig.height()/2-2));
SkRect dst = SkRect::MakeXYWH(0, 0, SkIntToScalar(kBlockSize), SkIntToScalar(kBlockSize));
SkPaint paint;
- paint.setFilterLevel(filter);
+ paint.setFilterQuality(filter);
canvas->save();
canvas->translate(SkIntToScalar(transX), SkIntToScalar(transY));
@@ -155,14 +155,14 @@
// Draw the center of the small bitmap with a mask filter
void drawCase4(SkCanvas* canvas, int transX, int transY,
- SkCanvas::DrawBitmapRectFlags flags, SkPaint::FilterLevel filter) {
+ SkCanvas::DrawBitmapRectFlags flags, SkFilterQuality filter) {
SkRect src = SkRect::MakeXYWH(2, 2,
SkIntToScalar(kSmallTextureSize-4),
SkIntToScalar(kSmallTextureSize-4));
SkRect dst = SkRect::MakeXYWH(0, 0, SkIntToScalar(kBlockSize), SkIntToScalar(kBlockSize));
SkPaint paint;
- paint.setFilterLevel(filter);
+ paint.setFilterQuality(filter);
SkMaskFilter* mf = SkBlurMaskFilter::Create(kNormal_SkBlurStyle,
SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(3)));
paint.setMaskFilter(mf)->unref();
@@ -189,22 +189,22 @@
}
// First draw a column with no bleeding, tiling, or filtering
- this->drawCase1(canvas, kCol0X, kRow0Y, SkCanvas::kNone_DrawBitmapRectFlag, SkPaint::kNone_FilterLevel);
- this->drawCase2(canvas, kCol0X, kRow1Y, SkCanvas::kNone_DrawBitmapRectFlag, SkPaint::kNone_FilterLevel);
- this->drawCase3(canvas, kCol0X, kRow2Y, SkCanvas::kNone_DrawBitmapRectFlag, SkPaint::kNone_FilterLevel);
- this->drawCase4(canvas, kCol0X, kRow3Y, SkCanvas::kNone_DrawBitmapRectFlag, SkPaint::kNone_FilterLevel);
+ this->drawCase1(canvas, kCol0X, kRow0Y, SkCanvas::kNone_DrawBitmapRectFlag, kNone_SkFilterQuality);
+ this->drawCase2(canvas, kCol0X, kRow1Y, SkCanvas::kNone_DrawBitmapRectFlag, kNone_SkFilterQuality);
+ this->drawCase3(canvas, kCol0X, kRow2Y, SkCanvas::kNone_DrawBitmapRectFlag, kNone_SkFilterQuality);
+ this->drawCase4(canvas, kCol0X, kRow3Y, SkCanvas::kNone_DrawBitmapRectFlag, kNone_SkFilterQuality);
// Then draw a column with no bleeding or tiling but with low filtering
- this->drawCase1(canvas, kCol1X, kRow0Y, SkCanvas::kNone_DrawBitmapRectFlag, SkPaint::kLow_FilterLevel);
- this->drawCase2(canvas, kCol1X, kRow1Y, SkCanvas::kNone_DrawBitmapRectFlag, SkPaint::kLow_FilterLevel);
- this->drawCase3(canvas, kCol1X, kRow2Y, SkCanvas::kNone_DrawBitmapRectFlag, SkPaint::kLow_FilterLevel);
- this->drawCase4(canvas, kCol1X, kRow3Y, SkCanvas::kNone_DrawBitmapRectFlag, SkPaint::kLow_FilterLevel);
+ this->drawCase1(canvas, kCol1X, kRow0Y, SkCanvas::kNone_DrawBitmapRectFlag, kLow_SkFilterQuality);
+ this->drawCase2(canvas, kCol1X, kRow1Y, SkCanvas::kNone_DrawBitmapRectFlag, kLow_SkFilterQuality);
+ this->drawCase3(canvas, kCol1X, kRow2Y, SkCanvas::kNone_DrawBitmapRectFlag, kLow_SkFilterQuality);
+ this->drawCase4(canvas, kCol1X, kRow3Y, SkCanvas::kNone_DrawBitmapRectFlag, kLow_SkFilterQuality);
// Then draw a column with no bleeding or tiling but with high filtering
- this->drawCase1(canvas, kCol2X, kRow0Y, SkCanvas::kNone_DrawBitmapRectFlag, SkPaint::kHigh_FilterLevel);
- this->drawCase2(canvas, kCol2X, kRow1Y, SkCanvas::kNone_DrawBitmapRectFlag, SkPaint::kHigh_FilterLevel);
- this->drawCase3(canvas, kCol2X, kRow2Y, SkCanvas::kNone_DrawBitmapRectFlag, SkPaint::kHigh_FilterLevel);
- this->drawCase4(canvas, kCol2X, kRow3Y, SkCanvas::kNone_DrawBitmapRectFlag, SkPaint::kHigh_FilterLevel);
+ this->drawCase1(canvas, kCol2X, kRow0Y, SkCanvas::kNone_DrawBitmapRectFlag, kHigh_SkFilterQuality);
+ this->drawCase2(canvas, kCol2X, kRow1Y, SkCanvas::kNone_DrawBitmapRectFlag, kHigh_SkFilterQuality);
+ this->drawCase3(canvas, kCol2X, kRow2Y, SkCanvas::kNone_DrawBitmapRectFlag, kHigh_SkFilterQuality);
+ this->drawCase4(canvas, kCol2X, kRow3Y, SkCanvas::kNone_DrawBitmapRectFlag, kHigh_SkFilterQuality);
#if SK_SUPPORT_GPU
GrContext* ctx = canvas->getGrContext();
@@ -217,28 +217,28 @@
#endif
// Then draw a column with no bleeding but with tiling and low filtering
- this->drawCase1(canvas, kCol3X, kRow0Y, SkCanvas::kNone_DrawBitmapRectFlag, SkPaint::kLow_FilterLevel);
- this->drawCase2(canvas, kCol3X, kRow1Y, SkCanvas::kNone_DrawBitmapRectFlag, SkPaint::kLow_FilterLevel);
- this->drawCase3(canvas, kCol3X, kRow2Y, SkCanvas::kNone_DrawBitmapRectFlag, SkPaint::kLow_FilterLevel);
- this->drawCase4(canvas, kCol3X, kRow3Y, SkCanvas::kNone_DrawBitmapRectFlag, SkPaint::kLow_FilterLevel);
+ this->drawCase1(canvas, kCol3X, kRow0Y, SkCanvas::kNone_DrawBitmapRectFlag, kLow_SkFilterQuality);
+ this->drawCase2(canvas, kCol3X, kRow1Y, SkCanvas::kNone_DrawBitmapRectFlag, kLow_SkFilterQuality);
+ this->drawCase3(canvas, kCol3X, kRow2Y, SkCanvas::kNone_DrawBitmapRectFlag, kLow_SkFilterQuality);
+ this->drawCase4(canvas, kCol3X, kRow3Y, SkCanvas::kNone_DrawBitmapRectFlag, kLow_SkFilterQuality);
// Then draw a column with no bleeding but with tiling and high filtering
- this->drawCase1(canvas, kCol4X, kRow0Y, SkCanvas::kNone_DrawBitmapRectFlag, SkPaint::kHigh_FilterLevel);
- this->drawCase2(canvas, kCol4X, kRow1Y, SkCanvas::kNone_DrawBitmapRectFlag, SkPaint::kHigh_FilterLevel);
- this->drawCase3(canvas, kCol4X, kRow2Y, SkCanvas::kNone_DrawBitmapRectFlag, SkPaint::kHigh_FilterLevel);
- this->drawCase4(canvas, kCol4X, kRow3Y, SkCanvas::kNone_DrawBitmapRectFlag, SkPaint::kHigh_FilterLevel);
+ this->drawCase1(canvas, kCol4X, kRow0Y, SkCanvas::kNone_DrawBitmapRectFlag, kHigh_SkFilterQuality);
+ this->drawCase2(canvas, kCol4X, kRow1Y, SkCanvas::kNone_DrawBitmapRectFlag, kHigh_SkFilterQuality);
+ this->drawCase3(canvas, kCol4X, kRow2Y, SkCanvas::kNone_DrawBitmapRectFlag, kHigh_SkFilterQuality);
+ this->drawCase4(canvas, kCol4X, kRow3Y, SkCanvas::kNone_DrawBitmapRectFlag, kHigh_SkFilterQuality);
// Then draw a column with bleeding, tiling, and low filtering
- this->drawCase1(canvas, kCol5X, kRow0Y, SkCanvas::kBleed_DrawBitmapRectFlag, SkPaint::kLow_FilterLevel);
- this->drawCase2(canvas, kCol5X, kRow1Y, SkCanvas::kBleed_DrawBitmapRectFlag, SkPaint::kLow_FilterLevel);
- this->drawCase3(canvas, kCol5X, kRow2Y, SkCanvas::kBleed_DrawBitmapRectFlag, SkPaint::kLow_FilterLevel);
- this->drawCase4(canvas, kCol5X, kRow3Y, SkCanvas::kBleed_DrawBitmapRectFlag, SkPaint::kLow_FilterLevel);
+ this->drawCase1(canvas, kCol5X, kRow0Y, SkCanvas::kBleed_DrawBitmapRectFlag, kLow_SkFilterQuality);
+ this->drawCase2(canvas, kCol5X, kRow1Y, SkCanvas::kBleed_DrawBitmapRectFlag, kLow_SkFilterQuality);
+ this->drawCase3(canvas, kCol5X, kRow2Y, SkCanvas::kBleed_DrawBitmapRectFlag, kLow_SkFilterQuality);
+ this->drawCase4(canvas, kCol5X, kRow3Y, SkCanvas::kBleed_DrawBitmapRectFlag, kLow_SkFilterQuality);
// Finally draw a column with bleeding, tiling, and high filtering
- this->drawCase1(canvas, kCol6X, kRow0Y, SkCanvas::kBleed_DrawBitmapRectFlag, SkPaint::kHigh_FilterLevel);
- this->drawCase2(canvas, kCol6X, kRow1Y, SkCanvas::kBleed_DrawBitmapRectFlag, SkPaint::kHigh_FilterLevel);
- this->drawCase3(canvas, kCol6X, kRow2Y, SkCanvas::kBleed_DrawBitmapRectFlag, SkPaint::kHigh_FilterLevel);
- this->drawCase4(canvas, kCol6X, kRow3Y, SkCanvas::kBleed_DrawBitmapRectFlag, SkPaint::kHigh_FilterLevel);
+ this->drawCase1(canvas, kCol6X, kRow0Y, SkCanvas::kBleed_DrawBitmapRectFlag, kHigh_SkFilterQuality);
+ this->drawCase2(canvas, kCol6X, kRow1Y, SkCanvas::kBleed_DrawBitmapRectFlag, kHigh_SkFilterQuality);
+ this->drawCase3(canvas, kCol6X, kRow2Y, SkCanvas::kBleed_DrawBitmapRectFlag, kHigh_SkFilterQuality);
+ this->drawCase4(canvas, kCol6X, kRow3Y, SkCanvas::kBleed_DrawBitmapRectFlag, kHigh_SkFilterQuality);
#if SK_SUPPORT_GPU
if (ctx) {
diff --git a/gm/blurquickreject.cpp b/gm/blurquickreject.cpp
index 7c74fdf..c2fee72 100644
--- a/gm/blurquickreject.cpp
+++ b/gm/blurquickreject.cpp
@@ -55,7 +55,7 @@
hairlinePaint.setStrokeWidth(0);
SkPaint blurPaint;
- blurPaint.setFilterLevel(SkPaint::kLow_FilterLevel);
+ blurPaint.setFilterQuality(kLow_SkFilterQuality);
SkMaskFilter* mf = SkBlurMaskFilter::Create(kNormal_SkBlurStyle,
SkBlurMask::ConvertRadiusToSigma(kBlurRadius));
blurPaint.setMaskFilter(mf)->unref();
diff --git a/gm/clippedbitmapshaders.cpp b/gm/clippedbitmapshaders.cpp
index ee20847..6225abe 100644
--- a/gm/clippedbitmapshaders.cpp
+++ b/gm/clippedbitmapshaders.cpp
@@ -89,7 +89,7 @@
paint.setShader(shader)->unref();
if (fHQ) {
- paint.setFilterLevel(SkPaint::kHigh_FilterLevel);
+ paint.setFilterQuality(kHigh_SkFilterQuality);
}
SkScalar margin = (SLIDE_SIZE / 3 - RECT_SIZE) / 2;
diff --git a/gm/downsamplebitmap.cpp b/gm/downsamplebitmap.cpp
index 15280f2..9523e06 100644
--- a/gm/downsamplebitmap.cpp
+++ b/gm/downsamplebitmap.cpp
@@ -39,20 +39,20 @@
SkBitmap fBM;
SkString fName;
bool fBitmapMade;
- SkPaint::FilterLevel fFilterLevel;
+ SkFilterQuality fFilterQuality;
- DownsampleBitmapGM(SkPaint::FilterLevel filterLevel)
- : fFilterLevel(filterLevel)
+ DownsampleBitmapGM(SkFilterQuality filterQuality)
+ : fFilterQuality(filterQuality)
{
this->setBGColor(0xFFDDDDDD);
fBitmapMade = false;
}
- const char* filterLevelToString() {
- static const char *filterLevelNames[] = {
+ const char* filterQualityToString() {
+ static const char *filterQualityNames[] = {
"none", "low", "medium", "high"
};
- return filterLevelNames[fFilterLevel];
+ return filterQualityNames[fFilterQuality];
}
protected:
@@ -87,7 +87,7 @@
matrix.setScale( curScale, curScale );
SkPaint paint;
- paint.setFilterLevel(fFilterLevel);
+ paint.setFilterQuality(fFilterQuality);
canvas->save();
canvas->translate(0, (SkScalar)curY);
@@ -107,10 +107,10 @@
class DownsampleBitmapTextGM: public DownsampleBitmapGM {
public:
- DownsampleBitmapTextGM(float textSize, SkPaint::FilterLevel filterLevel)
- : INHERITED(filterLevel), fTextSize(textSize)
+ DownsampleBitmapTextGM(float textSize, SkFilterQuality filterQuality)
+ : INHERITED(filterQuality), fTextSize(textSize)
{
- fName.printf("downsamplebitmap_text_%s_%.2fpt", this->filterLevelToString(), fTextSize);
+ fName.printf("downsamplebitmap_text_%s_%.2fpt", this->filterQualityToString(), fTextSize);
}
protected:
@@ -141,10 +141,10 @@
class DownsampleBitmapCheckerboardGM: public DownsampleBitmapGM {
public:
- DownsampleBitmapCheckerboardGM(int size, int numChecks, SkPaint::FilterLevel filterLevel)
- : INHERITED(filterLevel), fSize(size), fNumChecks(numChecks)
+ DownsampleBitmapCheckerboardGM(int size, int numChecks, SkFilterQuality filterQuality)
+ : INHERITED(filterQuality), fSize(size), fNumChecks(numChecks)
{
- fName.printf("downsamplebitmap_checkerboard_%s_%d_%d", this->filterLevelToString(), fSize, fNumChecks);
+ fName.printf("downsamplebitmap_checkerboard_%s_%d_%d", this->filterQualityToString(), fSize, fNumChecks);
}
protected:
@@ -160,10 +160,10 @@
class DownsampleBitmapImageGM: public DownsampleBitmapGM {
public:
- DownsampleBitmapImageGM(const char filename[], SkPaint::FilterLevel filterLevel)
- : INHERITED(filterLevel), fFilename(filename)
+ DownsampleBitmapImageGM(const char filename[], SkFilterQuality filterQuality)
+ : INHERITED(filterQuality), fFilename(filename)
{
- fName.printf("downsamplebitmap_image_%s_%s", this->filterLevelToString(), filename);
+ fName.printf("downsamplebitmap_image_%s_%s", this->filterQualityToString(), filename);
}
protected:
@@ -248,26 +248,26 @@
//////////////////////////////////////////////////////////////////////////////
-DEF_GM( return new DownsampleBitmapTextGM(72, SkPaint::kHigh_FilterLevel); )
-DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, SkPaint::kHigh_FilterLevel); )
-DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", SkPaint::kHigh_FilterLevel); )
+DEF_GM( return new DownsampleBitmapTextGM(72, kHigh_SkFilterQuality); )
+DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, kHigh_SkFilterQuality); )
+DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", kHigh_SkFilterQuality); )
DEF_GM( return new DownsampleBitmapImageGM("mandrill_132x132_12x12.astc",
- SkPaint::kHigh_FilterLevel); )
+ kHigh_SkFilterQuality); )
-DEF_GM( return new DownsampleBitmapTextGM(72, SkPaint::kMedium_FilterLevel); )
-DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, SkPaint::kMedium_FilterLevel); )
-DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", SkPaint::kMedium_FilterLevel); )
+DEF_GM( return new DownsampleBitmapTextGM(72, kMedium_SkFilterQuality); )
+DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, kMedium_SkFilterQuality); )
+DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", kMedium_SkFilterQuality); )
DEF_GM( return new DownsampleBitmapImageGM("mandrill_132x132_12x12.astc",
- SkPaint::kMedium_FilterLevel); )
+ kMedium_SkFilterQuality); )
-DEF_GM( return new DownsampleBitmapTextGM(72, SkPaint::kLow_FilterLevel); )
-DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, SkPaint::kLow_FilterLevel); )
-DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", SkPaint::kLow_FilterLevel); )
+DEF_GM( return new DownsampleBitmapTextGM(72, kLow_SkFilterQuality); )
+DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, kLow_SkFilterQuality); )
+DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", kLow_SkFilterQuality); )
DEF_GM( return new DownsampleBitmapImageGM("mandrill_132x132_12x12.astc",
- SkPaint::kLow_FilterLevel); )
+ kLow_SkFilterQuality); )
-DEF_GM( return new DownsampleBitmapTextGM(72, SkPaint::kNone_FilterLevel); )
-DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, SkPaint::kNone_FilterLevel); )
-DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", SkPaint::kNone_FilterLevel); )
+DEF_GM( return new DownsampleBitmapTextGM(72, kNone_SkFilterQuality); )
+DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, kNone_SkFilterQuality); )
+DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", kNone_SkFilterQuality); )
DEF_GM( return new DownsampleBitmapImageGM("mandrill_132x132_12x12.astc",
- SkPaint::kNone_FilterLevel); )
+ kNone_SkFilterQuality); )
diff --git a/gm/drawbitmaprect.cpp b/gm/drawbitmaprect.cpp
index 39d46db..84766a9 100644
--- a/gm/drawbitmaprect.cpp
+++ b/gm/drawbitmaprect.cpp
@@ -217,7 +217,7 @@
SkBitmap bm;
bm = make_chessbm(5, 5);
- paint.setFilterLevel(SkPaint::kLow_FilterLevel);
+ paint.setFilterQuality(kLow_SkFilterQuality);
srcRect.setXYWH(1, 1, 3, 3);
SkMaskFilter* mf = SkBlurMaskFilter::Create(
diff --git a/gm/filterbitmap.cpp b/gm/filterbitmap.cpp
index 66f9d34..7028012 100644
--- a/gm/filterbitmap.cpp
+++ b/gm/filterbitmap.cpp
@@ -25,9 +25,9 @@
}
static void draw_cell(SkCanvas* canvas, const SkBitmap& bm, const SkMatrix& mat, SkScalar dx,
- SkPaint::FilterLevel lvl) {
+ SkFilterQuality lvl) {
SkPaint paint;
- paint.setFilterLevel(lvl);
+ paint.setFilterQuality(lvl);
SkAutoCanvasRestore acr(canvas, true);
canvas->translate(dx, 0);
@@ -36,10 +36,10 @@
}
static void draw_row(SkCanvas* canvas, const SkBitmap& bm, const SkMatrix& mat, SkScalar dx) {
- draw_cell(canvas, bm, mat, 0 * dx, SkPaint::kNone_FilterLevel);
- draw_cell(canvas, bm, mat, 1 * dx, SkPaint::kLow_FilterLevel);
- draw_cell(canvas, bm, mat, 2 * dx, SkPaint::kMedium_FilterLevel);
- draw_cell(canvas, bm, mat, 3 * dx, SkPaint::kHigh_FilterLevel);
+ draw_cell(canvas, bm, mat, 0 * dx, kNone_SkFilterQuality);
+ draw_cell(canvas, bm, mat, 1 * dx, kLow_SkFilterQuality);
+ draw_cell(canvas, bm, mat, 2 * dx, kMedium_SkFilterQuality);
+ draw_cell(canvas, bm, mat, 3 * dx, kHigh_SkFilterQuality);
}
class FilterBitmapGM : public skiagm::GM {
diff --git a/gm/filterfastbounds.cpp b/gm/filterfastbounds.cpp
index 206903f..6244001 100644
--- a/gm/filterfastbounds.cpp
+++ b/gm/filterfastbounds.cpp
@@ -94,7 +94,7 @@
scale.setScale(2.0f, 2.0f);
SkAutoTUnref<SkMatrixImageFilter> scaleMIF(
- SkMatrixImageFilter::Create(scale, SkPaint::kLow_FilterLevel, source));
+ SkMatrixImageFilter::Create(scale, kLow_SkFilterQuality, source));
add_paint(scaleMIF, paints);
}
@@ -104,7 +104,7 @@
rot.setRotate(-33.3f);
SkAutoTUnref<SkMatrixImageFilter> rotMIF(
- SkMatrixImageFilter::Create(rot, SkPaint::kLow_FilterLevel, source));
+ SkMatrixImageFilter::Create(rot, kLow_SkFilterQuality, source));
add_paint(rotMIF, paints);
}
diff --git a/gm/filterindiabox.cpp b/gm/filterindiabox.cpp
index 1ed2a69..2c39a10 100644
--- a/gm/filterindiabox.cpp
+++ b/gm/filterindiabox.cpp
@@ -24,9 +24,9 @@
}
static void draw_cell(SkCanvas* canvas, const SkBitmap& bm, const SkMatrix& mat, SkScalar dx,
- SkPaint::FilterLevel lvl) {
+ SkFilterQuality lvl) {
SkPaint paint;
- paint.setFilterLevel(lvl);
+ paint.setFilterQuality(lvl);
SkAutoCanvasRestore acr(canvas, true);
@@ -36,10 +36,10 @@
}
static void draw_row(SkCanvas* canvas, const SkBitmap& bm, const SkMatrix& mat, SkScalar dx) {
- draw_cell(canvas, bm, mat, 0 * dx, SkPaint::kNone_FilterLevel);
- draw_cell(canvas, bm, mat, 1 * dx, SkPaint::kLow_FilterLevel);
- draw_cell(canvas, bm, mat, 2 * dx, SkPaint::kMedium_FilterLevel);
- draw_cell(canvas, bm, mat, 3 * dx, SkPaint::kHigh_FilterLevel);
+ draw_cell(canvas, bm, mat, 0 * dx, kNone_SkFilterQuality);
+ draw_cell(canvas, bm, mat, 1 * dx, kLow_SkFilterQuality);
+ draw_cell(canvas, bm, mat, 2 * dx, kMedium_SkFilterQuality);
+ draw_cell(canvas, bm, mat, 3 * dx, kHigh_SkFilterQuality);
}
class FilterIndiaBoxGM : public skiagm::GM {
diff --git a/gm/giantbitmap.cpp b/gm/giantbitmap.cpp
index 2ac952d..bb9a655 100644
--- a/gm/giantbitmap.cpp
+++ b/gm/giantbitmap.cpp
@@ -109,7 +109,7 @@
SkShader* s = SkShader::CreateBitmapShader(getBitmap(), fMode, fMode, &m);
paint.setShader(s)->unref();
- paint.setFilterLevel(fDoFilter ? SkPaint::kLow_FilterLevel : SkPaint::kNone_FilterLevel);
+ paint.setFilterQuality(fDoFilter ? kLow_SkFilterQuality : kNone_SkFilterQuality);
canvas->translate(SkIntToScalar(50), SkIntToScalar(50));
diff --git a/gm/imagefiltersclipped.cpp b/gm/imagefiltersclipped.cpp
index 98f5bbb..5608414 100644
--- a/gm/imagefiltersclipped.cpp
+++ b/gm/imagefiltersclipped.cpp
@@ -91,7 +91,7 @@
SkDilateImageFilter::Create(2, 2, checkerboard.get()),
SkErodeImageFilter::Create(2, 2, checkerboard.get()),
SkOffsetImageFilter::Create(SkIntToScalar(-16), SkIntToScalar(32)),
- SkMatrixImageFilter::Create(resizeMatrix, SkPaint::kNone_FilterLevel),
+ SkMatrixImageFilter::Create(resizeMatrix, kNone_SkFilterQuality),
SkRectShaderImageFilter::Create(noise),
};
diff --git a/gm/imagefiltersscaled.cpp b/gm/imagefiltersscaled.cpp
index 3a928b7..1cb1e5c 100644
--- a/gm/imagefiltersscaled.cpp
+++ b/gm/imagefiltersscaled.cpp
@@ -100,7 +100,7 @@
SkDilateImageFilter::Create(1, 1, checkerboard.get()),
SkErodeImageFilter::Create(1, 1, checkerboard.get()),
SkOffsetImageFilter::Create(SkIntToScalar(32), 0),
- SkMatrixImageFilter::Create(resizeMatrix, SkPaint::kNone_FilterLevel),
+ SkMatrixImageFilter::Create(resizeMatrix, kNone_SkFilterQuality),
SkRectShaderImageFilter::Create(noise),
SkLightingImageFilter::CreatePointLitDiffuse(pointLocation, white, surfaceScale, kd),
SkLightingImageFilter::CreateSpotLitDiffuse(spotLocation, spotTarget, spotExponent,
diff --git a/gm/imageresizetiled.cpp b/gm/imageresizetiled.cpp
index 6eb254c..d06c1fb 100644
--- a/gm/imageresizetiled.cpp
+++ b/gm/imageresizetiled.cpp
@@ -36,7 +36,7 @@
SkMatrix matrix;
matrix.setScale(RESIZE_FACTOR, RESIZE_FACTOR);
SkAutoTUnref<SkImageFilter> imageFilter(
- SkMatrixImageFilter::Create(matrix, SkPaint::kNone_FilterLevel));
+ SkMatrixImageFilter::Create(matrix, kNone_SkFilterQuality));
paint.setImageFilter(imageFilter.get());
const SkScalar tile_size = SkIntToScalar(100);
SkRect bounds;
diff --git a/gm/matriximagefilter.cpp b/gm/matriximagefilter.cpp
index 59c5106..eef2b45 100644
--- a/gm/matriximagefilter.cpp
+++ b/gm/matriximagefilter.cpp
@@ -23,9 +23,9 @@
}
void draw(SkCanvas* canvas, const SkRect& rect, const SkBitmap& bitmap,
- const SkMatrix& matrix, SkPaint::FilterLevel filterLevel) {
+ const SkMatrix& matrix, SkFilterQuality filter) {
SkAutoTUnref<SkImageFilter> imageFilter(
- SkMatrixImageFilter::Create(matrix, filterLevel));
+ SkMatrixImageFilter::Create(matrix, filter));
SkPaint paint;
paint.setImageFilter(imageFilter.get());
canvas->saveLayer(&rect, &paint);
@@ -68,18 +68,18 @@
SkRect srcRect = SkRect::MakeWH(96, 96);
canvas->translate(margin, margin);
- draw(canvas, srcRect, checkerboard, matrix, SkPaint::kNone_FilterLevel);
+ draw(canvas, srcRect, checkerboard, matrix, kNone_SkFilterQuality);
canvas->translate(srcRect.width() + margin, 0);
- draw(canvas, srcRect, checkerboard, matrix, SkPaint::kLow_FilterLevel);
+ draw(canvas, srcRect, checkerboard, matrix, kLow_SkFilterQuality);
#if 0
// This may be causing Mac 10.6 to barf.
canvas->translate(srcRect.width() + margin, 0);
- draw(canvas, srcRect, checkerboard, matrix, SkPaint::kMedium_FilterLevel);
+ draw(canvas, srcRect, checkerboard, matrix, kMedium_SkFilterQuality);
canvas->translate(srcRect.width() + margin, 0);
- draw(canvas, srcRect, checkerboard, matrix, SkPaint::kHigh_FilterLevel);
+ draw(canvas, srcRect, checkerboard, matrix, kHigh_SkFilterQuality);
#endif
}
diff --git a/gm/mipmap.cpp b/gm/mipmap.cpp
index 948fd99..70543a9 100644
--- a/gm/mipmap.cpp
+++ b/gm/mipmap.cpp
@@ -41,7 +41,7 @@
canvas->translate(20, 20);
for (int i = 0; i < 4; ++i) {
- paint.setFilterLevel(SkPaint::FilterLevel(i));
+ paint.setFilterQuality(SkFilterQuality(i));
canvas->drawImageRect(img, NULL, dst, &paint);
canvas->translate(0, 20);
}
diff --git a/gm/ninepatchstretch.cpp b/gm/ninepatchstretch.cpp
index 67f6bf4..5031480 100644
--- a/gm/ninepatchstretch.cpp
+++ b/gm/ninepatchstretch.cpp
@@ -73,7 +73,7 @@
SkScalar y = SkIntToScalar(100);
SkPaint paint;
- paint.setFilterLevel(SkPaint::kLow_FilterLevel);
+ paint.setFilterQuality(kLow_SkFilterQuality);
for (int iy = 0; iy < 2; ++iy) {
for (int ix = 0; ix < 2; ++ix) {
diff --git a/gm/pictureimagefilter.cpp b/gm/pictureimagefilter.cpp
index 6f05853..36b0817 100644
--- a/gm/pictureimagefilter.cpp
+++ b/gm/pictureimagefilter.cpp
@@ -65,10 +65,10 @@
SkPictureImageFilter::Create(fPicture, emptyRect));
SkAutoTUnref<SkPictureImageFilter> pictureSourceResampled(
SkPictureImageFilter::CreateForLocalSpace(fPicture, fPicture->cullRect(),
- SkPaint::kLow_FilterLevel));
+ kLow_SkFilterQuality));
SkAutoTUnref<SkPictureImageFilter> pictureSourcePixelated(
SkPictureImageFilter::CreateForLocalSpace(fPicture, fPicture->cullRect(),
- SkPaint::kNone_FilterLevel));
+ kNone_SkFilterQuality));
canvas->save();
// Draw the picture unscaled.
diff --git a/gm/resizeimagefilter.cpp b/gm/resizeimagefilter.cpp
index e87dff0..6916f61 100644
--- a/gm/resizeimagefilter.cpp
+++ b/gm/resizeimagefilter.cpp
@@ -28,7 +28,7 @@
void draw(SkCanvas* canvas,
const SkRect& rect,
const SkSize& deviceSize,
- SkPaint::FilterLevel filterLevel,
+ SkFilterQuality filterQuality,
SkImageFilter* input = NULL) {
SkRect dstRect;
canvas->getTotalMatrix().mapRect(&dstRect, rect);
@@ -42,7 +42,7 @@
matrix.setScale(SkScalarInvert(deviceScaleX),
SkScalarInvert(deviceScaleY));
SkAutoTUnref<SkImageFilter> imageFilter(
- SkMatrixImageFilter::Create(matrix, filterLevel, input));
+ SkMatrixImageFilter::Create(matrix, filterQuality, input));
SkPaint filteredPaint;
filteredPaint.setImageFilter(imageFilter.get());
canvas->saveLayer(&rect, &filteredPaint);
@@ -68,25 +68,25 @@
draw(canvas,
srcRect,
deviceSize,
- SkPaint::kNone_FilterLevel);
+ kNone_SkFilterQuality);
canvas->translate(srcRect.width() + SkIntToScalar(10), 0);
draw(canvas,
srcRect,
deviceSize,
- SkPaint::kLow_FilterLevel);
+ kLow_SkFilterQuality);
canvas->translate(srcRect.width() + SkIntToScalar(10), 0);
draw(canvas,
srcRect,
deviceSize,
- SkPaint::kMedium_FilterLevel);
+ kMedium_SkFilterQuality);
canvas->translate(srcRect.width() + SkIntToScalar(10), 0);
draw(canvas,
srcRect,
deviceSize,
- SkPaint::kHigh_FilterLevel);
+ kHigh_SkFilterQuality);
SkBitmap bitmap;
bitmap.allocN32Pixels(16, 16);
@@ -107,7 +107,7 @@
draw(canvas,
srcRect,
deviceSize,
- SkPaint::kHigh_FilterLevel,
+ kHigh_SkFilterQuality,
source.get());
}
diff --git a/gm/shadertext2.cpp b/gm/shadertext2.cpp
index 31d1e89..b0637da 100644
--- a/gm/shadertext2.cpp
+++ b/gm/shadertext2.cpp
@@ -92,7 +92,7 @@
fillPaint.setAntiAlias(true);
sk_tool_utils::set_portable_typeface(&fillPaint);
fillPaint.setTextSize(SkIntToScalar(kPointSize));
- fillPaint.setFilterLevel(SkPaint::kLow_FilterLevel);
+ fillPaint.setFilterQuality(kLow_SkFilterQuality);
SkPaint outlinePaint;
outlinePaint.setAntiAlias(true);
diff --git a/gm/shadertext3.cpp b/gm/shadertext3.cpp
index 7b84f69..1e0216e 100644
--- a/gm/shadertext3.cpp
+++ b/gm/shadertext3.cpp
@@ -67,7 +67,7 @@
SkPaint bmpPaint;
bmpPaint.setAntiAlias(true);
- bmpPaint.setFilterLevel(SkPaint::kLow_FilterLevel);
+ bmpPaint.setFilterQuality(kLow_SkFilterQuality);
bmpPaint.setAlpha(0x80);
canvas->drawBitmap(fBmp, 5.f, 5.f, &bmpPaint);
@@ -109,7 +109,7 @@
fillPaint.setAntiAlias(true);
sk_tool_utils::set_portable_typeface(&fillPaint);
fillPaint.setTextSize(SkIntToScalar(kPointSize));
- fillPaint.setFilterLevel(SkPaint::kLow_FilterLevel);
+ fillPaint.setFilterQuality(kLow_SkFilterQuality);
fillPaint.setShader(shader);
canvas->drawText(kText, kTextLen, 0, 0, fillPaint);
diff --git a/gm/tallstretchedbitmaps.cpp b/gm/tallstretchedbitmaps.cpp
index 06b2335..e62c5d7 100644
--- a/gm/tallstretchedbitmaps.cpp
+++ b/gm/tallstretchedbitmaps.cpp
@@ -87,7 +87,7 @@
bmp.width(), bmp.height());
SkRect dstRect = SkRect::MakeWH(SkIntToScalar(bmp.width()), 10.f * itemHeight);
SkPaint paint;
- paint.setFilterLevel(SkPaint::kLow_FilterLevel);
+ paint.setFilterQuality(kLow_SkFilterQuality);
canvas->drawBitmapRect(bmp, &subRect, dstRect, &paint);
canvas->translate(SkIntToScalar(bmp.width() + 10), 0);
}
diff --git a/gm/tiledscaledbitmap.cpp b/gm/tiledscaledbitmap.cpp
index 6b47315..16935ed 100644
--- a/gm/tiledscaledbitmap.cpp
+++ b/gm/tiledscaledbitmap.cpp
@@ -58,7 +58,7 @@
SkPaint paint;
paint.setAntiAlias(true);
- paint.setFilterLevel(SkPaint::kHigh_FilterLevel);
+ paint.setFilterQuality(kHigh_SkFilterQuality);
SkMatrix mat;
mat.setScale(121.f/360.f, 93.f/288.f);
diff --git a/gm/tilemodes.cpp b/gm/tilemodes.cpp
index 8dc54a9..193f8a6 100644
--- a/gm/tilemodes.cpp
+++ b/gm/tilemodes.cpp
@@ -38,7 +38,7 @@
SkShader::TileMode tmx, SkShader::TileMode tmy) {
SkShader* shader = SkShader::CreateBitmapShader(bm, tmx, tmy);
paint->setShader(shader)->unref();
- paint->setFilterLevel(filter ? SkPaint::kLow_FilterLevel : SkPaint::kNone_FilterLevel);
+ paint->setFilterQuality(filter ? kLow_SkFilterQuality : kNone_SkFilterQuality);
}
static const SkColorType gColorTypes[] = {
diff --git a/gm/tilemodes_scaled.cpp b/gm/tilemodes_scaled.cpp
index 508e576..a8227a0 100644
--- a/gm/tilemodes_scaled.cpp
+++ b/gm/tilemodes_scaled.cpp
@@ -35,11 +35,11 @@
canvas.drawPaint(paint);
}
-static void setup(SkPaint* paint, const SkBitmap& bm, SkPaint::FilterLevel filter_level,
+static void setup(SkPaint* paint, const SkBitmap& bm, SkFilterQuality filter_level,
SkShader::TileMode tmx, SkShader::TileMode tmy) {
SkShader* shader = SkShader::CreateBitmapShader(bm, tmx, tmy);
paint->setShader(shader)->unref();
- paint->setFilterLevel(filter_level);
+ paint->setFilterQuality(filter_level);
}
static const SkColorType gColorTypes[] = {
@@ -91,12 +91,12 @@
static const char* gColorTypeNames[] = { "8888" , "565", "4444" };
- static const SkPaint::FilterLevel gFilterLevels[] =
- { SkPaint::kNone_FilterLevel,
- SkPaint::kLow_FilterLevel,
- SkPaint::kMedium_FilterLevel,
- SkPaint::kHigh_FilterLevel };
- static const char* gFilterNames[] = { "None", "Low", "Medium", "High" };
+ static const SkFilterQuality gFilterQualitys[] =
+ { kNone_SkFilterQuality,
+ kLow_SkFilterQuality,
+ kMedium_SkFilterQuality,
+ kHigh_SkFilterQuality };
+ static const char* gFilterNames[] = { "None", "Low", "Medium", "High" };
static const SkShader::TileMode gModes[] = { SkShader::kClamp_TileMode, SkShader::kRepeat_TileMode, SkShader::kMirror_TileMode };
static const char* gModeNames[] = { "C", "R", "M" };
@@ -124,7 +124,7 @@
y = SkIntToScalar(40) / scale;
for (size_t i = 0; i < SK_ARRAY_COUNT(gColorTypes); i++) {
- for (size_t j = 0; j < SK_ARRAY_COUNT(gFilterLevels); j++) {
+ for (size_t j = 0; j < SK_ARRAY_COUNT(gFilterQualitys); j++) {
x = SkIntToScalar(10)/scale;
for (size_t kx = 0; kx < SK_ARRAY_COUNT(gModes); kx++) {
for (size_t ky = 0; ky < SK_ARRAY_COUNT(gModes); ky++) {
@@ -135,7 +135,7 @@
makebm(&fTexture[i], gColorTypes[i], size, size);
}
#endif
- setup(&paint, fTexture[i], gFilterLevels[j], gModes[kx], gModes[ky]);
+ setup(&paint, fTexture[i], gFilterQualitys[j], gModes[kx], gModes[ky]);
paint.setDither(true);
canvas->save();
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h
index 31090c8..79821e5 100644
--- a/include/core/SkPaint.h
+++ b/include/core/SkPaint.h
@@ -14,9 +14,6 @@
#include "SkMatrix.h"
#include "SkXfermode.h"
-// TODO: clean up Skia internals so we can remove this and only keep it for clients
-#define SK_SUPPORT_LEGACY_FILTERLEVEL_ENUM
-
class SkAnnotation;
class SkAutoGlyphCache;
class SkColorFilter;
diff --git a/include/effects/SkMatrixImageFilter.h b/include/effects/SkMatrixImageFilter.h
index 7d855b7..d0afdc3 100644
--- a/include/effects/SkMatrixImageFilter.h
+++ b/include/effects/SkMatrixImageFilter.h
@@ -29,9 +29,17 @@
*/
static SkMatrixImageFilter* Create(const SkMatrix& transform,
- SkPaint::FilterLevel,
+ SkFilterQuality,
SkImageFilter* input = NULL,
uint32_t uniqueID = 0);
+#ifdef SK_SUPPORT_LEGACY_FILTERLEVEL_ENUM
+ static SkMatrixImageFilter* Create(const SkMatrix& transform,
+ SkPaint::FilterLevel level,
+ SkImageFilter* input = NULL,
+ uint32_t uniqueID = 0) {
+ return Create(transform, SkFilterQuality(level), input, uniqueID);
+ }
+#endif
virtual ~SkMatrixImageFilter();
void computeFastBounds(const SkRect&, SkRect*) const SK_OVERRIDE;
@@ -41,7 +49,7 @@
protected:
SkMatrixImageFilter(const SkMatrix& transform,
- SkPaint::FilterLevel,
+ SkFilterQuality,
SkImageFilter* input,
uint32_t uniqueID);
void flatten(SkWriteBuffer&) const SK_OVERRIDE;
@@ -53,7 +61,7 @@
private:
SkMatrix fTransform;
- SkPaint::FilterLevel fFilterLevel;
+ SkFilterQuality fFilterQuality;
typedef SkImageFilter INHERITED;
};
diff --git a/include/effects/SkPictureImageFilter.h b/include/effects/SkPictureImageFilter.h
index e6579eab..332663f 100644
--- a/include/effects/SkPictureImageFilter.h
+++ b/include/effects/SkPictureImageFilter.h
@@ -28,7 +28,7 @@
uint32_t uniqueID = 0) {
return SkNEW_ARGS(SkPictureImageFilter, (picture, cropRect, uniqueID,
kDeviceSpace_PictureResolution,
- SkPaint::kLow_FilterLevel));
+ kLow_SkFilterQuality));
}
/**
@@ -40,12 +40,19 @@
*/
static SkPictureImageFilter* CreateForLocalSpace(const SkPicture* picture,
const SkRect& cropRect,
- SkPaint::FilterLevel filterLevel,
+ SkFilterQuality filterQuality,
uint32_t uniqueID = 0) {
return SkNEW_ARGS(SkPictureImageFilter, (picture, cropRect, uniqueID,
- kLocalSpace_PictureResolution, filterLevel));
+ kLocalSpace_PictureResolution, filterQuality));
}
-
+#ifdef SK_SUPPORT_LEGACY_FILTERLEVEL_ENUM
+ static SkPictureImageFilter* CreateForLocalSpace(const SkPicture* picture,
+ const SkRect& cropRect,
+ SkPaint::FilterLevel filterLevel,
+ uint32_t uniqueID = 0) {
+ return CreateForLocalSpace(picture, cropRect, (SkFilterQuality)filterLevel, uniqueID);
+ }
+#endif
SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPictureImageFilter)
@@ -57,7 +64,7 @@
explicit SkPictureImageFilter(const SkPicture* picture, uint32_t uniqueID);
SkPictureImageFilter(const SkPicture* picture, const SkRect& cropRect, uint32_t uniqueID,
- PictureResolution, SkPaint::FilterLevel);
+ PictureResolution, SkFilterQuality);
virtual ~SkPictureImageFilter();
/* Constructs an SkPictureImageFilter object from an SkReadBuffer.
* Note: If the SkPictureImageFilter object construction requires bitmap
@@ -80,7 +87,7 @@
const SkPicture* fPicture;
SkRect fCropRect;
PictureResolution fPictureResolution;
- SkPaint::FilterLevel fFilterLevel;
+ SkFilterQuality fFilterQuality;
typedef SkImageFilter INHERITED;
};
diff --git a/samplecode/SampleAll.cpp b/samplecode/SampleAll.cpp
index 16c79c9..39f7722 100644
--- a/samplecode/SampleAll.cpp
+++ b/samplecode/SampleAll.cpp
@@ -393,7 +393,7 @@
canvas->save();
canvas->translate(SkIntToScalar(0), SkIntToScalar(5));
paint.setAntiAlias(true);
- paint.setFilterLevel(SkPaint::kLow_FilterLevel);
+ paint.setFilterQuality(kLow_SkFilterQuality);
// !!! draw through a clip
paint.setColor(SK_ColorLTGRAY);
paint.setStyle(SkPaint::kFill_Style);
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 2b31830..ae30479 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -451,30 +451,30 @@
{SkPaint::kFull_Hinting, "Full", "Hf " },
};
-struct FilterLevelState {
- SkPaint::FilterLevel fLevel;
- const char* fName;
- const char* fLabel;
+struct FilterQualityState {
+ SkFilterQuality fQuality;
+ const char* fName;
+ const char* fLabel;
};
-static FilterLevelState gFilterLevelStates[] = {
- { SkPaint::kNone_FilterLevel, "Mixed", NULL },
- { SkPaint::kNone_FilterLevel, "None", "F0 " },
- { SkPaint::kLow_FilterLevel, "Low", "F1 " },
- { SkPaint::kMedium_FilterLevel, "Medium", "F2 " },
- { SkPaint::kHigh_FilterLevel, "High", "F3 " },
+static FilterQualityState gFilterQualityStates[] = {
+ { kNone_SkFilterQuality, "Mixed", NULL },
+ { kNone_SkFilterQuality, "None", "F0 " },
+ { kLow_SkFilterQuality, "Low", "F1 " },
+ { kMedium_SkFilterQuality, "Medium", "F2 " },
+ { kHigh_SkFilterQuality, "High", "F3 " },
};
class FlagsDrawFilter : public SkDrawFilter {
public:
FlagsDrawFilter(SkOSMenu::TriState lcd, SkOSMenu::TriState aa,
- SkOSMenu::TriState subpixel, int hinting, int filterlevel)
+ SkOSMenu::TriState subpixel, int hinting, int filterQuality)
: fLCDState(lcd)
, fAAState(aa)
, fSubpixelState(subpixel)
, fHintingState(hinting)
- , fFilterLevelIndex(filterlevel)
+ , fFilterQualityIndex(filterQuality)
{
- SkASSERT((unsigned)filterlevel < SK_ARRAY_COUNT(gFilterLevelStates));
+ SkASSERT((unsigned)filterQuality < SK_ARRAY_COUNT(gFilterQualityStates));
}
virtual bool filter(SkPaint* paint, Type t) {
@@ -484,8 +484,8 @@
if (SkOSMenu::kMixedState != fAAState) {
paint->setAntiAlias(SkOSMenu::kOnState == fAAState);
}
- if (0 != fFilterLevelIndex) {
- paint->setFilterLevel(gFilterLevelStates[fFilterLevelIndex].fLevel);
+ if (0 != fFilterQualityIndex) {
+ paint->setFilterQuality(gFilterQualityStates[fFilterQualityIndex].fQuality);
}
if (SkOSMenu::kMixedState != fSubpixelState) {
paint->setSubpixelText(SkOSMenu::kOnState == fSubpixelState);
@@ -501,7 +501,7 @@
SkOSMenu::TriState fAAState;
SkOSMenu::TriState fSubpixelState;
int fHintingState;
- int fFilterLevelIndex;
+ int fFilterQualityIndex;
};
//////////////////////////////////////////////////////////////////////////////
@@ -804,7 +804,7 @@
fAAState = SkOSMenu::kMixedState;
fSubpixelState = SkOSMenu::kMixedState;
fHintingState = 0;
- fFilterLevelIndex = 0;
+ fFilterQualityIndex = 0;
fFlipAxis = 0;
fScrollTestX = fScrollTestY = 0;
@@ -839,12 +839,12 @@
fAppMenu->assignKeyEquivalentToItem(itemID, 'b');
itemID = fAppMenu->appendTriState("LCD", "LCD", sinkID, fLCDState);
fAppMenu->assignKeyEquivalentToItem(itemID, 'l');
- itemID = fAppMenu->appendList("FilterLevel", "FilterLevel", sinkID, fFilterLevelIndex,
- gFilterLevelStates[0].fName,
- gFilterLevelStates[1].fName,
- gFilterLevelStates[2].fName,
- gFilterLevelStates[3].fName,
- gFilterLevelStates[4].fName,
+ itemID = fAppMenu->appendList("FilterQuality", "FilterQuality", sinkID, fFilterQualityIndex,
+ gFilterQualityStates[0].fName,
+ gFilterQualityStates[1].fName,
+ gFilterQualityStates[2].fName,
+ gFilterQualityStates[3].fName,
+ gFilterQualityStates[4].fName,
NULL);
fAppMenu->assignKeyEquivalentToItem(itemID, 'n');
itemID = fAppMenu->appendTriState("Subpixel", "Subpixel", sinkID, fSubpixelState);
@@ -1423,7 +1423,7 @@
void SampleWindow::installDrawFilter(SkCanvas* canvas) {
canvas->setDrawFilter(new FlagsDrawFilter(fLCDState, fAAState, fSubpixelState,
- fHintingState, fFilterLevelIndex))->unref();
+ fHintingState, fFilterQualityIndex))->unref();
}
void SampleWindow::postAnimatingEvent() {
@@ -1473,7 +1473,7 @@
}
if (SkOSMenu::FindTriState(evt, "AA", &fAAState) ||
SkOSMenu::FindTriState(evt, "LCD", &fLCDState) ||
- SkOSMenu::FindListIndex(evt, "FilterLevel", &fFilterLevelIndex) ||
+ SkOSMenu::FindListIndex(evt, "FilterQuality", &fFilterQualityIndex) ||
SkOSMenu::FindTriState(evt, "Subpixel", &fSubpixelState) ||
SkOSMenu::FindListIndex(evt, "Hinting", &fHintingState) ||
SkOSMenu::FindSwitchState(evt, "Clip", &fUseClip) ||
@@ -1905,7 +1905,7 @@
title.prepend(trystate_str(fLCDState, "LCD ", "lcd "));
title.prepend(trystate_str(fAAState, "AA ", "aa "));
- title.prepend(gFilterLevelStates[fFilterLevelIndex].fLabel);
+ title.prepend(gFilterQualityStates[fFilterQualityIndex].fLabel);
title.prepend(trystate_str(fSubpixelState, "S ", "s "));
title.prepend(fFlipAxis & kFlipAxis_X ? "X " : NULL);
title.prepend(fFlipAxis & kFlipAxis_Y ? "Y " : NULL);
diff --git a/samplecode/SampleApp.h b/samplecode/SampleApp.h
index 2385fc0..990ad0b 100644
--- a/samplecode/SampleApp.h
+++ b/samplecode/SampleApp.h
@@ -202,7 +202,7 @@
SkOSMenu::TriState fAAState;
SkOSMenu::TriState fSubpixelState;
int fHintingState;
- int fFilterLevelIndex;
+ int fFilterQualityIndex;
unsigned fFlipAxis;
int fMSAASampleCount;
diff --git a/samplecode/SampleBitmapRect.cpp b/samplecode/SampleBitmapRect.cpp
index 82d1098..3c700ec 100644
--- a/samplecode/SampleBitmapRect.cpp
+++ b/samplecode/SampleBitmapRect.cpp
@@ -130,7 +130,7 @@
canvas->drawRect(srcR, paint);
for (int i = 0; i < 2; ++i) {
- paint.setFilterLevel(1 == i ? SkPaint::kLow_FilterLevel : SkPaint::kNone_FilterLevel);
+ paint.setFilterQuality(1 == i ? kLow_SkFilterQuality : kNone_SkFilterQuality);
canvas->drawBitmapRectToRect(bitmap, &srcR, fDstR[i], &paint);
canvas->drawRect(fDstR[i], paint);
}
@@ -224,7 +224,7 @@
paint.setColor(SK_ColorYELLOW);
for (int i = 0; i < 2; ++i) {
- paint.setFilterLevel(1 == i ? SkPaint::kLow_FilterLevel : SkPaint::kNone_FilterLevel);
+ paint.setFilterQuality(1 == i ? kLow_SkFilterQuality : kNone_SkFilterQuality);
canvas->drawBitmapRectToRect(fBitmap, &fSrcR, fDstR[i], &paint);
canvas->drawRect(fDstR[i], paint);
}
diff --git a/samplecode/SampleCamera.cpp b/samplecode/SampleCamera.cpp
index af9dbe8..c0d4f4f 100644
--- a/samplecode/SampleCamera.cpp
+++ b/samplecode/SampleCamera.cpp
@@ -83,7 +83,7 @@
paint.setAntiAlias(true);
paint.setShader(fShaders[fShaderIndex]);
- paint.setFilterLevel(SkPaint::kLow_FilterLevel);
+ paint.setFilterQuality(kLow_SkFilterQuality);
SkRect r = { -150, -150, 150, 150 };
canvas->drawRoundRect(r, 30, 30, paint);
}
diff --git a/samplecode/SampleFilter.cpp b/samplecode/SampleFilter.cpp
index ae66a0c..3713a72 100644
--- a/samplecode/SampleFilter.cpp
+++ b/samplecode/SampleFilter.cpp
@@ -47,7 +47,7 @@
static SkScalar draw_set(SkCanvas* c, const SkBitmap& bm, SkScalar x, SkPaint* p) {
x += draw_bm(c, bm, x, 0, p);
- p->setFilterLevel(SkPaint::kLow_FilterLevel);
+ p->setFilterQuality(kLow_SkFilterQuality);
x += draw_bm(c, bm, x, 0, p);
p->setDither(true);
return x + draw_bm(c, bm, x, 0, p);
diff --git a/samplecode/SampleFilter2.cpp b/samplecode/SampleFilter2.cpp
index 0c81196..3541e15 100644
--- a/samplecode/SampleFilter2.cpp
+++ b/samplecode/SampleFilter2.cpp
@@ -74,7 +74,7 @@
canvas->scale(SK_Scalar1, scale);
for (int k = 0; k < 2; k++) {
- paint.setFilterLevel(k == 1 ? SkPaint::kLow_FilterLevel : SkPaint::kNone_FilterLevel);
+ paint.setFilterQuality(k == 1 ? kLow_SkFilterQuality : kNone_SkFilterQuality);
for (int j = 0; j < 2; j++) {
paint.setDither(j == 1);
for (int i = 0; i < fBitmapCount; i++) {
@@ -91,7 +91,7 @@
SkString s("dither=");
s.appendS32(paint.isDither());
s.append(" filter=");
- s.appendS32(paint.getFilterLevel() != SkPaint::kNone_FilterLevel);
+ s.appendS32(paint.getFilterQuality() != kNone_SkFilterQuality);
canvas->drawText(s.c_str(), s.size(), x + W/2,
y - p.getTextSize(), p);
}
diff --git a/samplecode/SampleFilterFuzz.cpp b/samplecode/SampleFilterFuzz.cpp
index 894e4fa..b2c15aa 100644
--- a/samplecode/SampleFilterFuzz.cpp
+++ b/samplecode/SampleFilterFuzz.cpp
@@ -311,7 +311,7 @@
break;
case MATRIX:
filter = SkMatrixImageFilter::Create(make_matrix(),
- (SkPaint::FilterLevel)R(4),
+ (SkFilterQuality)R(4),
make_image_filter());
break;
case MATRIX_CONVOLUTION:
diff --git a/samplecode/SampleFilterQuality.cpp b/samplecode/SampleFilterQuality.cpp
index fe94864..79457b8 100644
--- a/samplecode/SampleFilterQuality.cpp
+++ b/samplecode/SampleFilterQuality.cpp
@@ -175,11 +175,11 @@
return this->INHERITED::onQuery(evt);
}
- void drawTheImage(SkCanvas* canvas, const SkISize& size, SkPaint::FilterLevel filter,
+ void drawTheImage(SkCanvas* canvas, const SkISize& size, SkFilterQuality filter,
SkScalar dx, SkScalar dy) {
SkPaint paint;
paint.setAntiAlias(true);
- paint.setFilterLevel(filter);
+ paint.setFilterQuality(filter);
SkAutoCanvasRestore acr(canvas, true);
@@ -197,7 +197,7 @@
}
}
- void drawHere(SkCanvas* canvas, SkPaint::FilterLevel filter, SkScalar dx, SkScalar dy) {
+ void drawHere(SkCanvas* canvas, SkFilterQuality filter, SkScalar dx, SkScalar dy) {
SkCanvas* origCanvas = canvas;
SkAutoCanvasRestore acr(canvas, true);
@@ -253,7 +253,7 @@
SkRect r = SkRect::MakeWH(fCell.width(), fCell.height());
r.inset(4, 4);
canvas->clipRect(r);
- this->drawHere(canvas, SkPaint::FilterLevel(index), trans[0], trans[1]);
+ this->drawHere(canvas, SkFilterQuality(index), trans[0], trans[1]);
}
}
diff --git a/samplecode/SampleIdentityScale.cpp b/samplecode/SampleIdentityScale.cpp
index 073bc7c..84b2bd5 100644
--- a/samplecode/SampleIdentityScale.cpp
+++ b/samplecode/SampleIdentityScale.cpp
@@ -57,7 +57,7 @@
paint.setAntiAlias(true);
paint.setTextSize(48);
- paint.setFilterLevel(SkPaint::kHigh_FilterLevel);
+ paint.setFilterQuality(kHigh_SkFilterQuality);
SkTime::DateTime time;
SkTime::GetDateTime(&time);
diff --git a/samplecode/SamplePatch.cpp b/samplecode/SamplePatch.cpp
index 4153682..478d822 100644
--- a/samplecode/SamplePatch.cpp
+++ b/samplecode/SamplePatch.cpp
@@ -276,7 +276,7 @@
SkPaint paint;
paint.setDither(true);
- paint.setFilterLevel(SkPaint::kLow_FilterLevel);
+ paint.setFilterQuality(kLow_SkFilterQuality);
canvas->translate(DX, DY);
diff --git a/samplecode/SampleSlides.cpp b/samplecode/SampleSlides.cpp
index e115235..b626cdb 100644
--- a/samplecode/SampleSlides.cpp
+++ b/samplecode/SampleSlides.cpp
@@ -438,7 +438,7 @@
SkPaint paint;
paint.setDither(true);
- paint.setFilterLevel(SkPaint::kLow_FilterLevel);
+ paint.setFilterQuality(kLow_SkFilterQuality);
for (size_t i = 0; i < SK_ARRAY_COUNT(fRecs); i++) {
canvas->save();
diff --git a/samplecode/SampleSubpixelTranslate.cpp b/samplecode/SampleSubpixelTranslate.cpp
index 58ad072..fe8062b 100644
--- a/samplecode/SampleSubpixelTranslate.cpp
+++ b/samplecode/SampleSubpixelTranslate.cpp
@@ -62,11 +62,11 @@
void onDrawContent(SkCanvas* canvas) SK_OVERRIDE {
- static const SkPaint::FilterLevel gLevels[] = {
- SkPaint::kNone_FilterLevel,
- SkPaint::kLow_FilterLevel,
- SkPaint::kMedium_FilterLevel,
- SkPaint::kHigh_FilterLevel
+ static const SkFilterQuality gQualitys[] = {
+ kNone_SkFilterQuality,
+ kLow_SkFilterQuality,
+ kMedium_SkFilterQuality,
+ kHigh_SkFilterQuality
};
SkPaint paint;
@@ -74,37 +74,37 @@
paint.setSubpixelText(true);
paint.setAntiAlias(true);
- for (size_t i = 0; i < SK_ARRAY_COUNT(gLevels); ++i) {
- paint.setFilterLevel(gLevels[i]);
+ for (size_t i = 0; i < SK_ARRAY_COUNT(gQualitys); ++i) {
+ paint.setFilterQuality(gQualitys[i]);
SkRect r = SkRect::MakeXYWH( fCurPos.fX + i * (fSize + 10), fCurPos.fY, fSize, fSize );
canvas->drawBitmapRect( fBM, r, &paint );
}
- canvas->drawText( "AA Scaled", strlen("AA Scaled"), fCurPos.fX + SK_ARRAY_COUNT(gLevels) * (fSize + 10), fCurPos.fY + fSize/2, paint );
+ canvas->drawText( "AA Scaled", strlen("AA Scaled"), fCurPos.fX + SK_ARRAY_COUNT(gQualitys) * (fSize + 10), fCurPos.fY + fSize/2, paint );
paint.setAntiAlias(false);
- for (size_t i = 0; i < SK_ARRAY_COUNT(gLevels); ++i) {
- paint.setFilterLevel(gLevels[i]);
+ for (size_t i = 0; i < SK_ARRAY_COUNT(gQualitys); ++i) {
+ paint.setFilterQuality(gQualitys[i]);
SkRect r = SkRect::MakeXYWH( fCurPos.fX + i * (fSize + 10), fCurPos.fY + fSize + 10, fSize, fSize );
canvas->drawBitmapRect( fBM, r, &paint );
}
- canvas->drawText( "Scaled", strlen("Scaled"), fCurPos.fX + SK_ARRAY_COUNT(gLevels) * (fSize + 10), fCurPos.fY + fSize + 10 + fSize/2, paint );
+ canvas->drawText( "Scaled", strlen("Scaled"), fCurPos.fX + SK_ARRAY_COUNT(gQualitys) * (fSize + 10), fCurPos.fY + fSize + 10 + fSize/2, paint );
paint.setAntiAlias(true);
- for (size_t i = 0; i < SK_ARRAY_COUNT(gLevels); ++i) {
- paint.setFilterLevel(gLevels[i]);
+ for (size_t i = 0; i < SK_ARRAY_COUNT(gQualitys); ++i) {
+ paint.setFilterQuality(gQualitys[i]);
canvas->drawBitmap( fBM, fCurPos.fX + i * (fBM.width() + 10), fCurPos.fY + 2*(fSize + 10), &paint );
}
- canvas->drawText( "AA No Scale", strlen("AA No Scale"), fCurPos.fX + SK_ARRAY_COUNT(gLevels) * (fBM.width() + 10), fCurPos.fY + 2*(fSize + 10) + fSize/2, paint );
+ canvas->drawText( "AA No Scale", strlen("AA No Scale"), fCurPos.fX + SK_ARRAY_COUNT(gQualitys) * (fBM.width() + 10), fCurPos.fY + 2*(fSize + 10) + fSize/2, paint );
paint.setAntiAlias(false);
- for (size_t i = 0; i < SK_ARRAY_COUNT(gLevels); ++i) {
- paint.setFilterLevel(gLevels[i]);
+ for (size_t i = 0; i < SK_ARRAY_COUNT(gQualitys); ++i) {
+ paint.setFilterQuality(gQualitys[i]);
canvas->drawBitmap( fBM, fCurPos.fX + i * (fBM.width() + 10), fCurPos.fY + 2*(fSize + 10) + fBM.height() + 10, &paint );
}
- canvas->drawText( "No Scale", strlen("No Scale"), fCurPos.fX + SK_ARRAY_COUNT(gLevels) * (fBM.width() + 10), fCurPos.fY + 2*(fSize + 10) + fBM.height() + 10 + fSize/2, paint );
+ canvas->drawText( "No Scale", strlen("No Scale"), fCurPos.fX + SK_ARRAY_COUNT(gQualitys) * (fBM.width() + 10), fCurPos.fY + 2*(fSize + 10) + fBM.height() + 10 + fSize/2, paint );
fCurPos.fX += fHorizontalVelocity;
diff --git a/samplecode/SampleTextureDomain.cpp b/samplecode/SampleTextureDomain.cpp
index af511c7..2794a06 100644
--- a/samplecode/SampleTextureDomain.cpp
+++ b/samplecode/SampleTextureDomain.cpp
@@ -47,7 +47,7 @@
SkRect srcRect;
SkRect dstRect;
SkPaint paint;
- paint.setFilterLevel(SkPaint::kLow_FilterLevel);
+ paint.setFilterQuality(kLow_SkFilterQuality);
// Test that bitmap draws from malloc-backed bitmaps respect
// the constrained texture domain.
diff --git a/samplecode/SampleTiling.cpp b/samplecode/SampleTiling.cpp
index 4f073bd..5f995e2 100644
--- a/samplecode/SampleTiling.cpp
+++ b/samplecode/SampleTiling.cpp
@@ -44,7 +44,7 @@
SkShader::TileMode tmx, SkShader::TileMode tmy) {
SkShader* shader = SkShader::CreateBitmapShader(bm, tmx, tmy);
paint->setShader(shader)->unref();
- paint->setFilterLevel(filter ? SkPaint::kLow_FilterLevel : SkPaint::kNone_FilterLevel);
+ paint->setFilterQuality(filter ? kLow_SkFilterQuality : kNone_SkFilterQuality);
}
static const SkColorType gColorTypes[] = {
diff --git a/samplecode/SampleVertices.cpp b/samplecode/SampleVertices.cpp
index 6dac0b5..f334a87 100644
--- a/samplecode/SampleVertices.cpp
+++ b/samplecode/SampleVertices.cpp
@@ -90,7 +90,7 @@
void onDrawContent(SkCanvas* canvas) SK_OVERRIDE {
SkPaint paint;
paint.setDither(true);
- paint.setFilterLevel(SkPaint::kLow_FilterLevel);
+ paint.setFilterQuality(kLow_SkFilterQuality);
for (size_t i = 0; i < SK_ARRAY_COUNT(fRecs); i++) {
canvas->save();
diff --git a/src/animator/SkDrawPaint.cpp b/src/animator/SkDrawPaint.cpp
index c882427..f5d3388 100644
--- a/src/animator/SkDrawPaint.cpp
+++ b/src/animator/SkDrawPaint.cpp
@@ -218,7 +218,7 @@
if (fakeBold != -1)
paint->setFakeBoldText(SkToBool(fakeBold));
if (filterBitmap != -1)
- paint->setFilterLevel(filterBitmap ? SkPaint::kLow_FilterLevel : SkPaint::kNone_FilterLevel);
+ paint->setFilterQuality(filterBitmap ? kLow_SkFilterQuality : kNone_SkFilterQuality);
// stroke is legacy; style setting if present overrides stroke
if (stroke != -1)
paint->setStyle(SkToBool(stroke) ? SkPaint::kStroke_Style : SkPaint::kFill_Style);
diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp
index 456e0d4..c1a03fe 100644
--- a/src/core/SkBitmapProcShader.cpp
+++ b/src/core/SkBitmapProcShader.cpp
@@ -397,14 +397,14 @@
// are provided by the caller.
bool useBicubic = false;
GrTextureParams::FilterMode textureFilterMode;
- switch(paint.getFilterLevel()) {
- case SkPaint::kNone_FilterLevel:
+ switch(paint.getFilterQuality()) {
+ case kNone_SkFilterQuality:
textureFilterMode = GrTextureParams::kNone_FilterMode;
break;
- case SkPaint::kLow_FilterLevel:
+ case kLow_SkFilterQuality:
textureFilterMode = GrTextureParams::kBilerp_FilterMode;
break;
- case SkPaint::kMedium_FilterLevel: {
+ case kMedium_SkFilterQuality: {
SkMatrix matrix;
matrix.setConcat(viewM, this->getLocalMatrix());
if (matrix.getMinScale() < SK_Scalar1) {
@@ -415,7 +415,7 @@
}
break;
}
- case SkPaint::kHigh_FilterLevel: {
+ case kHigh_SkFilterQuality: {
SkMatrix matrix;
matrix.setConcat(viewM, this->getLocalMatrix());
useBicubic = GrBicubicEffect::ShouldUseBicubic(matrix, &textureFilterMode);
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp
index 335924f..42d9c10 100644
--- a/src/core/SkBitmapProcState.cpp
+++ b/src/core/SkBitmapProcState.cpp
@@ -143,11 +143,11 @@
* using bilerp for any remaining transformations.
*/
void SkBitmapProcState::processHQRequest() {
- SkASSERT(SkPaint::kHigh_FilterLevel == fFilterLevel);
+ SkASSERT(kHigh_SkFilterQuality == fFilterLevel);
// Our default return state is to downgrade the request to Medium, w/ or w/o setting fBitmap
// to a valid bitmap. If we succeed, we will set this to Low instead.
- fFilterLevel = SkPaint::kMedium_FilterLevel;
+ fFilterLevel = kMedium_SkFilterQuality;
if (kN32_SkColorType != fOrigBitmap.colorType() || !cache_size_okay(fOrigBitmap, fInvMatrix) ||
fInvMatrix.hasPerspective())
@@ -194,7 +194,7 @@
fInvMatrix.postScale(roundedDestWidth / fOrigBitmap.width(),
roundedDestHeight / fOrigBitmap.height());
- fFilterLevel = SkPaint::kLow_FilterLevel;
+ fFilterLevel = kLow_SkFilterQuality;
}
/*
@@ -202,11 +202,11 @@
* (in this case, we have the inverse, so it succeeds if fInvMatrix is upscaling)
*/
void SkBitmapProcState::processMediumRequest() {
- SkASSERT(SkPaint::kMedium_FilterLevel == fFilterLevel);
+ SkASSERT(kMedium_SkFilterQuality == fFilterLevel);
// Our default return state is to downgrade the request to Low, w/ or w/o setting fBitmap
// to a valid bitmap.
- fFilterLevel = SkPaint::kLow_FilterLevel;
+ fFilterLevel = kLow_SkFilterQuality;
SkScalar invScale = effective_matrix_scale(fInvMatrix);
@@ -289,17 +289,17 @@
fBitmap = NULL;
fInvMatrix = inv;
- fFilterLevel = paint.getFilterLevel();
+ fFilterLevel = paint.getFilterQuality();
- if (SkPaint::kHigh_FilterLevel == fFilterLevel) {
+ if (kHigh_SkFilterQuality == fFilterLevel) {
this->processHQRequest();
}
- SkASSERT(fFilterLevel < SkPaint::kHigh_FilterLevel);
+ SkASSERT(fFilterLevel < kHigh_SkFilterQuality);
- if (SkPaint::kMedium_FilterLevel == fFilterLevel) {
+ if (kMedium_SkFilterQuality == fFilterLevel) {
this->processMediumRequest();
}
- SkASSERT(fFilterLevel < SkPaint::kMedium_FilterLevel);
+ SkASSERT(fFilterLevel < kMedium_SkFilterQuality);
if (NULL == fBitmap) {
if (!this->lockBaseBitmap()) {
@@ -362,14 +362,14 @@
trivialMatrix = (fInvMatrix.getType() & ~SkMatrix::kTranslate_Mask) == 0;
- if (SkPaint::kLow_FilterLevel == fFilterLevel) {
+ if (kLow_SkFilterQuality == fFilterLevel) {
// Only try bilerp if the matrix is "interesting" and
// the image has a suitable size.
if (fInvType <= SkMatrix::kTranslate_Mask ||
!valid_for_filtering(fBitmap->width() | fBitmap->height()))
{
- fFilterLevel = SkPaint::kNone_FilterLevel;
+ fFilterLevel = kNone_SkFilterQuality;
}
}
@@ -392,7 +392,7 @@
// still set to HQ by the time we get here, then we must have installed
// the shader procs above and can skip all this.
- if (fFilterLevel < SkPaint::kHigh_FilterLevel) {
+ if (fFilterLevel < kHigh_SkFilterQuality) {
int index = 0;
if (fAlphaScale < 256) { // note: this distinction is not used for D16
@@ -401,7 +401,7 @@
if (fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask)) {
index |= 2;
}
- if (fFilterLevel > SkPaint::kNone_FilterLevel) {
+ if (fFilterLevel > kNone_SkFilterQuality) {
index |= 4;
}
// bits 3,4,5 encoding the source bitmap format
@@ -544,7 +544,7 @@
SkASSERT(((s.fInvType & ~SkMatrix::kTranslate_Mask)) == 0);
SkASSERT(s.fInvKy == 0);
SkASSERT(count > 0 && colors != NULL);
- SkASSERT(SkPaint::kNone_FilterLevel == s.fFilterLevel);
+ SkASSERT(kNone_SkFilterQuality == s.fFilterLevel);
const int maxX = s.fBitmap->width() - 1;
const int maxY = s.fBitmap->height() - 1;
@@ -618,7 +618,7 @@
SkASSERT(((s.fInvType & ~SkMatrix::kTranslate_Mask)) == 0);
SkASSERT(s.fInvKy == 0);
SkASSERT(count > 0 && colors != NULL);
- SkASSERT(SkPaint::kNone_FilterLevel == s.fFilterLevel);
+ SkASSERT(kNone_SkFilterQuality == s.fFilterLevel);
const int stopX = s.fBitmap->width();
const int stopY = s.fBitmap->height();
@@ -664,7 +664,7 @@
int iY1 SK_INIT_TO_AVOID_WARNING;
int iSubY SK_INIT_TO_AVOID_WARNING;
- if (SkPaint::kNone_FilterLevel != s.fFilterLevel) {
+ if (kNone_SkFilterQuality != s.fFilterLevel) {
SkBitmapProcState::MatrixProc mproc = s.getMatrixProc();
uint32_t xy[2];
@@ -745,7 +745,7 @@
const SkPMColor* row0 = s.fBitmap->getAddr32(0, iY0);
SkPMColor color;
- if (SkPaint::kNone_FilterLevel != s.fFilterLevel) {
+ if (kNone_SkFilterQuality != s.fFilterLevel) {
const SkPMColor* row1 = s.fBitmap->getAddr32(0, iY1);
if (s.fAlphaScale < 256) {
@@ -801,7 +801,7 @@
static const unsigned kMask = SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask;
if (1 == fBitmap->width() && 0 == (fInvType & ~kMask)) {
- if (SkPaint::kNone_FilterLevel == fFilterLevel &&
+ if (kNone_SkFilterQuality == fFilterLevel &&
fInvType <= SkMatrix::kTranslate_Mask &&
!this->setupForTranslate()) {
return DoNothing_shaderproc;
@@ -815,7 +815,7 @@
if (fInvType > SkMatrix::kTranslate_Mask) {
return NULL;
}
- if (SkPaint::kNone_FilterLevel != fFilterLevel) {
+ if (kNone_SkFilterQuality != fFilterLevel) {
return NULL;
}
@@ -911,9 +911,9 @@
// scale -vs- affine
// filter -vs- nofilter
if (state.fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask)) {
- proc = state.fFilterLevel != SkPaint::kNone_FilterLevel ? check_scale_filter : check_scale_nofilter;
+ proc = state.fFilterLevel != kNone_SkFilterQuality ? check_scale_filter : check_scale_nofilter;
} else {
- proc = state.fFilterLevel != SkPaint::kNone_FilterLevel ? check_affine_filter : check_affine_nofilter;
+ proc = state.fFilterLevel != kNone_SkFilterQuality ? check_affine_filter : check_affine_nofilter;
}
proc(bitmapXY, count, state.fBitmap->width(), state.fBitmap->height());
}
@@ -948,7 +948,7 @@
size >>= 2;
}
- if (fFilterLevel != SkPaint::kNone_FilterLevel) {
+ if (fFilterLevel != kNone_SkFilterQuality) {
size >>= 1;
}
diff --git a/src/core/SkBitmapProcState_matrixProcs.cpp b/src/core/SkBitmapProcState_matrixProcs.cpp
index 851389c..b7a2ccb 100644
--- a/src/core/SkBitmapProcState_matrixProcs.cpp
+++ b/src/core/SkBitmapProcState_matrixProcs.cpp
@@ -477,7 +477,7 @@
SkBitmapProcState::MatrixProc SkBitmapProcState::chooseMatrixProc(bool trivial_matrix) {
// test_int_tileprocs();
// check for our special case when there is no scale/affine/perspective
- if (trivial_matrix && SkPaint::kNone_FilterLevel == fFilterLevel) {
+ if (trivial_matrix && kNone_SkFilterQuality == fFilterLevel) {
fIntTileProcY = choose_int_tile_proc(fTileModeY);
switch (fTileModeX) {
case SkShader::kClamp_TileMode:
@@ -490,7 +490,7 @@
}
int index = 0;
- if (fFilterLevel != SkPaint::kNone_FilterLevel) {
+ if (fFilterLevel != kNone_SkFilterQuality) {
index = 1;
}
if (fInvType & SkMatrix::kPerspective_Mask) {
diff --git a/src/core/SkBitmapProcState_sample.h b/src/core/SkBitmapProcState_sample.h
index 5c5f199..7030516 100644
--- a/src/core/SkBitmapProcState_sample.h
+++ b/src/core/SkBitmapProcState_sample.h
@@ -1,10 +1,10 @@
-
/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+
#include "SkUtils.h"
#if DSTSIZE==32
@@ -42,7 +42,7 @@
const uint32_t* SK_RESTRICT xy,
int count, DSTTYPE* SK_RESTRICT colors) {
SkASSERT(count > 0 && colors != NULL);
- SkASSERT(SkPaint::kNone_FilterLevel == s.fFilterLevel);
+ SkASSERT(kNone_SkFilterQuality == s.fFilterLevel);
SkDEBUGCODE(CHECKSTATE(s);)
#ifdef PREAMBLE
@@ -85,7 +85,7 @@
int count, DSTTYPE* SK_RESTRICT colors) {
SkASSERT(count > 0 && colors != NULL);
SkASSERT(s.fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask));
- SkASSERT(SkPaint::kNone_FilterLevel == s.fFilterLevel);
+ SkASSERT(kNone_SkFilterQuality == s.fFilterLevel);
SkDEBUGCODE(CHECKSTATE(s);)
#ifdef PREAMBLE
@@ -139,7 +139,7 @@
const uint32_t* SK_RESTRICT xy,
int count, DSTTYPE* SK_RESTRICT colors) {
SkASSERT(count > 0 && colors != NULL);
- SkASSERT(s.fFilterLevel != SkPaint::kNone_FilterLevel);
+ SkASSERT(s.fFilterLevel != kNone_SkFilterQuality);
SkDEBUGCODE(CHECKSTATE(s);)
#ifdef PREAMBLE
@@ -185,7 +185,7 @@
const uint32_t* SK_RESTRICT xy,
int count, DSTTYPE* SK_RESTRICT colors) {
SkASSERT(count > 0 && colors != NULL);
- SkASSERT(s.fFilterLevel != SkPaint::kNone_FilterLevel);
+ SkASSERT(s.fFilterLevel != kNone_SkFilterQuality);
SkDEBUGCODE(CHECKSTATE(s);)
#ifdef PREAMBLE
diff --git a/src/core/SkBitmapProcState_shaderproc.h b/src/core/SkBitmapProcState_shaderproc.h
index 0014b4a..7a7d45e 100644
--- a/src/core/SkBitmapProcState_shaderproc.h
+++ b/src/core/SkBitmapProcState_shaderproc.h
@@ -21,7 +21,7 @@
SkMatrix::kScale_Mask)) == 0);
SkASSERT(s.fInvKy == 0);
SkASSERT(count > 0 && colors != NULL);
- SkASSERT(s.fFilterLevel != SkPaint::kNone_FilterLevel);
+ SkASSERT(s.fFilterLevel != kNone_SkFilterQuality);
SkDEBUGCODE(CHECKSTATE(s);)
const unsigned maxX = s.fBitmap->width() - 1;
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 6ddbe02..24281d7 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -1896,7 +1896,7 @@
paint->setFlags(packed >> 16);
paint->setHinting((SkPaint::Hinting)((packed >> 14) & BPF_Mask(kHint_BPF)));
paint->setTextAlign((SkPaint::Align)((packed >> 12) & BPF_Mask(kAlign_BPF)));
- paint->setFilterLevel((SkPaint::FilterLevel)((packed >> 10) & BPF_Mask(kFilter_BPF)));
+ paint->setFilterQuality((SkFilterQuality)((packed >> 10) & BPF_Mask(kFilter_BPF)));
return (FlatFlags)(packed & kFlatFlagMask);
}
@@ -1937,7 +1937,7 @@
*ptr++ = this->getColor();
*ptr++ = pack_paint_flags(this->getFlags(), this->getHinting(), this->getTextAlign(),
- this->getFilterLevel(), flatFlags);
+ this->getFilterQuality(), flatFlags);
*ptr++ = pack_4(this->getStrokeCap(), this->getStrokeJoin(),
this->getStyle(), this->getTextEncoding());
@@ -2257,8 +2257,8 @@
str->append(")</dd>");
str->append("<dt>FilterLevel:</dt><dd>");
- static const char* gFilterLevelStrings[] = { "None", "Low", "Medium", "High" };
- str->append(gFilterLevelStrings[this->getFilterLevel()]);
+ static const char* gFilterQualityStrings[] = { "None", "Low", "Medium", "High" };
+ str->append(gFilterQualityStrings[this->getFilterQuality()]);
str->append("</dd>");
str->append("<dt>TextAlign:</dt><dd>");
diff --git a/src/effects/SkBitmapSource.cpp b/src/effects/SkBitmapSource.cpp
index fc86f19..87c6053 100644
--- a/src/effects/SkBitmapSource.cpp
+++ b/src/effects/SkBitmapSource.cpp
@@ -69,9 +69,9 @@
paint.setXfermodeMode(SkXfermode::kSrc_Mode);
// FIXME: this probably shouldn't be necessary, but drawBitmapRectToRect asserts
// None filtering when it's translate-only
- paint.setFilterLevel(
+ paint.setFilterQuality(
fSrcRect.width() == dstRect.width() && fSrcRect.height() == dstRect.height() ?
- SkPaint::kNone_FilterLevel : SkPaint::kHigh_FilterLevel);
+ kNone_SkFilterQuality : kHigh_SkFilterQuality);
canvas.drawBitmapRectToRect(fBitmap, &fSrcRect, dstRect, &paint);
*result = device.get()->accessBitmap(false);
diff --git a/src/effects/SkMatrixImageFilter.cpp b/src/effects/SkMatrixImageFilter.cpp
index 4d9b1fa..54caca6 100644
--- a/src/effects/SkMatrixImageFilter.cpp
+++ b/src/effects/SkMatrixImageFilter.cpp
@@ -16,33 +16,33 @@
#include "SkRect.h"
SkMatrixImageFilter::SkMatrixImageFilter(const SkMatrix& transform,
- SkPaint::FilterLevel filterLevel,
+ SkFilterQuality filterQuality,
SkImageFilter* input,
uint32_t uniqueID)
: INHERITED(1, &input, NULL, uniqueID),
fTransform(transform),
- fFilterLevel(filterLevel) {
+ fFilterQuality(filterQuality) {
}
SkMatrixImageFilter* SkMatrixImageFilter::Create(const SkMatrix& transform,
- SkPaint::FilterLevel filterLevel,
+ SkFilterQuality filterQuality,
SkImageFilter* input,
uint32_t uniqueID) {
- return SkNEW_ARGS(SkMatrixImageFilter, (transform, filterLevel, input, uniqueID));
+ return SkNEW_ARGS(SkMatrixImageFilter, (transform, filterQuality, input, uniqueID));
}
SkFlattenable* SkMatrixImageFilter::CreateProc(SkReadBuffer& buffer) {
SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
SkMatrix matrix;
buffer.readMatrix(&matrix);
- SkPaint::FilterLevel level = static_cast<SkPaint::FilterLevel>(buffer.readInt());
- return Create(matrix, level, common.getInput(0), common.uniqueID());
+ SkFilterQuality quality = static_cast<SkFilterQuality>(buffer.readInt());
+ return Create(matrix, quality, common.getInput(0), common.uniqueID());
}
void SkMatrixImageFilter::flatten(SkWriteBuffer& buffer) const {
this->INHERITED::flatten(buffer);
buffer.writeMatrix(fTransform);
- buffer.writeInt(fFilterLevel);
+ buffer.writeInt(fFilterQuality);
}
SkMatrixImageFilter::~SkMatrixImageFilter() {
@@ -84,7 +84,7 @@
SkPaint paint;
paint.setXfermodeMode(SkXfermode::kSrc_Mode);
- paint.setFilterLevel(fFilterLevel);
+ paint.setFilterQuality(fFilterQuality);
canvas.drawBitmap(src, srcRect.x(), srcRect.y(), &paint);
*result = device.get()->accessBitmap(false);
@@ -142,7 +142,7 @@
str->append("<dt>FilterLevel:</dt><dd>");
static const char* gFilterLevelStrings[] = { "None", "Low", "Medium", "High" };
- str->append(gFilterLevelStrings[fFilterLevel]);
+ str->append(gFilterLevelStrings[fFilterQuality]);
str->append("</dd>");
str->appendf(")");
diff --git a/src/effects/SkPictureImageFilter.cpp b/src/effects/SkPictureImageFilter.cpp
index 391af11..d3bc15c 100644
--- a/src/effects/SkPictureImageFilter.cpp
+++ b/src/effects/SkPictureImageFilter.cpp
@@ -18,17 +18,17 @@
, fPicture(SkSafeRef(picture))
, fCropRect(picture ? picture->cullRect() : SkRect::MakeEmpty())
, fPictureResolution(kDeviceSpace_PictureResolution)
- , fFilterLevel(SkPaint::kLow_FilterLevel) {
+ , fFilterQuality(kLow_SkFilterQuality) {
}
SkPictureImageFilter::SkPictureImageFilter(const SkPicture* picture, const SkRect& cropRect,
uint32_t uniqueID, PictureResolution pictureResolution,
- SkPaint::FilterLevel filterLevel)
+ SkFilterQuality filterQuality)
: INHERITED(0, 0, NULL, uniqueID)
, fPicture(SkSafeRef(picture))
, fCropRect(cropRect)
, fPictureResolution(pictureResolution)
- , fFilterLevel(filterLevel) {
+ , fFilterQuality(filterQuality) {
}
SkPictureImageFilter::~SkPictureImageFilter() {
@@ -59,13 +59,13 @@
if (kLocalSpace_PictureResolution == pictureResolution) {
//filterLevel is only serialized if pictureResolution is LocalSpace
- SkPaint::FilterLevel filterLevel;
+ SkFilterQuality filterQuality;
if (buffer.isVersionLT(SkReadBuffer::kPictureImageFilterLevel_Version)) {
- filterLevel = SkPaint::kLow_FilterLevel;
+ filterQuality = kLow_SkFilterQuality;
} else {
- filterLevel = (SkPaint::FilterLevel)buffer.readInt();
+ filterQuality = (SkFilterQuality)buffer.readInt();
}
- return CreateForLocalSpace(picture, cropRect, filterLevel);
+ return CreateForLocalSpace(picture, cropRect, filterQuality);
}
return Create(picture, cropRect);
}
@@ -86,7 +86,7 @@
buffer.writeRect(fCropRect);
buffer.writeInt(fPictureResolution);
if (kLocalSpace_PictureResolution == fPictureResolution) {
- buffer.writeInt(fFilterLevel);
+ buffer.writeInt(fFilterQuality);
}
}
@@ -168,7 +168,7 @@
canvas.translate(-SkIntToScalar(deviceBounds.fLeft), -SkIntToScalar(deviceBounds.fTop));
canvas.concat(ctx.ctm());
SkPaint paint;
- paint.setFilterLevel(fFilterLevel);
+ paint.setFilterQuality(fFilterQuality);
canvas.drawBitmap(localDevice.get()->accessBitmap(false), SkIntToScalar(localIBounds.fLeft),
SkIntToScalar(localIBounds.fTop), &paint);
//canvas.drawPicture(fPicture);
diff --git a/src/effects/SkTestImageFilters.cpp b/src/effects/SkTestImageFilters.cpp
index f0f8ae0..4858eb2 100755
--- a/src/effects/SkTestImageFilters.cpp
+++ b/src/effects/SkTestImageFilters.cpp
@@ -49,7 +49,7 @@
OwnDeviceCanvas canvas(dev);
SkPaint paint;
- paint.setFilterLevel(SkPaint::kLow_FilterLevel);
+ paint.setFilterQuality(kLow_SkFilterQuality);
canvas.scale(scale, scale);
canvas.drawBitmap(src, 0, 0, &paint);
tmp = dev->accessBitmap(false);
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 757dfbf..a3d2cc3 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1220,19 +1220,19 @@
viewM.preConcat(m);
GrTextureParams params;
- SkPaint::FilterLevel paintFilterLevel = paint.getFilterLevel();
+ SkFilterQuality paintFilterQuality = paint.getFilterQuality();
GrTextureParams::FilterMode textureFilterMode;
bool doBicubic = false;
- switch(paintFilterLevel) {
- case SkPaint::kNone_FilterLevel:
+ switch(paintFilterQuality) {
+ case kNone_SkFilterQuality:
textureFilterMode = GrTextureParams::kNone_FilterMode;
break;
- case SkPaint::kLow_FilterLevel:
+ case kLow_SkFilterQuality:
textureFilterMode = GrTextureParams::kBilerp_FilterMode;
break;
- case SkPaint::kMedium_FilterLevel:
+ case kMedium_SkFilterQuality:
if (viewM.getMinScale() < SK_Scalar1) {
textureFilterMode = GrTextureParams::kMipMap_FilterMode;
} else {
@@ -1240,7 +1240,7 @@
textureFilterMode = GrTextureParams::kBilerp_FilterMode;
}
break;
- case SkPaint::kHigh_FilterLevel:
+ case kHigh_SkFilterQuality:
// Minification can look bad with the bicubic effect.
doBicubic =
GrBicubicEffect::ShouldUseBicubic(viewM, &textureFilterMode);
diff --git a/src/opts/SkBitmapProcState_opts_SSE2.cpp b/src/opts/SkBitmapProcState_opts_SSE2.cpp
index 1f3bbc1..659caf2 100644
--- a/src/opts/SkBitmapProcState_opts_SSE2.cpp
+++ b/src/opts/SkBitmapProcState_opts_SSE2.cpp
@@ -15,7 +15,7 @@
const uint32_t* xy,
int count, uint32_t* colors) {
SkASSERT(count > 0 && colors != NULL);
- SkASSERT(s.fFilterLevel != SkPaint::kNone_FilterLevel);
+ SkASSERT(s.fFilterLevel != kNone_SkFilterQuality);
SkASSERT(kN32_SkColorType == s.fBitmap->colorType());
SkASSERT(s.fAlphaScale == 256);
@@ -121,7 +121,7 @@
const uint32_t* xy,
int count, uint32_t* colors) {
SkASSERT(count > 0 && colors != NULL);
- SkASSERT(s.fFilterLevel != SkPaint::kNone_FilterLevel);
+ SkASSERT(s.fFilterLevel != kNone_SkFilterQuality);
SkASSERT(kN32_SkColorType == s.fBitmap->colorType());
SkASSERT(s.fAlphaScale < 256);
@@ -641,7 +641,7 @@
const uint32_t* xy,
int count, uint16_t* colors) {
SkASSERT(count > 0 && colors != NULL);
- SkASSERT(s.fFilterLevel != SkPaint::kNone_FilterLevel);
+ SkASSERT(s.fFilterLevel != kNone_SkFilterQuality);
SkASSERT(kN32_SkColorType == s.fBitmap->colorType());
SkASSERT(s.fBitmap->isOpaque());
diff --git a/src/opts/SkBitmapProcState_opts_SSSE3.cpp b/src/opts/SkBitmapProcState_opts_SSSE3.cpp
index 984a65e..bfcd7ca 100644
--- a/src/opts/SkBitmapProcState_opts_SSSE3.cpp
+++ b/src/opts/SkBitmapProcState_opts_SSSE3.cpp
@@ -394,7 +394,7 @@
const uint32_t* xy,
int count, uint32_t* colors) {
SkASSERT(count > 0 && colors != NULL);
- SkASSERT(s.fFilterLevel != SkPaint::kNone_FilterLevel);
+ SkASSERT(s.fFilterLevel != kNone_SkFilterQuality);
SkASSERT(kN32_SkColorType == s.fBitmap->colorType());
if (has_alpha) {
SkASSERT(s.fAlphaScale < 256);
@@ -586,7 +586,7 @@
const uint32_t* xy,
int count, uint32_t* colors) {
SkASSERT(count > 0 && colors != NULL);
- SkASSERT(s.fFilterLevel != SkPaint::kNone_FilterLevel);
+ SkASSERT(s.fFilterLevel != kNone_SkFilterQuality);
SkASSERT(kN32_SkColorType == s.fBitmap->colorType());
if (has_alpha) {
SkASSERT(s.fAlphaScale < 256);
diff --git a/src/opts/SkBitmapProcState_opts_arm.cpp b/src/opts/SkBitmapProcState_opts_arm.cpp
index 4a84aee..e6799de 100644
--- a/src/opts/SkBitmapProcState_opts_arm.cpp
+++ b/src/opts/SkBitmapProcState_opts_arm.cpp
@@ -28,7 +28,7 @@
int count, uint16_t* SK_RESTRICT colors) {
SkASSERT(count > 0 && colors != NULL);
SkASSERT(s.fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask));
- SkASSERT(SkPaint::kNone_FilterLevel == s.fFilterLevel);
+ SkASSERT(kNone_SkFilterQuality == s.fFilterLevel);
const uint16_t* SK_RESTRICT table = s.fBitmap->getColorTable()->read16BitCache();
const uint8_t* SK_RESTRICT srcAddr = (const uint8_t*)s.fBitmap->getPixels();
@@ -117,7 +117,7 @@
int count, SkPMColor* SK_RESTRICT colors) {
SkASSERT(count > 0 && colors != NULL);
SkASSERT(s.fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask));
- SkASSERT(SkPaint::kNone_FilterLevel == s.fFilterLevel);
+ SkASSERT(kNone_SkFilterQuality == s.fFilterLevel);
const SkPMColor* SK_RESTRICT table = s.fBitmap->getColorTable()->readColors();
const uint8_t* SK_RESTRICT srcAddr = (const uint8_t*)s.fBitmap->getPixels();
@@ -201,7 +201,7 @@
switch (fBitmap->colorType()) {
case kIndex_8_SkColorType:
- if (justDx && SkPaint::kNone_FilterLevel == fFilterLevel) {
+ if (justDx && kNone_SkFilterQuality == fFilterLevel) {
#if 0 /* crashing on android device */
fSampleProc16 = SI8_D16_nofilter_DX_arm;
fShaderProc16 = NULL;
diff --git a/src/opts/SkBitmapProcState_opts_mips_dsp.cpp b/src/opts/SkBitmapProcState_opts_mips_dsp.cpp
index 6051cd8..049519a 100644
--- a/src/opts/SkBitmapProcState_opts_mips_dsp.cpp
+++ b/src/opts/SkBitmapProcState_opts_mips_dsp.cpp
@@ -17,7 +17,7 @@
int count, uint16_t* SK_RESTRICT colors) {
SkASSERT(count > 0 && colors != NULL);
SkASSERT(s.fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask));
- SkASSERT(SkPaint::kNone_FilterLevel == s.fFilterLevel);
+ SkASSERT(kNone_SkFilterQuality == s.fFilterLevel);
const uint16_t* SK_RESTRICT table = s.fBitmap->getColorTable()->read16BitCache();
const uint8_t* SK_RESTRICT srcAddr = (const uint8_t*)s.fBitmap->getPixels();
SkASSERT((unsigned)xy[0] < (unsigned)s.fBitmap->height());
@@ -149,7 +149,7 @@
int count, SkPMColor* SK_RESTRICT colors) {
SkASSERT(count > 0 && colors != NULL);
SkASSERT(s.fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask));
- SkASSERT(SkPaint::kNone_FilterLevel == s.fFilterLevel);
+ SkASSERT(kNone_SkFilterQuality == s.fFilterLevel);
const SkPMColor* SK_RESTRICT table = s.fBitmap->getColorTable()->readColors();
const uint8_t* SK_RESTRICT srcAddr = (const uint8_t*)s.fBitmap->getPixels();
srcAddr = (const uint8_t*)((const char*)srcAddr + xy[0] * s.fBitmap->rowBytes());
@@ -378,7 +378,7 @@
switch (fBitmap->colorType()) {
case kIndex_8_SkColorType:
- if (justDx && SkPaint::kNone_FilterLevel == fFilterLevel) {
+ if (justDx && kNone_SkFilterQuality == fFilterLevel) {
fSampleProc16 = SI8_D16_nofilter_DX_mips_dsp;
fShaderProc16 = NULL;
if (isOpaque) {
diff --git a/src/pipe/SkGPipeRead.cpp b/src/pipe/SkGPipeRead.cpp
index 7684b72..916ab6a 100644
--- a/src/pipe/SkGPipeRead.cpp
+++ b/src/pipe/SkGPipeRead.cpp
@@ -682,7 +682,7 @@
case kReset_PaintOp: p->reset(); break;
case kFlags_PaintOp: p->setFlags(data); break;
case kColor_PaintOp: p->setColor(reader->readU32()); break;
- case kFilterLevel_PaintOp: p->setFilterLevel((SkPaint::FilterLevel)data); break;
+ case kFilterLevel_PaintOp: p->setFilterQuality((SkFilterQuality)data); break;
case kStyle_PaintOp: p->setStyle((SkPaint::Style)data); break;
case kJoin_PaintOp: p->setStrokeJoin((SkPaint::Join)data); break;
case kCap_PaintOp: p->setStrokeCap((SkPaint::Cap)data); break;
diff --git a/src/pipe/SkGPipeWrite.cpp b/src/pipe/SkGPipeWrite.cpp
index be687f7..db6c2af 100644
--- a/src/pipe/SkGPipeWrite.cpp
+++ b/src/pipe/SkGPipeWrite.cpp
@@ -1136,9 +1136,9 @@
*ptr++ = paint.getColor();
base.setColor(paint.getColor());
}
- if (base.getFilterLevel() != paint.getFilterLevel()) {
- *ptr++ = PaintOp_packOpData(kFilterLevel_PaintOp, paint.getFilterLevel());
- base.setFilterLevel(paint.getFilterLevel());
+ if (base.getFilterQuality() != paint.getFilterQuality()) {
+ *ptr++ = PaintOp_packOpData(kFilterLevel_PaintOp, paint.getFilterQuality());
+ base.setFilterQuality(paint.getFilterQuality());
}
if (base.getStyle() != paint.getStyle()) {
*ptr++ = PaintOp_packOpData(kStyle_PaintOp, paint.getStyle());
diff --git a/src/ports/SkFontHost_FreeType_common.cpp b/src/ports/SkFontHost_FreeType_common.cpp
index a0863c1..5afe70a 100644
--- a/src/ports/SkFontHost_FreeType_common.cpp
+++ b/src/ports/SkFontHost_FreeType_common.cpp
@@ -463,7 +463,7 @@
canvas.scale(SkIntToScalar(glyph.fWidth) / SkIntToScalar(face->glyph->bitmap.width),
SkIntToScalar(glyph.fHeight) / SkIntToScalar(face->glyph->bitmap.rows));
SkPaint paint;
- paint.setFilterLevel(SkPaint::kMedium_FilterLevel);
+ paint.setFilterQuality(kMedium_SkFilterQuality);
canvas.drawBitmap(unscaledBitmap, 0, 0, &paint);
// If the destination is BW or LCD, convert from A8.
diff --git a/src/utils/SkLua.cpp b/src/utils/SkLua.cpp
index ba79933..84932cd 100644
--- a/src/utils/SkLua.cpp
+++ b/src/utils/SkLua.cpp
@@ -927,15 +927,15 @@
return 1;
}
-static int lpaint_getFilterLevel(lua_State* L) {
- SkLua(L).pushU32(get_obj<SkPaint>(L, 1)->getFilterLevel());
+static int lpaint_getFilterQuality(lua_State* L) {
+ SkLua(L).pushU32(get_obj<SkPaint>(L, 1)->getFilterQuality());
return 1;
}
-static int lpaint_setFilterLevel(lua_State* L) {
+static int lpaint_setFilterQuality(lua_State* L) {
int level = lua2int_def(L, 2, -1);
if (level >= 0 && level <= 3) {
- get_obj<SkPaint>(L, 1)->setFilterLevel((SkPaint::FilterLevel)level);
+ get_obj<SkPaint>(L, 1)->setFilterQuality((SkFilterQuality)level);
}
return 0;
}
@@ -1131,8 +1131,8 @@
{ "setAntiAlias", lpaint_setAntiAlias },
{ "isDither", lpaint_isDither },
{ "setDither", lpaint_setDither },
- { "getFilterLevel", lpaint_getFilterLevel },
- { "setFilterLevel", lpaint_setFilterLevel },
+ { "getFilterQuality", lpaint_getFilterQuality },
+ { "setFilterQuality", lpaint_setFilterQuality },
{ "isUnderlineText", lpaint_isUnderlineText },
{ "isStrikeThruText", lpaint_isStrikeThruText },
{ "isFakeBoldText", lpaint_isFakeBoldText },
diff --git a/src/utils/debugger/SkDebugCanvas.cpp b/src/utils/debugger/SkDebugCanvas.cpp
index 6474582..779d695 100644
--- a/src/utils/debugger/SkDebugCanvas.cpp
+++ b/src/utils/debugger/SkDebugCanvas.cpp
@@ -156,20 +156,20 @@
// texture filtering mode
class SkTexOverrideFilter : public SkDrawFilter {
public:
- SkTexOverrideFilter() : fFilterLevel(SkPaint::kNone_FilterLevel) {
+ SkTexOverrideFilter() : fFilterQuality(kNone_SkFilterQuality) {
}
- void setFilterLevel(SkPaint::FilterLevel filterLevel) {
- fFilterLevel = filterLevel;
+ void setFilterQuality(SkFilterQuality filterQuality) {
+ fFilterQuality = filterQuality;
}
bool filter(SkPaint* p, Type) SK_OVERRIDE {
- p->setFilterLevel(fFilterLevel);
+ p->setFilterQuality(fFilterQuality);
return true;
}
protected:
- SkPaint::FilterLevel fFilterLevel;
+ SkFilterQuality fFilterQuality;
private:
typedef SkDrawFilter INHERITED;
@@ -379,13 +379,13 @@
return fCommandVector;
}
-void SkDebugCanvas::overrideTexFiltering(bool overrideTexFiltering, SkPaint::FilterLevel level) {
+void SkDebugCanvas::overrideTexFiltering(bool overrideTexFiltering, SkFilterQuality quality) {
if (NULL == fTexOverrideFilter) {
fTexOverrideFilter = new SkTexOverrideFilter;
}
fOverrideTexFiltering = overrideTexFiltering;
- fTexOverrideFilter->setFilterLevel(level);
+ fTexOverrideFilter->setFilterQuality(quality);
}
void SkDebugCanvas::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edgeStyle) {
diff --git a/src/utils/debugger/SkDebugCanvas.h b/src/utils/debugger/SkDebugCanvas.h
index 97eb734..5771dd9 100644
--- a/src/utils/debugger/SkDebugCanvas.h
+++ b/src/utils/debugger/SkDebugCanvas.h
@@ -42,7 +42,7 @@
/**
* Enable or disable texure filtering override
*/
- void overrideTexFiltering(bool overrideTexFiltering, SkPaint::FilterLevel level);
+ void overrideTexFiltering(bool overrideTexFiltering, SkFilterQuality);
/**
Executes all draw calls to the canvas.
diff --git a/tests/DrawBitmapRectTest.cpp b/tests/DrawBitmapRectTest.cpp
index 1ecc590..9203879 100644
--- a/tests/DrawBitmapRectTest.cpp
+++ b/tests/DrawBitmapRectTest.cpp
@@ -46,17 +46,17 @@
SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(200, 200));
SkCanvas* canvas = surface->getCanvas();
- const SkPaint::FilterLevel levels[] = {
- SkPaint::kNone_FilterLevel,
- SkPaint::kLow_FilterLevel,
- SkPaint::kMedium_FilterLevel,
- SkPaint::kHigh_FilterLevel,
+ const SkFilterQuality levels[] = {
+ kNone_SkFilterQuality,
+ kLow_SkFilterQuality,
+ kMedium_SkFilterQuality,
+ kHigh_SkFilterQuality,
};
SkPaint paint;
canvas->scale(2, 2); // need a scale, otherwise we may ignore filtering
for (size_t i = 0; i < SK_ARRAY_COUNT(levels); ++i) {
- paint.setFilterLevel(levels[i]);
+ paint.setFilterQuality(levels[i]);
canvas->drawBitmap(bm, 0, 0, &paint);
}
}
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index 5e92ee3..7d7d474 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -470,7 +470,7 @@
{ "erode", SkErodeImageFilter::Create(2, 3) },
{ "tile", SkTileImageFilter::Create(SkRect::MakeXYWH(0, 0, 50, 50),
SkRect::MakeXYWH(0, 0, 100, 100), NULL) },
- { "matrix", SkMatrixImageFilter::Create(matrix, SkPaint::kLow_FilterLevel) },
+ { "matrix", SkMatrixImageFilter::Create(matrix, kLow_SkFilterQuality) },
{ "blur and offset", SkOffsetImageFilter::Create(five, five, blur.get()) },
{ "picture and blur", SkBlurImageFilter::Create(five, five, pictureFilter.get()) },
{ "rect shader and blur", SkBlurImageFilter::Create(five, five, rectShaderFilter.get()) },
@@ -533,7 +533,7 @@
SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(SK_ColorWHITE, SkXfermode::kSrc_Mode));
SkAutoTUnref<SkImageFilter> cfif(SkColorFilterImageFilter::Create(cf.get()));
- SkAutoTUnref<SkImageFilter> imageFilter(SkMatrixImageFilter::Create(matrix, SkPaint::kNone_FilterLevel, cfif.get()));
+ SkAutoTUnref<SkImageFilter> imageFilter(SkMatrixImageFilter::Create(matrix, kNone_SkFilterQuality, cfif.get()));
SkPaint paint;
paint.setImageFilter(imageFilter.get());
@@ -1076,7 +1076,7 @@
matrix.setScale(SkIntToScalar(2), SkIntToScalar(2));
matrix.postTranslate(SkIntToScalar(-20), SkIntToScalar(-20));
SkAutoTUnref<SkImageFilter> matrixFilter(
- SkMatrixImageFilter::Create(matrix, SkPaint::kLow_FilterLevel));
+ SkMatrixImageFilter::Create(matrix, kLow_SkFilterQuality));
// Test that saveLayer() with a filter nested inside another saveLayer() applies the
// correct offset to the filter matrix.
diff --git a/tests/PaintTest.cpp b/tests/PaintTest.cpp
index bf22de1..1fca8dc 100644
--- a/tests/PaintTest.cpp
+++ b/tests/PaintTest.cpp
@@ -116,27 +116,25 @@
}
// temparary api for bicubic, just be sure we can set/clear it
-DEF_TEST(Paint_filterlevel, reporter) {
+DEF_TEST(Paint_filterQuality, reporter) {
SkPaint p0, p1;
- REPORTER_ASSERT(reporter,
- SkPaint::kNone_FilterLevel == p0.getFilterLevel());
+ REPORTER_ASSERT(reporter, kNone_SkFilterQuality == p0.getFilterQuality());
- static const SkPaint::FilterLevel gLevels[] = {
- SkPaint::kNone_FilterLevel,
- SkPaint::kLow_FilterLevel,
- SkPaint::kMedium_FilterLevel,
- SkPaint::kHigh_FilterLevel
+ static const SkFilterQuality gQualitys[] = {
+ kNone_SkFilterQuality,
+ kLow_SkFilterQuality,
+ kMedium_SkFilterQuality,
+ kHigh_SkFilterQuality
};
- for (size_t i = 0; i < SK_ARRAY_COUNT(gLevels); ++i) {
- p0.setFilterLevel(gLevels[i]);
- REPORTER_ASSERT(reporter, gLevels[i] == p0.getFilterLevel());
+ for (size_t i = 0; i < SK_ARRAY_COUNT(gQualitys); ++i) {
+ p0.setFilterQuality(gQualitys[i]);
+ REPORTER_ASSERT(reporter, gQualitys[i] == p0.getFilterQuality());
p1 = p0;
- REPORTER_ASSERT(reporter, gLevels[i] == p1.getFilterLevel());
+ REPORTER_ASSERT(reporter, gQualitys[i] == p1.getFilterQuality());
p0.reset();
- REPORTER_ASSERT(reporter,
- SkPaint::kNone_FilterLevel == p0.getFilterLevel());
+ REPORTER_ASSERT(reporter, kNone_SkFilterQuality == p0.getFilterQuality());
}
}
@@ -205,11 +203,11 @@
}
DEF_TEST(Paint_flattening, reporter) {
- const SkPaint::FilterLevel levels[] = {
- SkPaint::kNone_FilterLevel,
- SkPaint::kLow_FilterLevel,
- SkPaint::kMedium_FilterLevel,
- SkPaint::kHigh_FilterLevel,
+ const SkFilterQuality levels[] = {
+ kNone_SkFilterQuality,
+ kLow_SkFilterQuality,
+ kMedium_SkFilterQuality,
+ kHigh_SkFilterQuality,
};
const SkPaint::Hinting hinting[] = {
SkPaint::kNo_Hinting,
@@ -251,7 +249,7 @@
SkPaint paint;
paint.setFlags(0x1234);
- FOR_SETUP(i, levels, setFilterLevel)
+ FOR_SETUP(i, levels, setFilterQuality)
FOR_SETUP(j, hinting, setHinting)
FOR_SETUP(k, align, setTextAlign)
FOR_SETUP(l, caps, setStrokeCap)
diff --git a/tests/SkResourceCacheTest.cpp b/tests/SkResourceCacheTest.cpp
index fae0816..bb12d66 100644
--- a/tests/SkResourceCacheTest.cpp
+++ b/tests/SkResourceCacheTest.cpp
@@ -39,7 +39,7 @@
SkScalar yScaledSize = SkIntToScalar(kBitmapSize) * yScale;
canvas->clipRect(SkRect::MakeLTRB(0, 0, xScaledSize, yScaledSize));
SkPaint paint;
- paint.setFilterLevel(SkPaint::kHigh_FilterLevel);
+ paint.setFilterQuality(kHigh_SkFilterQuality);
canvas->drawBitmapRect(bitmap,
SkRect::MakeLTRB(0, 0, xScaledSize, yScaledSize),