summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/jni/android/graphics/BitmapFactory.cpp2
-rw-r--r--core/jni/android/graphics/DrawFilter.cpp16
-rw-r--r--core/jni/android/graphics/Paint.cpp12
-rw-r--r--core/jni/android_graphics_Canvas.cpp6
-rw-r--r--libs/hwui/utils/PaintUtils.h2
5 files changed, 19 insertions, 19 deletions
diff --git a/core/jni/android/graphics/BitmapFactory.cpp b/core/jni/android/graphics/BitmapFactory.cpp
index 47090fb..526885f 100644
--- a/core/jni/android/graphics/BitmapFactory.cpp
+++ b/core/jni/android/graphics/BitmapFactory.cpp
@@ -401,7 +401,7 @@ static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding
}
SkPaint paint;
- paint.setFilterLevel(SkPaint::kLow_FilterLevel);
+ paint.setFilterQuality(kLow_SkFilterQuality);
SkCanvas canvas(*outputBitmap);
canvas.scale(sx, sy);
diff --git a/core/jni/android/graphics/DrawFilter.cpp b/core/jni/android/graphics/DrawFilter.cpp
index bac124f..90ef6c0 100644
--- a/core/jni/android/graphics/DrawFilter.cpp
+++ b/core/jni/android/graphics/DrawFilter.cpp
@@ -32,23 +32,23 @@
namespace android {
-// Custom version of SkPaintFlagsDrawFilter that also calls setFilterLevel.
+// Custom version of SkPaintFlagsDrawFilter that also calls setFilterQuality.
class CompatFlagsDrawFilter : public SkPaintFlagsDrawFilter {
public:
CompatFlagsDrawFilter(uint32_t clearFlags, uint32_t setFlags,
- SkPaint::FilterLevel desiredLevel)
+ SkFilterQuality desiredQuality)
: SkPaintFlagsDrawFilter(clearFlags, setFlags)
- , fDesiredLevel(desiredLevel) {
+ , fDesiredQuality(desiredQuality) {
}
virtual bool filter(SkPaint* paint, Type type) {
SkPaintFlagsDrawFilter::filter(paint, type);
- paint->setFilterLevel(fDesiredLevel);
+ paint->setFilterQuality(fDesiredQuality);
return true;
}
private:
- const SkPaint::FilterLevel fDesiredLevel;
+ const SkFilterQuality fDesiredQuality;
};
// Returns whether flags contains FILTER_BITMAP_FLAG. If flags does, remove it.
@@ -74,7 +74,7 @@ public:
if (clearFlags | setFlags) {
// Mask both groups of flags to remove FILTER_BITMAP_FLAG, which no
// longer has a Skia equivalent flag (instead it corresponds to
- // calling setFilterLevel), and keep track of which group(s), if
+ // calling setFilterQuality), and keep track of which group(s), if
// any, had the flag set.
const bool turnFilteringOn = hadFiltering(setFlags);
const bool turnFilteringOff = hadFiltering(clearFlags);
@@ -83,10 +83,10 @@ public:
if (turnFilteringOn) {
// Turning filtering on overrides turning it off.
filter = new CompatFlagsDrawFilter(clearFlags, setFlags,
- SkPaint::kLow_FilterLevel);
+ kLow_SkFilterQuality);
} else if (turnFilteringOff) {
filter = new CompatFlagsDrawFilter(clearFlags, setFlags,
- SkPaint::kNone_FilterLevel);
+ kNone_SkFilterQuality);
} else {
filter = new SkPaintFlagsDrawFilter(clearFlags, setFlags);
}
diff --git a/core/jni/android/graphics/Paint.cpp b/core/jni/android/graphics/Paint.cpp
index a92a9ac..f0131b4 100644
--- a/core/jni/android/graphics/Paint.cpp
+++ b/core/jni/android/graphics/Paint.cpp
@@ -132,7 +132,7 @@ public:
Paint* nativePaint = getNativePaint(env, paint);
uint32_t result = nativePaint->getFlags();
result &= ~sFilterBitmapFlag; // Filtering no longer stored in this bit. Mask away.
- if (nativePaint->getFilterLevel() != Paint::kNone_FilterLevel) {
+ if (nativePaint->getFilterQuality() != kNone_SkFilterQuality) {
result |= sFilterBitmapFlag;
}
return static_cast<jint>(result);
@@ -142,9 +142,9 @@ public:
NPE_CHECK_RETURN_VOID(env, paint);
Paint* nativePaint = getNativePaint(env, paint);
// Instead of modifying 0x02, change the filter level.
- nativePaint->setFilterLevel(flags & sFilterBitmapFlag
- ? Paint::kLow_FilterLevel
- : Paint::kNone_FilterLevel);
+ nativePaint->setFilterQuality(flags & sFilterBitmapFlag
+ ? kLow_SkFilterQuality
+ : kNone_SkFilterQuality);
// Don't pass through filter flag, which is no longer stored in paint's flags.
flags &= ~sFilterBitmapFlag;
// Use the existing value for 0x02.
@@ -197,8 +197,8 @@ public:
static void setFilterBitmap(JNIEnv* env, jobject paint, jboolean filterBitmap) {
NPE_CHECK_RETURN_VOID(env, paint);
- getNativePaint(env, paint)->setFilterLevel(
- filterBitmap ? Paint::kLow_FilterLevel : Paint::kNone_FilterLevel);
+ getNativePaint(env, paint)->setFilterQuality(
+ filterBitmap ? kLow_SkFilterQuality : kNone_SkFilterQuality);
}
static void setDither(JNIEnv* env, jobject paint, jboolean dither) {
diff --git a/core/jni/android_graphics_Canvas.cpp b/core/jni/android_graphics_Canvas.cpp
index c337a9f..47af5e6 100644
--- a/core/jni/android_graphics_Canvas.cpp
+++ b/core/jni/android_graphics_Canvas.cpp
@@ -320,7 +320,7 @@ static void drawBitmap(JNIEnv* env, jobject jcanvas, jlong canvasHandle, jlong b
if (paint) {
filteredPaint = *paint;
}
- filteredPaint.setFilterLevel(Paint::kLow_FilterLevel);
+ filteredPaint.setFilterQuality(kLow_SkFilterQuality);
canvas->drawBitmap(*bitmap, left, top, &filteredPaint);
} else {
canvas->drawBitmap(*bitmap, left, top, paint);
@@ -335,7 +335,7 @@ static void drawBitmap(JNIEnv* env, jobject jcanvas, jlong canvasHandle, jlong b
if (paint) {
filteredPaint = *paint;
}
- filteredPaint.setFilterLevel(Paint::kLow_FilterLevel);
+ filteredPaint.setFilterQuality(kLow_SkFilterQuality);
canvas->drawBitmap(*bitmap, 0, 0, &filteredPaint);
canvas->restore();
@@ -363,7 +363,7 @@ static void drawBitmapRect(JNIEnv* env, jobject, jlong canvasHandle, jlong bitma
if (paint) {
filteredPaint = *paint;
}
- filteredPaint.setFilterLevel(Paint::kLow_FilterLevel);
+ filteredPaint.setFilterQuality(kLow_SkFilterQuality);
canvas->drawBitmap(*bitmap, srcLeft, srcTop, srcRight, srcBottom,
dstLeft, dstTop, dstRight, dstBottom, &filteredPaint);
} else {
diff --git a/libs/hwui/utils/PaintUtils.h b/libs/hwui/utils/PaintUtils.h
index 1a5cbf8..ba02f5f 100644
--- a/libs/hwui/utils/PaintUtils.h
+++ b/libs/hwui/utils/PaintUtils.h
@@ -38,7 +38,7 @@ public:
}
static inline GLenum getFilter(const SkPaint* paint) {
- if (!paint || paint->getFilterLevel() != SkPaint::kNone_FilterLevel) {
+ if (!paint || paint->getFilterQuality() != kNone_SkFilterQuality) {
return GL_LINEAR;
}
return GL_NEAREST;