From 54190c42dd721b9b1db5a524fa3955625de99b84 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Wed, 9 Aug 2017 20:09:38 +0000 Subject: 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 > Commit-Queue: Robert Phillips 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 Commit-Queue: Robert Phillips --- src/gpu/ops/GrDiscardOp.h | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/gpu/ops/GrDiscardOp.h (limited to 'src/gpu/ops') 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 Make(GrRenderTargetProxy* proxy) { + return std::unique_ptr(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 -- cgit v1.2.3