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

Unified Diff: src/gpu/GrOptDrawState.h

Issue 845103005: GrBatchPrototype (Closed) Base URL: https://skia.googlesource.com/skia.git@lc2
Patch Set: cleanup Created 5 years, 11 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
Index: src/gpu/GrOptDrawState.h
diff --git a/src/gpu/GrOptDrawState.h b/src/gpu/GrOptDrawState.h
index 00e368c66a570c00353a1253977706b3bfcfe8b2..81c35100932912dcd2202cae8b1fc736bf2d7f7d 100644
--- a/src/gpu/GrOptDrawState.h
+++ b/src/gpu/GrOptDrawState.h
@@ -17,9 +17,9 @@
#include "SkMatrix.h"
#include "SkRefCnt.h"
+class GrBatch;
class GrDeviceCoordTexture;
class GrDrawState;
-class GrPathProcessor;
/**
* Class that holds an optimized version of a GrDrawState. It is meant to be an immutable class,
@@ -29,15 +29,22 @@ class GrOptDrawState {
public:
SK_DECLARE_INST_COUNT(GrOptDrawState)
+ // TODO get rid of this version of the constructor when we use batch everywhere
GrOptDrawState(const GrDrawState& drawState, const GrPrimitiveProcessor*,
const GrDrawTargetCaps&, const GrScissorState&,
const GrDeviceCoordTexture* dstCopy, GrGpu::DrawType);
+ GrOptDrawState(GrBatch*,
+ const GrDrawState& drawState,
+ const GrDrawTargetCaps&, const GrScissorState&,
+ const GrDeviceCoordTexture* dstCopy, GrGpu::DrawType);
+
+
/*
* Returns true if it is possible to combine the two GrOptDrawStates and it will update 'this'
* to subsume 'that''s draw.
*/
- bool combineIfPossible(const GrOptDrawState& that);
+ bool combineIfPossible(GrOptDrawState& that);
/// @}
@@ -136,11 +143,35 @@ public:
const GrDeviceCoordTexture* getDstCopy() const { return fDstCopy.texture() ? &fDstCopy : NULL; }
// Finalize *MUST* be called before programDesc()
+ // TODO we need to move the descriptor out of GrOptDrawState. The program Descriptor should be
+ // a combination of OptState descriptor(which can be created when optstate is constructed)
+ // and GrGeometryProcessor key.
void finalize(GrGpu*);
const GrProgramDesc& programDesc() const { SkASSERT(fFinalized); return fDesc; }
+ void flush(GrGpu*, GrVertexBufferAllocPool*, GrIndexBufferAllocPool*);
+
+ // TODO this is unfortunate, but GrBatch needs to initialize the batch tracker on the GP
+ // NOBODY ELSE should be using this. Once we use GrBatch everywhere we can remove this
+ GrBatchTracker* batchTracker() { return &fBatchTracker; }
+
+ // TODO this goes away when I pull primitive processor off optstate
+ void setPrimitiveProcessor(const GrPrimitiveProcessor* primProc) {
+ fFinalized = false;
+ fPrimitiveProcessor.reset(primProc);
+ }
+
private:
+ // TODO we can have one constructor once GrBatch is complete
+ void internalConstructor(GrGeometryProcessor::InitBT*,
+ const GrDrawState&,
+ const GrProcOptInfo& colorPOI,
+ const GrProcOptInfo& coveragePOI,
+ const GrDrawTargetCaps&,
+ const GrScissorState&,
+ const GrDeviceCoordTexture* dstCopy);
+
/**
* Alter the program desc and inputs (attribs and processors) based on the blend optimization.
*/

Powered by Google App Engine
This is Rietveld 408576698