aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ops
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/ops')
-rw-r--r--src/gpu/ops/GrAtlasTextOp.cpp16
-rw-r--r--src/gpu/ops/GrClearOp.h2
-rw-r--r--src/gpu/ops/GrClearStencilClipOp.h2
-rw-r--r--src/gpu/ops/GrCopySurfaceOp.h2
-rw-r--r--src/gpu/ops/GrDefaultPathRenderer.cpp2
-rw-r--r--src/gpu/ops/GrDiscardOp.h2
-rw-r--r--src/gpu/ops/GrDrawPathOp.cpp4
-rw-r--r--src/gpu/ops/GrDrawPathOp.h4
-rw-r--r--src/gpu/ops/GrMSAAPathRenderer.cpp2
-rw-r--r--src/gpu/ops/GrMeshDrawOp.cpp4
-rw-r--r--src/gpu/ops/GrMeshDrawOp.h2
-rw-r--r--src/gpu/ops/GrOp.cpp1
-rw-r--r--src/gpu/ops/GrOp.h12
-rw-r--r--src/gpu/ops/GrStencilPathOp.h2
14 files changed, 22 insertions, 35 deletions
diff --git a/src/gpu/ops/GrAtlasTextOp.cpp b/src/gpu/ops/GrAtlasTextOp.cpp
index 89329b5433..b7e7ea3828 100644
--- a/src/gpu/ops/GrAtlasTextOp.cpp
+++ b/src/gpu/ops/GrAtlasTextOp.cpp
@@ -136,22 +136,6 @@ void GrAtlasTextOp::onPrepareDraws(Target* target) const {
// now copy all vertices
memcpy(currVertex, blobVertices, byteCount);
-#ifdef SK_DEBUG
- // bounds sanity check
- SkRect rect;
- rect.setLargestInverted();
- SkPoint* vertex = (SkPoint*)((char*)blobVertices);
- rect.growToInclude(vertex, vertexStride, kVerticesPerGlyph * subRunGlyphCount);
-
- if (this->usesDistanceFields()) {
- args.fViewMatrix.mapRect(&rect);
- }
- // Allow for small numerical error in the bounds.
- SkRect bounds = this->bounds();
- bounds.outset(0.001f, 0.001f);
- SkASSERT(bounds.contains(rect));
-#endif
-
currVertex += byteCount;
}
diff --git a/src/gpu/ops/GrClearOp.h b/src/gpu/ops/GrClearOp.h
index b40b615b2e..218dcd165e 100644
--- a/src/gpu/ops/GrClearOp.h
+++ b/src/gpu/ops/GrClearOp.h
@@ -109,7 +109,7 @@ private:
void onPrepare(GrOpFlushState*) override {}
- void onExecute(GrOpFlushState* state, const SkRect& /*bounds*/) override {
+ void onExecute(GrOpFlushState* state) override {
state->commandBuffer()->clear(fRenderTarget.get(), fClip, fColor);
}
diff --git a/src/gpu/ops/GrClearStencilClipOp.h b/src/gpu/ops/GrClearStencilClipOp.h
index afbd72ddbf..ef46a4c6a9 100644
--- a/src/gpu/ops/GrClearStencilClipOp.h
+++ b/src/gpu/ops/GrClearStencilClipOp.h
@@ -53,7 +53,7 @@ private:
void onPrepare(GrOpFlushState*) override {}
- void onExecute(GrOpFlushState* state, const SkRect& /*bounds*/) override {
+ void onExecute(GrOpFlushState* state) override {
state->commandBuffer()->clearStencilClip(fRenderTarget.get(), fClip, fInsideStencilMask);
}
diff --git a/src/gpu/ops/GrCopySurfaceOp.h b/src/gpu/ops/GrCopySurfaceOp.h
index e74b7e5111..4c4500b445 100644
--- a/src/gpu/ops/GrCopySurfaceOp.h
+++ b/src/gpu/ops/GrCopySurfaceOp.h
@@ -57,7 +57,7 @@ private:
void onPrepare(GrOpFlushState*) override {}
- void onExecute(GrOpFlushState* state, const SkRect& /*bounds*/) override {
+ void onExecute(GrOpFlushState* state) override {
if (!state->commandBuffer()) {
state->gpu()->copySurface(fDst.get(), fSrc.get(), fSrcRect, fDstPoint);
} else {
diff --git a/src/gpu/ops/GrDefaultPathRenderer.cpp b/src/gpu/ops/GrDefaultPathRenderer.cpp
index 41ec8fb85e..f2be9681a8 100644
--- a/src/gpu/ops/GrDefaultPathRenderer.cpp
+++ b/src/gpu/ops/GrDefaultPathRenderer.cpp
@@ -264,7 +264,7 @@ private:
bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override {
DefaultPathOp* that = t->cast<DefaultPathOp>();
if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *that->pipeline(),
- that->bounds(), caps)) {
+ that->bounds(), caps)) {
return false;
}
diff --git a/src/gpu/ops/GrDiscardOp.h b/src/gpu/ops/GrDiscardOp.h
index f9be33d729..098df63e7a 100644
--- a/src/gpu/ops/GrDiscardOp.h
+++ b/src/gpu/ops/GrDiscardOp.h
@@ -41,7 +41,7 @@ private:
void onPrepare(GrOpFlushState*) override {}
- void onExecute(GrOpFlushState* state, const SkRect& /*bounds*/) override {
+ void onExecute(GrOpFlushState* state) override {
state->commandBuffer()->discard(fRenderTarget.get());
}
diff --git a/src/gpu/ops/GrDrawPathOp.cpp b/src/gpu/ops/GrDrawPathOp.cpp
index c2b4fdb4bc..85fb1473d5 100644
--- a/src/gpu/ops/GrDrawPathOp.cpp
+++ b/src/gpu/ops/GrDrawPathOp.cpp
@@ -27,7 +27,7 @@ SkString GrDrawPathOp::dumpInfo() const {
return string;
}
-void GrDrawPathOp::onExecute(GrOpFlushState* state, const SkRect& bounds) {
+void GrDrawPathOp::onExecute(GrOpFlushState* state) {
GrProgramDesc desc;
sk_sp<GrPathProcessor> pathProc(
@@ -115,7 +115,7 @@ bool GrDrawPathRangeOp::onCombineIfPossible(GrOp* t, const GrCaps& caps) {
return true;
}
-void GrDrawPathRangeOp::onExecute(GrOpFlushState* state, const SkRect& bounds) {
+void GrDrawPathRangeOp::onExecute(GrOpFlushState* state) {
const Draw& head = *fDraws.head();
SkMatrix drawMatrix(this->viewMatrix());
diff --git a/src/gpu/ops/GrDrawPathOp.h b/src/gpu/ops/GrDrawPathOp.h
index 3e84ffe52d..ffe8768cc0 100644
--- a/src/gpu/ops/GrDrawPathOp.h
+++ b/src/gpu/ops/GrDrawPathOp.h
@@ -78,7 +78,7 @@ private:
bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override { return false; }
- void onExecute(GrOpFlushState* state, const SkRect& bounds) override;
+ void onExecute(GrOpFlushState* state) override;
GrPendingIOResource<const GrPath, kRead_GrIOType> fPath;
@@ -172,7 +172,7 @@ private:
bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override;
- void onExecute(GrOpFlushState* state, const SkRect& bounds) override;
+ void onExecute(GrOpFlushState* state) override;
struct Draw {
void set(const InstanceData* instanceData, SkScalar x, SkScalar y) {
diff --git a/src/gpu/ops/GrMSAAPathRenderer.cpp b/src/gpu/ops/GrMSAAPathRenderer.cpp
index 78a80b18be..b149b4ca88 100644
--- a/src/gpu/ops/GrMSAAPathRenderer.cpp
+++ b/src/gpu/ops/GrMSAAPathRenderer.cpp
@@ -452,7 +452,7 @@ private:
bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override {
MSAAPathOp* that = t->cast<MSAAPathOp>();
if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *that->pipeline(),
- that->bounds(), caps)) {
+ that->bounds(), caps)) {
return false;
}
diff --git a/src/gpu/ops/GrMeshDrawOp.cpp b/src/gpu/ops/GrMeshDrawOp.cpp
index a8dd8b1b7e..5d83bd5364 100644
--- a/src/gpu/ops/GrMeshDrawOp.cpp
+++ b/src/gpu/ops/GrMeshDrawOp.cpp
@@ -59,7 +59,7 @@ void* GrMeshDrawOp::QuadHelper::init(Target* target, size_t vertexStride, int qu
quadsToDraw);
}
-void GrMeshDrawOp::onExecute(GrOpFlushState* state, const SkRect& bounds) {
+void GrMeshDrawOp::onExecute(GrOpFlushState* state) {
int currUploadIdx = 0;
int currMeshIdx = 0;
@@ -73,7 +73,7 @@ void GrMeshDrawOp::onExecute(GrOpFlushState* state, const SkRect& bounds) {
}
const QueuedDraw& draw = fQueuedDraws[currDrawIdx];
state->commandBuffer()->draw(*this->pipeline(), *draw.fGeometryProcessor.get(),
- fMeshes.begin() + currMeshIdx, draw.fMeshCnt, bounds);
+ fMeshes.begin() + currMeshIdx, draw.fMeshCnt, this->bounds());
currMeshIdx += draw.fMeshCnt;
state->flushToken();
}
diff --git a/src/gpu/ops/GrMeshDrawOp.h b/src/gpu/ops/GrMeshDrawOp.h
index 25fed02bb8..a7d312f151 100644
--- a/src/gpu/ops/GrMeshDrawOp.h
+++ b/src/gpu/ops/GrMeshDrawOp.h
@@ -64,7 +64,7 @@ protected:
private:
void onPrepare(GrOpFlushState* state) final;
- void onExecute(GrOpFlushState* state, const SkRect& bounds) final;
+ void onExecute(GrOpFlushState* state) final;
virtual void onPrepareDraws(Target*) const = 0;
diff --git a/src/gpu/ops/GrOp.cpp b/src/gpu/ops/GrOp.cpp
index 1d86419c77..7762a5a840 100644
--- a/src/gpu/ops/GrOp.cpp
+++ b/src/gpu/ops/GrOp.cpp
@@ -56,7 +56,6 @@ GrOp::GrOp(uint32_t classID)
: fClassID(classID)
, fUniqueID(kIllegalOpID) {
SkASSERT(classID == SkToU32(fClassID));
- SkDEBUGCODE(fUsed = false;)
SkDEBUGCODE(fBoundsFlags = kUninitialized_BoundsFlag);
}
diff --git a/src/gpu/ops/GrOp.h b/src/gpu/ops/GrOp.h
index 3a37ad53dd..11198dd9d7 100644
--- a/src/gpu/ops/GrOp.h
+++ b/src/gpu/ops/GrOp.h
@@ -76,6 +76,12 @@ public:
return fBounds;
}
+ void setClippedBounds(const SkRect& clippedBounds) {
+ fBounds = clippedBounds;
+ // The clipped bounds already incorporate any effect of the bounds flags.
+ fBoundsFlags = 0;
+ }
+
bool hasAABloat() const {
SkASSERT(fBoundsFlags != kUninitialized_BoundsFlag);
return SkToBool(fBoundsFlags & kAABloat_BoundsFlag);
@@ -118,7 +124,6 @@ public:
}
return fUniqueID;
}
- SkDEBUGCODE(bool isUsed() const { return fUsed; })
/**
* Called prior to executing. The op should perform any resource creation or data transfers
@@ -127,7 +132,7 @@ public:
void prepare(GrOpFlushState* state) { this->onPrepare(state); }
/** Issues the op's commands to GrGpu. */
- void execute(GrOpFlushState* state, const SkRect& bounds) { this->onExecute(state, bounds); }
+ void execute(GrOpFlushState* state) { this->onExecute(state); }
/** Used for spewing information about ops when debugging. */
virtual SkString dumpInfo() const {
@@ -186,7 +191,7 @@ private:
virtual bool onCombineIfPossible(GrOp*, const GrCaps& caps) = 0;
virtual void onPrepare(GrOpFlushState*) = 0;
- virtual void onExecute(GrOpFlushState*, const SkRect& bounds) = 0;
+ virtual void onExecute(GrOpFlushState*) = 0;
static uint32_t GenID(int32_t* idCounter) {
// The atomic inc returns the old value not the incremented value. So we add
@@ -215,7 +220,6 @@ private:
SkDEBUGCODE(kUninitialized_BoundsFlag = 0x4)
};
- SkDEBUGCODE(bool fUsed;)
const uint16_t fClassID;
uint16_t fBoundsFlags;
diff --git a/src/gpu/ops/GrStencilPathOp.h b/src/gpu/ops/GrStencilPathOp.h
index 462b626a83..ac19b5abec 100644
--- a/src/gpu/ops/GrStencilPathOp.h
+++ b/src/gpu/ops/GrStencilPathOp.h
@@ -66,7 +66,7 @@ private:
void onPrepare(GrOpFlushState*) override {}
- void onExecute(GrOpFlushState* state, const SkRect& bounds) override {
+ void onExecute(GrOpFlushState* state) override {
GrPathRendering::StencilPathArgs args(fUseHWAA, fRenderTarget.get(), &fViewMatrix,
&fScissor, &fStencil);
state->gpu()->pathRendering()->stencilPath(args, fPath.get());