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

Unified Diff: src/gpu/GrTargetCommands.h

Issue 1286043004: Make GrVertexBatch objects hold their own draws during GrDrawTarget flush (Closed) Base URL: https://skia.googlesource.com/skia.git@m
Patch Set: forward decl Created 5 years, 4 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/GrReorderCommandBuilder.cpp ('k') | src/gpu/GrTargetCommands.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTargetCommands.h
diff --git a/src/gpu/GrTargetCommands.h b/src/gpu/GrTargetCommands.h
index bf973b68728e440259aaf2544504418c389d1f2c..3c08d2d24d97f84adcd78cdb05580e3044446927 100644
--- a/src/gpu/GrTargetCommands.h
+++ b/src/gpu/GrTargetCommands.h
@@ -8,27 +8,23 @@
#ifndef GrTargetCommands_DEFINED
#define GrTargetCommands_DEFINED
-#include "GrBatchTarget.h"
#include "GrDrawTarget.h"
-#include "GrGpu.h"
#include "GrPath.h"
#include "GrPendingProgramElement.h"
+#include "GrPrimitiveProcessor.h"
#include "GrRenderTarget.h"
#include "GrTRecorder.h"
-#include "SkRect.h"
-#include "SkTypes.h"
#include "batches/GrDrawBatch.h"
+#include "SkRect.h"
-class GrBufferedDrawTarget;
+class GrResourceProvider;
+class GrBatchFlushState;
// TODO: Convert all commands into GrBatch and remove this class.
class GrTargetCommands : ::SkNoncopyable {
public:
- GrTargetCommands(GrGpu* gpu)
- : fCmdBuffer(kCmdBufferInitialSizeInBytes)
- , fBatchTarget(gpu) {
- }
+ GrTargetCommands() : fCmdBuffer(kCmdBufferInitialSizeInBytes), fLastFlushToken(0) {}
class Cmd : ::SkNoncopyable {
public:
@@ -50,7 +46,7 @@ public:
{}
virtual ~Cmd() {}
- virtual void execute(GrGpu*) = 0;
+ virtual void execute(GrBatchFlushState*) = 0;
CmdType type() const { return fType; }
@@ -71,7 +67,7 @@ public:
};
void reset();
- void flush(GrBufferedDrawTarget*);
+ void flush(GrGpu*, GrResourceProvider*);
private:
friend class GrCommandBuilder;
@@ -132,7 +128,7 @@ private:
const GrPath* path() const { return fPath.get(); }
- void execute(GrGpu*) override;
+ void execute(GrBatchFlushState*) override;
SkMatrix fViewMatrix;
bool fUseHWAA;
@@ -151,7 +147,7 @@ private:
const GrPath* path() const { return fPath.get(); }
- void execute(GrGpu*) override;
+ void execute(GrBatchFlushState*) override;
SkAutoTUnref<StateForPathDraw> fState;
GrStencilSettings fStencilSettings;
@@ -167,7 +163,7 @@ private:
const GrPathRange* pathRange() const { return fPathRange.get(); }
- void execute(GrGpu*) override;
+ void execute(GrBatchFlushState*) override;
SkAutoTUnref<StateForPathDraw> fState;
char* fIndices;
@@ -187,7 +183,7 @@ private:
GrRenderTarget* renderTarget() const { return fRenderTarget.get(); }
- void execute(GrGpu*) override;
+ void execute(GrBatchFlushState*) override;
SkIRect fRect;
GrColor fColor;
@@ -202,7 +198,7 @@ private:
GrRenderTarget* renderTarget() const { return fRenderTarget.get(); }
- void execute(GrGpu*) override;
+ void execute(GrBatchFlushState*) override;
SkIRect fRect;
bool fInsideClip;
@@ -221,7 +217,7 @@ private:
GrSurface* dst() const { return fDst.get(); }
GrSurface* src() const { return fSrc.get(); }
- void execute(GrGpu*) override;
+ void execute(GrBatchFlushState*) override;
SkIPoint fDstPoint;
SkIRect fSrcRect;
@@ -232,19 +228,17 @@ private:
};
struct DrawBatch : public Cmd {
- DrawBatch(GrDrawBatch* batch, GrBatchTarget* batchTarget)
+ DrawBatch(GrDrawBatch* batch)
: Cmd(kDrawBatch_CmdType)
- , fBatch(SkRef(batch))
- , fBatchTarget(batchTarget) {
+ , fBatch(SkRef(batch)){
SkASSERT(!batch->isUsed());
}
GrDrawBatch* batch() { return fBatch; }
- void execute(GrGpu*) override;
+ void execute(GrBatchFlushState*) override;
private:
SkAutoTUnref<GrDrawBatch> fBatch;
- GrBatchTarget* fBatchTarget;
};
static const int kCmdBufferInitialSizeInBytes = 8 * 1024;
@@ -253,11 +247,9 @@ private:
typedef GrTRecorder<Cmd, TCmdAlign> CmdBuffer;
CmdBuffer* cmdBuffer() { return &fCmdBuffer; }
- GrBatchTarget* batchTarget() { return &fBatchTarget; }
CmdBuffer fCmdBuffer;
- GrBatchTarget fBatchTarget;
+ GrBatchToken fLastFlushToken;
};
#endif
-
« no previous file with comments | « src/gpu/GrReorderCommandBuilder.cpp ('k') | src/gpu/GrTargetCommands.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698