aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrOpFlushState.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-05-03 20:58:59 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-03 20:59:06 +0000
commit0f353327968530506dd3dd15fca79ef59fe013f1 (patch)
treee225162be1818de922b243f184a03ce8a9060479 /src/gpu/GrOpFlushState.h
parent617824cc2bf47017e3cfc1251bea2296f2117db5 (diff)
Revert "Add a new non-AA rect op that does not inherit from GrLegacyMeshDrawOp."
This reverts commit ff574e0eb79b83c2e797dec8f1661378876202d8. Reason for revert: needs a merge Original change's description: > Add a new non-AA rect op that does not inherit from GrLegacyMeshDrawOp. > > This uses a new helper class, GrSimpleMeshDrawOpHelper, which it uses to fullfill the GrMeshDrawOp contract and to construct its GrPipline when flushed. The helper is intended to be used such that the op only stores a GrProcessorSet if it is constructed with a "nontrivial" GrPaint. "Trivial" currently means no fragment processors and src-over blending. The helper allows the op subclass to specify whether it supports stenciling via a template parameter. The helper class is initially intended to be used for ops that don't have per-vertex colors and construct a single GrPipeline at flush time, though perhaps this can be relaxed in future changes. > > On the microbenchmark "rotated_rects_bw_same_transparent_srcover" this produces a 18-20% reduction in time on my Z840 running Linux and 33% on my 2010 MacPro. > > Bug: skia: > Change-Id: I9f655827a70bee585b0b0e1255371ffd995a0b80 > Reviewed-on: https://skia-review.googlesource.com/14604 > Commit-Queue: Brian Salomon <bsalomon@google.com> > Reviewed-by: Brian Osman <brianosman@google.com> > TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I2893d6ff7c183a18f7d0ba82818701b80b681eb0 Reviewed-on: https://skia-review.googlesource.com/15280 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrOpFlushState.h')
-rw-r--r--src/gpu/GrOpFlushState.h40
1 files changed, 9 insertions, 31 deletions
diff --git a/src/gpu/GrOpFlushState.h b/src/gpu/GrOpFlushState.h
index 0fc7b7f834..4ba87feebf 100644
--- a/src/gpu/GrOpFlushState.h
+++ b/src/gpu/GrOpFlushState.h
@@ -10,7 +10,6 @@
#include "GrBufferAllocPool.h"
#include "GrGpu.h"
-#include "SkArenaAlloc.h"
#include "ops/GrMeshDrawOp.h"
class GrGpuCommandBuffer;
@@ -95,7 +94,6 @@ public:
void reset() {
fVertexPool.reset();
fIndexPool.reset();
- fPipelines.reset();
}
/** Additional data required on a per-op basis when executing GrDrawOps. */
@@ -112,22 +110,16 @@ public:
return *fOpArgs;
}
- template <typename... Args>
- GrPipeline* allocPipeline(Args... args) {
- return fPipelines.make<GrPipeline>(std::forward<Args>(args)...);
- }
-
private:
- GrGpu* fGpu;
- GrResourceProvider* fResourceProvider;
- GrGpuCommandBuffer* fCommandBuffer;
- GrVertexBufferAllocPool fVertexPool;
- GrIndexBufferAllocPool fIndexPool;
- SkSTArray<4, GrDrawOp::DeferredUploadFn> fAsapUploads;
- GrDrawOpUploadToken fLastIssuedToken;
- GrDrawOpUploadToken fLastFlushedToken;
- DrawOpArgs* fOpArgs;
- SkArenaAlloc fPipelines{sizeof(GrPipeline) * 100};
+ GrGpu* fGpu;
+ GrResourceProvider* fResourceProvider;
+ GrGpuCommandBuffer* fCommandBuffer;
+ GrVertexBufferAllocPool fVertexPool;
+ GrIndexBufferAllocPool fIndexPool;
+ SkSTArray<4, GrDrawOp::DeferredUploadFn> fAsapUploads;
+ GrDrawOpUploadToken fLastIssuedToken;
+ GrDrawOpUploadToken fLastFlushedToken;
+ DrawOpArgs* fOpArgs;
};
/**
@@ -190,7 +182,6 @@ public:
protected:
GrDrawOp* op() { return fOp; }
GrOpFlushState* state() { return fState; }
- const GrOpFlushState* state() const { return fState; }
private:
GrOpFlushState* fState;
@@ -220,19 +211,6 @@ public:
this->state()->putBackVertexSpace(vertices * vertexStride);
}
- GrRenderTarget* renderTarget() const { return this->state()->drawOpArgs().fRenderTarget; }
-
- const GrAppliedClip* clip() const { return this->state()->drawOpArgs().fAppliedClip; }
-
- const GrXferProcessor::DstTexture& dstTexture() const {
- return this->state()->drawOpArgs().fDstTexture;
- }
-
- template <typename... Args>
- GrPipeline* allocPipeline(Args... args) {
- return this->state()->allocPipeline(std::forward<Args>(args)...);
- }
-
private:
GrMeshDrawOp* meshDrawOp() { return static_cast<GrMeshDrawOp*>(this->op()); }
typedef GrDrawOp::Target INHERITED;