diff options
author | Robert Phillips <robertphillips@google.com> | 2017-04-13 10:13:16 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-13 15:42:59 +0000 |
commit | e440721a86322b28b531fc63db19a0aada53aa95 (patch) | |
tree | 7c81408e2e581e05671fdd90a2f6139b48781169 /src | |
parent | 1335a0561e28b97ff4347129c7cc3fdcbf952eb5 (diff) |
Remove GrRenderTargetOpList::discard & move functionality to GrRenderTargetContext
Change-Id: If84ffb7b01543a44179837d683c0a4c004e52f63
Reviewed-on: https://skia-review.googlesource.com/13335
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrRenderTargetContext.cpp | 11 | ||||
-rw-r--r-- | src/gpu/GrRenderTargetOpList.cpp | 13 | ||||
-rw-r--r-- | src/gpu/GrRenderTargetOpList.h | 3 |
3 files changed, 10 insertions, 17 deletions
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp index 38bd4ac85a..40ccbeaa21 100644 --- a/src/gpu/GrRenderTargetContext.cpp +++ b/src/gpu/GrRenderTargetContext.cpp @@ -26,6 +26,7 @@ #include "instanced/InstancedRendering.h" #include "ops/GrClearOp.h" #include "ops/GrClearStencilClipOp.h" +#include "ops/GrDiscardOp.h" #include "ops/GrDrawOp.h" #include "ops/GrDrawAtlasOp.h" #include "ops/GrDrawVerticesOp.h" @@ -192,7 +193,15 @@ void GrRenderTargetContext::discard() { AutoCheckFlush acf(this->drawingManager()); - this->getOpList()->discard(this); + // Currently this just inserts a discard op. However, once in MDB this can remove all the + // previously recorded ops and change the load op to discard. + if (this->caps()->discardRenderTargetSupport()) { + std::unique_ptr<GrOp> op(GrDiscardOp::Make(this)); + if (!op) { + return; + } + this->getOpList()->addOp(std::move(op), this); + } } void GrRenderTargetContext::clear(const SkIRect* rect, diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp index 0e870fd2e5..3d38c99eb8 100644 --- a/src/gpu/GrRenderTargetOpList.cpp +++ b/src/gpu/GrRenderTargetOpList.cpp @@ -15,7 +15,6 @@ #include "GrResourceProvider.h" #include "ops/GrClearOp.h" #include "ops/GrCopySurfaceOp.h" -#include "ops/GrDiscardOp.h" #include "instanced/InstancedRendering.h" using gr_instanced::InstancedRendering; @@ -251,18 +250,6 @@ void GrRenderTargetOpList::fullClear(GrRenderTargetContext* renderTargetContext, } } -void GrRenderTargetOpList::discard(GrRenderTargetContext* renderTargetContext) { - // Currently this just inserts a discard op. However, once in MDB this can remove all the - // previously recorded ops and change the load op to discard. - if (this->caps()->discardRenderTargetSupport()) { - std::unique_ptr<GrOp> op(GrDiscardOp::Make(renderTargetContext)); - if (!op) { - return; - } - this->recordOp(std::move(op), renderTargetContext); - } -} - //////////////////////////////////////////////////////////////////////////////// bool GrRenderTargetOpList::copySurface(GrResourceProvider* resourceProvider, diff --git a/src/gpu/GrRenderTargetOpList.h b/src/gpu/GrRenderTargetOpList.h index 16c103a070..cd08559a77 100644 --- a/src/gpu/GrRenderTargetOpList.h +++ b/src/gpu/GrRenderTargetOpList.h @@ -85,9 +85,6 @@ public: /** Clears the entire render target */ void fullClear(GrRenderTargetContext*, GrColor color); - /** Discards the contents render target. */ - void discard(GrRenderTargetContext*); - /** * Copies a pixel rectangle from one surface to another. This call may finalize * reserved vertex/index data (as though a draw call was made). The src pixels |