diff options
author | Robert Phillips <robertphillips@google.com> | 2017-05-24 13:28:36 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-25 15:20:27 +0000 |
commit | 3fdd0bf2d90b1b82c1ac3aa982bdca600de7f4a8 (patch) | |
tree | cea0a46afca9e4bc94c9cd5ba43eeae8d3a2b2bc /src/gpu/GrRenderTargetOpList.h | |
parent | cd2f512578a800bdcc3e4aed7eecd21826677d17 (diff) |
Update clearOp for split-OpList world (take 2)
It would reduce a lot of noise if the GrRenderTargetOpList kept a pointer to the GrCaps but, for now, I'm trying to shrink the GrRTOpList, not expand it.
Reland of: https://skia-review.googlesource.com/c/17323/ (Update clearOp for split-OpList world)
Change-Id: I97f3fb81e6258d430e7f7cf1ea8bd51a392f9f47
Reviewed-on: https://skia-review.googlesource.com/17830
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrRenderTargetOpList.h')
-rw-r--r-- | src/gpu/GrRenderTargetOpList.h | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/gpu/GrRenderTargetOpList.h b/src/gpu/GrRenderTargetOpList.h index 7f407824db..e9850698f3 100644 --- a/src/gpu/GrRenderTargetOpList.h +++ b/src/gpu/GrRenderTargetOpList.h @@ -65,19 +65,18 @@ public: void prepareOps(GrOpFlushState* flushState) override; bool executeOps(GrOpFlushState* flushState) override; - uint32_t addOp(std::unique_ptr<GrOp> op, GrRenderTargetContext* renderTargetContext) { - this->recordOp(std::move(op), renderTargetContext, nullptr, nullptr); + uint32_t addOp(std::unique_ptr<GrOp> op, const GrCaps& caps) { + this->recordOp(std::move(op), caps, nullptr, nullptr); return this->uniqueID(); } - uint32_t addOp(std::unique_ptr<GrOp> op, GrRenderTargetContext* renderTargetContext, + uint32_t addOp(std::unique_ptr<GrOp> op, const GrCaps& caps, GrAppliedClip&& clip, const DstTexture& dstTexture) { - this->recordOp(std::move(op), renderTargetContext, clip.doesClip() ? &clip : nullptr, - &dstTexture); + this->recordOp(std::move(op), caps, clip.doesClip() ? &clip : nullptr, &dstTexture); return this->uniqueID(); } /** Clears the entire render target */ - void fullClear(GrRenderTargetContext*, GrColor color); + void fullClear(const GrCaps& caps, GrColor color); /** * Copies a pixel rectangle from one surface to another. This call may finalize @@ -127,8 +126,8 @@ private: // If the input op is combined with an earlier op, this returns the combined op. Otherwise, it // returns the input op. - GrOp* recordOp(std::unique_ptr<GrOp>, GrRenderTargetContext*, GrAppliedClip* = nullptr, - const DstTexture* = nullptr); + GrOp* recordOp(std::unique_ptr<GrOp>, const GrCaps& caps, + GrAppliedClip* = nullptr, const DstTexture* = nullptr); void forwardCombine(const GrCaps&); @@ -136,22 +135,20 @@ private: bool combineIfPossible(const RecordedOp& a, GrOp* b, const GrAppliedClip* bClip, const DstTexture* bDstTexture, const GrCaps&); - GrClearOp* fLastFullClearOp = nullptr; - GrGpuResource::UniqueID fLastFullClearResourceID = GrGpuResource::UniqueID::InvalidID(); - GrSurfaceProxy::UniqueID fLastFullClearProxyID = GrSurfaceProxy::UniqueID::InvalidID(); + GrClearOp* fLastFullClearOp = nullptr; std::unique_ptr<gr_instanced::InstancedRendering> fInstancedRendering; - int32_t fLastClipStackGenID; - SkIRect fLastDevClipBounds; + int32_t fLastClipStackGenID; + SkIRect fLastDevClipBounds; // For ops/opList we have mean: 5 stdDev: 28 SkSTArray<5, RecordedOp, true> fRecordedOps; // MDB TODO: 4096 for the first allocation of the clip space will be huge overkill. // Gather statistics to determine the correct size. - SkArenaAlloc fClipAllocator{4096}; - SkDEBUGCODE(int fNumClips;) + SkArenaAlloc fClipAllocator{4096}; + SkDEBUGCODE(int fNumClips;) typedef GrOpList INHERITED; }; |