Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Unified Diff: src/gpu/batches/GrDrawPathBatch.h

Issue 1966763002: Eliminate special case nvpr batch handling (Closed) Base URL: https://skia.googlesource.com/skia.git@reallyupload_userstencil
Patch Set: fixes Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrStencilSettings.cpp ('k') | src/gpu/batches/GrDrawPathBatch.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrDrawPathBatch.h
diff --git a/src/gpu/batches/GrDrawPathBatch.h b/src/gpu/batches/GrDrawPathBatch.h
index 55fe31a6bd42421dec33be2b01dda363c5d509ce..7e695d83df6c0232202024c39170d9f4e09e20e2 100644
--- a/src/gpu/batches/GrDrawPathBatch.h
+++ b/src/gpu/batches/GrDrawPathBatch.h
@@ -26,13 +26,6 @@ public:
coverage->setKnownSingleComponent(0xff);
}
- GrPathRendering::FillType fillType() const { return fFillType; }
-
- void setStencilSettings(const GrUserStencilSettings& stencil, bool hasStencilClip,
- int numStencilBits) {
- fStencilSettings.reset(stencil, hasStencilClip, numStencilBits);
- }
-
protected:
GrDrawPathBatchBase(uint32_t classID, const SkMatrix& viewMatrix, GrColor initialColor,
GrPathRendering::FillType fill)
@@ -41,10 +34,14 @@ protected:
, fColor(initialColor)
, fFillType(fill) {}
- const GrStencilSettings& stencilSettings() const { return fStencilSettings; }
+ const GrStencilSettings& stencilPassSettings() const {
+ SkASSERT(!fStencilPassSettings.isDisabled()); // This shouldn't be called before onPrepare.
+ return fStencilPassSettings;
+ }
const GrXPOverridesForBatch& overrides() const { return fOverrides; }
const SkMatrix& viewMatrix() const { return fViewMatrix; }
GrColor color() const { return fColor; }
+ GrPathRendering::FillType fillType() const { return fFillType; }
private:
void initBatchTracker(const GrXPOverridesForBatch& overrides) override {
@@ -52,10 +49,12 @@ private:
fOverrides = overrides;
}
+ void onPrepare(GrBatchFlushState*) override; // Initializes fStencilPassSettings.
+
SkMatrix fViewMatrix;
GrColor fColor;
GrPathRendering::FillType fFillType;
- GrStencilSettings fStencilSettings;
+ GrStencilSettings fStencilPassSettings;
GrXPOverridesForBatch fOverrides;
typedef GrDrawBatch INHERITED;
@@ -65,9 +64,8 @@ class GrDrawPathBatch final : public GrDrawPathBatchBase {
public:
DEFINE_BATCH_CLASS_ID
- // This can't return a more abstract type because we install the stencil settings late :(
- static GrDrawPathBatchBase* Create(const SkMatrix& viewMatrix, GrColor color,
- GrPathRendering::FillType fill, const GrPath* path) {
+ static GrDrawBatch* Create(const SkMatrix& viewMatrix, GrColor color,
+ GrPathRendering::FillType fill, const GrPath* path) {
return new GrDrawPathBatch(viewMatrix, color, fill, path);
}
@@ -86,8 +84,6 @@ private:
bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { return false; }
- void onPrepare(GrBatchFlushState*) override {}
-
void onDraw(GrBatchFlushState* state) override;
GrPendingIOResource<const GrPath, kRead_GrIOType> fPath;
@@ -161,11 +157,9 @@ public:
SkDEBUGCODE(int fReserveCnt;)
};
- // This can't return a more abstract type because we install the stencil settings late :(
- static GrDrawPathBatchBase* Create(const SkMatrix& viewMatrix, SkScalar scale, SkScalar x,
- SkScalar y, GrColor color, GrPathRendering::FillType fill,
- GrPathRange* range, const InstanceData* instanceData,
- const SkRect& bounds) {
+ static GrDrawBatch* Create(const SkMatrix& viewMatrix, SkScalar scale, SkScalar x, SkScalar y,
+ GrColor color, GrPathRendering::FillType fill, GrPathRange* range,
+ const InstanceData* instanceData, const SkRect& bounds) {
return new GrDrawPathRangeBatch(viewMatrix, scale, x, y, color, fill, range, instanceData,
bounds);
}
@@ -183,8 +177,6 @@ private:
bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override;
- void onPrepare(GrBatchFlushState*) override {}
-
void onDraw(GrBatchFlushState* state) override;
struct Draw {
« no previous file with comments | « src/gpu/GrStencilSettings.cpp ('k') | src/gpu/batches/GrDrawPathBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698