aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ops
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-08-09 20:09:38 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-09 20:10:06 +0000
commit54190c42dd721b9b1db5a524fa3955625de99b84 (patch)
treebb7c126914509e90870779f1c7bb106c31fe1369 /src/gpu/ops
parentdd3feeeec9d7434d6bd120c51b18bad0b8ea2ea6 (diff)
Revert "Store discard request on the opList and remove GrDiscardOp"
This reverts commit b681a0f1b0acebe36130fd463d14016d48295b97. Reason for revert: Seems to be messing up some MacMini & Nexus7 bots Original change's description: > Store discard request on the opList and remove GrDiscardOp > > Change-Id: Ic1f76bb91c16b23df1fe71c07a4d5ad5abf1dc26 > Reviewed-on: https://skia-review.googlesource.com/32640 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Robert Phillips <robertphillips@google.com> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: I8a89fae7bb11791bd023d7444a074bb34d006fd0 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/32704 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/ops')
-rw-r--r--src/gpu/ops/GrDiscardOp.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/gpu/ops/GrDiscardOp.h b/src/gpu/ops/GrDiscardOp.h
new file mode 100644
index 0000000000..d30aa5a8c5
--- /dev/null
+++ b/src/gpu/ops/GrDiscardOp.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrDiscardOp_DEFINED
+#define GrDiscardOp_DEFINED
+
+#include "GrGpuCommandBuffer.h"
+#include "GrOp.h"
+#include "GrOpFlushState.h"
+#include "GrRenderTargetProxy.h"
+
+class GrDiscardOp final : public GrOp {
+public:
+ DEFINE_OP_CLASS_ID
+
+ static std::unique_ptr<GrOp> Make(GrRenderTargetProxy* proxy) {
+ return std::unique_ptr<GrOp>(new GrDiscardOp(proxy));
+ }
+
+ const char* name() const override { return "Discard"; }
+
+ SkString dumpInfo() const override {
+ SkString string;
+ string.append(INHERITED::dumpInfo());
+ return string;
+ }
+
+private:
+ GrDiscardOp(GrRenderTargetProxy* proxy) : INHERITED(ClassID()) {
+ this->makeFullScreen(proxy);
+ }
+
+ bool onCombineIfPossible(GrOp* that, const GrCaps& caps) override { return false; }
+
+ void onPrepare(GrOpFlushState*) override {}
+
+ void onExecute(GrOpFlushState* state) override {
+ state->commandBuffer()->discard();
+ }
+
+ typedef GrOp INHERITED;
+};
+
+#endif