aboutsummaryrefslogtreecommitdiffstats
path: root/tests/BitmapCopyTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/BitmapCopyTest.cpp')
-rw-r--r--tests/BitmapCopyTest.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/BitmapCopyTest.cpp b/tests/BitmapCopyTest.cpp
index b8d16bf..d5fd7df 100644
--- a/tests/BitmapCopyTest.cpp
+++ b/tests/BitmapCopyTest.cpp
@@ -308,12 +308,16 @@ static void TestBitmapCopy(skiatest::Reporter* reporter) {
}
// test extractSubset
{
+ SkBitmap bitmap(src);
SkBitmap subset;
SkIRect r;
r.set(1, 1, 2, 2);
- if (src.extractSubset(&subset, r)) {
+ bitmap.setIsVolatile(true);
+ if (bitmap.extractSubset(&subset, r)) {
REPORTER_ASSERT(reporter, subset.width() == 1);
REPORTER_ASSERT(reporter, subset.height() == 1);
+ REPORTER_ASSERT(reporter,
+ subset.isVolatile() == true);
SkBitmap copy;
REPORTER_ASSERT(reporter,
@@ -329,6 +333,11 @@ static void TestBitmapCopy(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter,
(copy.getColorTable() != NULL) == hasCT);
}
+ bitmap.setIsVolatile(false);
+ if (bitmap.extractSubset(&subset, r)) {
+ REPORTER_ASSERT(reporter,
+ subset.isVolatile() == false);
+ }
}
} else {
// dst should be unchanged from its initial state