Reland "Initiate regeneration of mipmaps from proxy DAG land"
This is a reland of fe19203eb7d7e8bef528287494d82c2eb4efff0e
Original change's description:
> Initiate regeneration of mipmaps from proxy DAG land
>
> This allows us to resolve all the textures before executing a command
> buffer, rather than interrupting execution as is currently done in the
> GL backend.
>
> Change-Id: I998546b312d24cf47fc2c837e7c94fbf95571af0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230636
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
Change-Id: Ic904d0b1bcb451bcb74cfae2204fb7297eaff108
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234016
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrTextureResolveRenderTask.h b/src/gpu/GrTextureResolveRenderTask.h
new file mode 100644
index 0000000..eadcdca
--- /dev/null
+++ b/src/gpu/GrTextureResolveRenderTask.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2019 Google LLC
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrTextureResolveRenderTask_DEFINED
+#define GrTextureResolveRenderTask_DEFINED
+
+#include "src/gpu/GrRenderTask.h"
+
+class GrTextureResolveRenderTask final : public GrRenderTask {
+public:
+ static sk_sp<GrRenderTask> Make(
+ sk_sp<GrTextureProxy>, GrTextureResolveFlags, const GrCaps&);
+
+private:
+ GrTextureResolveRenderTask(sk_sp<GrTextureProxy> textureProxy, GrTextureResolveFlags flags)
+ : GrRenderTask(std::move(textureProxy))
+ , fResolveFlags(flags) {
+ SkASSERT(GrTextureResolveFlags::kNone != fResolveFlags);
+ }
+
+ void onPrepare(GrOpFlushState*) override {}
+ bool onIsUsed(GrSurfaceProxy* proxy) const override {
+ SkASSERT(proxy != fTarget.get()); // This case should be handled by GrRenderTask.
+ return false;
+ }
+ void handleInternalAllocationFailure() override {}
+ void gatherProxyIntervals(GrResourceAllocator*) const override;
+ bool onExecute(GrOpFlushState*) override;
+
+ const GrTextureResolveFlags fResolveFlags;
+};
+
+#endif