add kBicubicFilterBitmap_Flag to paint, just for testing purposes.
BUG=
Review URL: https://codereview.chromium.org/15553005
git-svn-id: http://skia.googlecode.com/svn/trunk@9236 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h
index 35a502d..a6c9bd4 100644
--- a/include/core/SkPaint.h
+++ b/include/core/SkPaint.h
@@ -108,11 +108,12 @@
kAutoHinting_Flag = 0x800, //!< mask to force Freetype's autohinter
kVerticalText_Flag = 0x1000,
kGenA8FromLCD_Flag = 0x2000, // hack for GDI -- do not use if you can help it
+ kBicubicFilterBitmap_Flag = 0x4000, // temporary flag
// when adding extra flags, note that the fFlags member is specified
// with a bit-width and you'll have to expand it.
- kAllFlags = 0x3FFF
+ kAllFlags = 0x7FFF
};
/** Return the paint's flags. Use the Flag enum to test flag values.
diff --git a/tests/PaintTest.cpp b/tests/PaintTest.cpp
index b08f22c..0db34b6 100644
--- a/tests/PaintTest.cpp
+++ b/tests/PaintTest.cpp
@@ -11,6 +11,20 @@
#include "SkLayerDrawLooper.h"
#include "SkBlurMaskFilter.h"
+// temparary api for bicubic, just be sure we can set/clear it
+static void test_bicubic(skiatest::Reporter* reporter) {
+ SkPaint p0;
+ REPORTER_ASSERT(reporter, 0 == (p0.getFlags() & SkPaint::kBicubicFilterBitmap_Flag));
+ p0.setFlags(p0.getFlags() | SkPaint::kBicubicFilterBitmap_Flag);
+ REPORTER_ASSERT(reporter, 0 != (p0.getFlags() & SkPaint::kBicubicFilterBitmap_Flag));
+ SkPaint p1(p0);
+ REPORTER_ASSERT(reporter, 0 != (p1.getFlags() & SkPaint::kBicubicFilterBitmap_Flag));
+ p0.reset();
+ REPORTER_ASSERT(reporter, 0 == (p0.getFlags() & SkPaint::kBicubicFilterBitmap_Flag));
+ p0 = p1;
+ p0.setFlags(p0.getFlags() | SkPaint::kBicubicFilterBitmap_Flag);
+}
+
static void test_copy(skiatest::Reporter* reporter) {
SkPaint paint;
// set a few member variables
@@ -118,6 +132,8 @@
// regression tests
regression_cubic(reporter);
regression_measureText(reporter);
+
+ test_bicubic(reporter);
}
#include "TestClassDef.h"