Revert "Flatten resources directory"
Review URL: https://codereview.chromium.org/278033002
git-svn-id: http://skia.googlecode.com/svn/trunk@14679 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/resources/randPixels.bmp b/resources/encoding/randPixels.bmp
similarity index 100%
rename from resources/randPixels.bmp
rename to resources/encoding/randPixels.bmp
Binary files differ
diff --git a/resources/randPixels.gif b/resources/encoding/randPixels.gif
similarity index 100%
rename from resources/randPixels.gif
rename to resources/encoding/randPixels.gif
Binary files differ
diff --git a/resources/encoding/randPixels.jpg b/resources/encoding/randPixels.jpg
new file mode 100644
index 0000000..ca57fbd
--- /dev/null
+++ b/resources/encoding/randPixels.jpg
Binary files differ
diff --git a/resources/randPixels.png b/resources/encoding/randPixels.png
similarity index 65%
rename from resources/randPixels.png
rename to resources/encoding/randPixels.png
index 8cd8e65..49ef846 100644
--- a/resources/randPixels.png
+++ b/resources/encoding/randPixels.png
Binary files differ
diff --git a/resources/encoding/randPixels.webp b/resources/encoding/randPixels.webp
new file mode 100644
index 0000000..135441e
--- /dev/null
+++ b/resources/encoding/randPixels.webp
Binary files differ
diff --git a/resources/randPixels.jpg b/resources/randPixels.jpg
deleted file mode 100644
index 8f26ea0..0000000
--- a/resources/randPixels.jpg
+++ /dev/null
Binary files differ
diff --git a/resources/randPixels.webp b/resources/randPixels.webp
deleted file mode 100644
index 9c4acea..0000000
--- a/resources/randPixels.webp
+++ /dev/null
Binary files differ
diff --git a/tests/ImageDecodingTest.cpp b/tests/ImageDecodingTest.cpp
index 86b96ae..e9348fe 100644
--- a/tests/ImageDecodingTest.cpp
+++ b/tests/ImageDecodingTest.cpp
@@ -512,8 +512,8 @@
*/
DEF_TEST(ImprovedBitmapFactory, reporter) {
SkString resourcePath = skiatest::Test::GetResourcePath();
- SkString path = SkOSPath::SkPathJoin(
- resourcePath.c_str(), "randPixels.png");
+ SkString directory = SkOSPath::SkPathJoin(resourcePath.c_str(), "encoding");
+ SkString path = SkOSPath::SkPathJoin(directory.c_str(), "randPixels.png");
SkAutoTUnref<SkStreamRewindable> stream(
SkStream::NewFromFile(path.c_str()));
if (sk_exists(path.c_str())) {
@@ -531,10 +531,9 @@
#if defined(SK_BUILD_FOR_ANDROID) || defined(SK_BUILD_FOR_UNIX)
static inline bool check_rounding(int value, int dividend, int divisor) {
- // returns true if the value is greater than floor(dividend/divisor)
- // and less than SkNextPow2(ceil(dividend - divisor))
+ // returns true if (dividend/divisor) rounds up OR down to value
return (((divisor * value) > (dividend - divisor))
- && value <= SkNextPow2(((dividend - 1) / divisor) + 1));
+ && ((divisor * value) < (dividend + divisor)));
}
#endif // SK_BUILD_FOR_ANDROID || SK_BUILD_FOR_UNIX
@@ -622,11 +621,6 @@
opts.fSampleSize));
REPORTER_ASSERT(reporter, check_rounding(bm.width(), kExpectedWidth,
opts.fSampleSize));
- // The ImageDecoder API doesn't guarantee that SampleSize does
- // anything at all, but the decoders that this test excercises all
- // produce an output size in the following range:
- // (((sample_size * out_size) > (in_size - sample_size))
- // && out_size <= SkNextPow2(((in_size - 1) / sample_size) + 1));
#endif // SK_BUILD_FOR_ANDROID || SK_BUILD_FOR_UNIX
SkAutoLockPixels alp(bm);
if (bm.getPixels() == NULL) {
@@ -688,7 +682,8 @@
};
SkString resourceDir = skiatest::Test::GetResourcePath();
- if (!sk_exists(resourceDir.c_str())) {
+ SkString directory = SkOSPath::SkPathJoin(resourceDir.c_str(), "encoding");
+ if (!sk_exists(directory.c_str())) {
return;
}
@@ -705,7 +700,7 @@
const bool useDataList[] = {true, false};
for (size_t fidx = 0; fidx < SK_ARRAY_COUNT(files); ++fidx) {
- SkString path = SkOSPath::SkPathJoin(resourceDir.c_str(), files[fidx]);
+ SkString path = SkOSPath::SkPathJoin(directory.c_str(), files[fidx]);
if (!sk_exists(path.c_str())) {
continue;
}