Refactor GrCaps::renderTargetWritePixelsSupported to support for some GL workarounds

Make indirect path in writeSurfacePixels2 use a copy rather than a draw.

Fix issue in GrVkGpu where render target dirty region is not updated after copy-as-draw

Remove unnecessary resolve of MSAA RT in GrVkCopyManager.

Splits WritePixelsNonTexture_Gpu test into MSAA and non-MSAA variants. MSAA variant blacklisted
on Adreno because of:

Bug: skia:7663

~~~~~~AND~~~~~~~

Revert "Suppress CopySurface test on Nexus 7"

This reverts commit b42b6169d52408a1712c2740655300465cd6ff1e.

Bug: skia:7658
Change-Id: I8337d718efb41e266537744bbf5ff8b1545322a7
Reviewed-on: https://skia-review.googlesource.com/110700
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index 602d07b..869d6e0 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -6,9 +6,9 @@
  */
 
 #include "GrVkCaps.h"
-
 #include "GrBackendSurface.h"
 #include "GrRenderTargetProxy.h"
+#include "GrRenderTarget.h"
 #include "GrShaderCaps.h"
 #include "GrVkUtil.h"
 #include "vk/GrVkBackendContext.h"
@@ -429,6 +429,13 @@
     return table[table.count() - 1];
 }
 
+bool GrVkCaps::surfaceSupportsWritePixels(const GrSurface* surface) const {
+    if (auto rt = surface->asRenderTarget()) {
+        return rt->numColorSamples() <= 1 && SkToBool(surface->asTexture());
+    }
+    return true;
+}
+
 bool validate_image_info(VkFormat format, SkColorType ct, GrPixelConfig* config) {
     *config = kUnknown_GrPixelConfig;
 
diff --git a/src/gpu/vk/GrVkCaps.h b/src/gpu/vk/GrVkCaps.h
index 55ed9168..14f37c9 100644
--- a/src/gpu/vk/GrVkCaps.h
+++ b/src/gpu/vk/GrVkCaps.h
@@ -40,9 +40,7 @@
     int getRenderTargetSampleCount(int requestedCount, GrPixelConfig config) const override;
     int maxRenderTargetSampleCount(GrPixelConfig config) const override;
 
-    bool renderTargetWritePixelsSupported(bool isAlsoTexture, int sampleCnt) const override {
-        return sampleCnt <= 1 && isAlsoTexture;
-    }
+    bool surfaceSupportsWritePixels(const GrSurface* surface) const override;
 
     bool isConfigTexturableLinearly(GrPixelConfig config) const {
         return SkToBool(ConfigInfo::kTextureable_Flag & fConfigTable[config].fLinearFlags);
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index 95c86ef..e4a980a 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -1845,6 +1845,8 @@
     }
 
     if (fCopyManager.copySurfaceAsDraw(this, dst, dstOrigin, src, srcOrigin, srcRect, dstPoint)) {
+        auto dstRect = srcRect.makeOffset(dstPoint.fX, dstPoint.fY);
+        this->didWriteToSurface(dst, dstOrigin, &dstRect);
         return true;
     }