Add support for VK_IMAGE_LAYOUT_PRESENT_SRC_KHR in skia vulkan.

This change allows Skia to handle transfering from the present layout.
Skia currently never changes to the present layout, though we are looking
at adding support for this in a different CL.

With this change a client can wrap a an VkImage into an SkSurface still in
the queue present layout and Skia will handle the transation to color
attachment. If a client uses this functiality they most likely will want
to immediately call wait(GrBackendSemaphore) on the SkSurface so that Skia
waits on the VkSemaphore that came from a call to vulkan aquire image before
doing any work on the wrapped VkImage.

Bug: skia:
Change-Id: Ia9bd12ad4e6cd972daaa972cce8698d396c002fc
Reviewed-on: https://skia-review.googlesource.com/c/194424
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrRenderTargetOpList.h b/src/gpu/GrRenderTargetOpList.h
index 439c7ac..7faae2a 100644
--- a/src/gpu/GrRenderTargetOpList.h
+++ b/src/gpu/GrRenderTargetOpList.h
@@ -72,6 +72,11 @@
         this->recordOp(std::move(op), GrProcessorSet::EmptySetAnalysis(), nullptr, nullptr, caps);
     }
 
+    void addWaitOp(std::unique_ptr<GrOp> op, const GrCaps& caps) {
+        fHasWaitOp= true;
+        this->addOp(std::move(op), caps);
+    }
+
     void addDrawOp(std::unique_ptr<GrDrawOp> op, const GrProcessorSet::Analysis& processorAnalysis,
                    GrAppliedClip&& clip, const DstProxy& dstProxy, const GrCaps& caps) {
         auto addDependency = [ &caps, this ] (GrSurfaceProxy* p) {
@@ -222,6 +227,9 @@
     SkIRect                        fLastDevClipBounds;
     int                            fLastClipNumAnalyticFPs;
 
+    // We must track if we have a wait op so that we don't delete the op when we have a full clear.
+    bool fHasWaitOp = false;;
+
     // For ops/opList we have mean: 5 stdDev: 28
     SkSTArray<25, OpChain, true> fOpChains;