Check for abandoned texture in GrTextureAdjuster::refTextureSafeForParams

Cherry-pick for M52

BUG=chromium:618858
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2063313002

TBR=egdaniel@google.com

Review-Url: https://codereview.chromium.org/2063313002
NOTREECHECKS=true
NOTRY=true
NOPRESUBMIT=true

Review-Url: https://codereview.chromium.org/2066493006
diff --git a/src/gpu/GrTextureParamsAdjuster.cpp b/src/gpu/GrTextureParamsAdjuster.cpp
index a91ba8a..1d06137 100644
--- a/src/gpu/GrTextureParamsAdjuster.cpp
+++ b/src/gpu/GrTextureParamsAdjuster.cpp
@@ -164,6 +164,11 @@
     CopyParams copyParams;
     const SkIRect* contentArea = this->contentAreaOrNull();
 
+    if (!context) {
+        // The texture was abandoned.
+        return nullptr;
+    }
+
     if (contentArea && GrTextureParams::kMipMap_FilterMode == params.filterMode()) {
         // If we generate a MIP chain for texture it will read pixel values from outside the content
         // area.