Modify deferred texture image API's handling of gamma

This tries to match the behavior you would see if you rendered directly to
a canvas without going through this round-trip. Specifically, mips are
built in the same way that they would be according to the context's
internal logic. To make things clearer, the user passes in the color space
of the destination surface, not our (internal) enum.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3526

Change-Id: If8c61500d34ae712227da0284f3a80cacf84113a
Reviewed-on: https://skia-review.googlesource.com/3526
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp
index 74dd532..e7de369 100644
--- a/tests/ImageTest.cpp
+++ b/tests/ImageTest.cpp
@@ -949,7 +949,7 @@
 
         size_t size = image->getDeferredTextureImageData(*proxy, testCase.fParams.data(),
                                                          static_cast<int>(testCase.fParams.size()),
-                                                         nullptr, SkSourceGammaTreatment::kIgnore);
+                                                         nullptr, nullptr);
         static const char *const kFS[] = { "fail", "succeed" };
         if (SkToBool(size) != testCase.fExpectation) {
             ERRORF(reporter,  "This image was expected to %s but did not.",
@@ -960,12 +960,12 @@
             void* misaligned = reinterpret_cast<void*>(reinterpret_cast<intptr_t>(buffer) + 3);
             if (image->getDeferredTextureImageData(*proxy, testCase.fParams.data(),
                                                    static_cast<int>(testCase.fParams.size()),
-                                                   misaligned, SkSourceGammaTreatment::kIgnore)) {
+                                                   misaligned, nullptr)) {
                 ERRORF(reporter, "Should fail when buffer is misaligned.");
             }
             if (!image->getDeferredTextureImageData(*proxy, testCase.fParams.data(),
                                                     static_cast<int>(testCase.fParams.size()),
-                                                    buffer, SkSourceGammaTreatment::kIgnore)) {
+                                                    buffer, nullptr)) {
                 ERRORF(reporter, "deferred image size succeeded but creation failed.");
             } else {
                 for (auto budgeted : { SkBudgeted::kNo, SkBudgeted::kYes }) {