Combine native sampling with sampling

In SkSampledCodec, allow the native codec to do its scaling first, then
sample on top of that. Since the only codec which can do native scaling
is JPEG, and we know what it can do, hard-code for JPEG. Check to see
if the sampleSize is something JPEG supports, or a multiple of
something it supports. If so, use JPEG directly or combine them.

BUG=skia:4320

Review URL: https://codereview.chromium.org/1417583009
diff --git a/tests/CodexTest.cpp b/tests/CodexTest.cpp
index bd3e203..205bd49 100644
--- a/tests/CodexTest.cpp
+++ b/tests/CodexTest.cpp
@@ -581,7 +581,7 @@
     }
 
     // Check that the decode is successful for a variety of scales
-    for (int sampleSize = 1; sampleSize < 10; sampleSize++) {
+    for (int sampleSize = 1; sampleSize < 32; sampleSize++) {
         // Scale the output dimensions
         SkISize scaledDims = codec->getSampledDimensions(sampleSize);
         SkImageInfo scaledInfo = codec->getInfo()