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

Unified Diff: src/gpu/GrInOrderDrawBuffer.h

Issue 712223002: Combine similar DrawPaths calls in GrInOrderDrawBuffer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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/GrClipMaskManager.h ('k') | src/gpu/GrInOrderDrawBuffer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrInOrderDrawBuffer.h
diff --git a/src/gpu/GrInOrderDrawBuffer.h b/src/gpu/GrInOrderDrawBuffer.h
index 7780e402ed2e8b49373dfb01c2e2b1f338593f0d..4129d0a4dce45c192e8731d4e8cdcdff67842927 100644
--- a/src/gpu/GrInOrderDrawBuffer.h
+++ b/src/gpu/GrInOrderDrawBuffer.h
@@ -110,7 +110,7 @@ private:
Cmd(uint8_t type) : fType(type) {}
virtual ~Cmd() {}
- virtual void execute(GrGpu*, const GrOptDrawState*) = 0;
+ virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*) = 0;
uint8_t fType;
};
@@ -129,7 +129,7 @@ private:
const GrVertexBuffer* vertexBuffer() const { return fVertexBuffer.get(); }
const GrIndexBuffer* indexBuffer() const { return fIndexBuffer.get(); }
- virtual void execute(GrGpu*, const GrOptDrawState*);
+ virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*);
DrawInfo fInfo;
ScissorState fScissorState;
@@ -144,7 +144,7 @@ private:
const GrPath* path() const { return fPath.get(); }
- virtual void execute(GrGpu*, const GrOptDrawState*);
+ virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*);
ScissorState fScissorState;
GrStencilSettings fStencilSettings;
@@ -158,7 +158,7 @@ private:
const GrPath* path() const { return fPath.get(); }
- virtual void execute(GrGpu*, const GrOptDrawState*);
+ virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*);
GrDeviceCoordTexture fDstCopy;
ScissorState fScissorState;
@@ -172,12 +172,12 @@ private:
DrawPaths(const GrPathRange* pathRange) : Cmd(kDrawPaths_Cmd), fPathRange(pathRange) {}
const GrPathRange* pathRange() const { return fPathRange.get(); }
- uint32_t* indices() { return reinterpret_cast<uint32_t*>(CmdBuffer::GetDataForItem(this)); }
- float* transforms() { return reinterpret_cast<float*>(&this->indices()[fCount]); }
- virtual void execute(GrGpu*, const GrOptDrawState*);
+ virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*);
+ int fIndicesLocation;
size_t fCount;
+ int fTransformsLocation;
PathTransformType fTransformsType;
GrDeviceCoordTexture fDstCopy;
ScissorState fScissorState;
@@ -193,7 +193,7 @@ private:
GrRenderTarget* renderTarget() const { return fRenderTarget.get(); }
- virtual void execute(GrGpu*, const GrOptDrawState*);
+ virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*);
SkIRect fRect;
GrColor fColor;
@@ -209,7 +209,7 @@ private:
GrRenderTarget* renderTarget() const { return fRenderTarget.get(); }
- virtual void execute(GrGpu*, const GrOptDrawState*);
+ virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*);
SkIRect fRect;
bool fInsideClip;
@@ -224,7 +224,7 @@ private:
GrSurface* dst() const { return fDst.get(); }
GrSurface* src() const { return fSrc.get(); }
- virtual void execute(GrGpu*, const GrOptDrawState*);
+ virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*);
SkIPoint fDstPoint;
SkIRect fSrcRect;
@@ -237,7 +237,7 @@ private:
struct SetState : public Cmd {
SetState(const GrDrawState& state) : Cmd(kSetState_Cmd), fState(state) {}
- virtual void execute(GrGpu*, const GrOptDrawState*);
+ virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*);
GrDrawState fState;
GrGpu::DrawType fDrawType;
@@ -301,6 +301,8 @@ private:
// TODO: Use a single allocator for commands and records
enum {
kCmdBufferInitialSizeInBytes = 8 * 1024,
+ kPathIdxBufferMinReserve = 64,
+ kPathXformBufferMinReserve = 2 * kPathIdxBufferMinReserve,
kGeoPoolStatePreAllocCnt = 4,
};
@@ -310,6 +312,8 @@ private:
GrGpu* fDstGpu;
GrVertexBufferAllocPool& fVertexPool;
GrIndexBufferAllocPool& fIndexPool;
+ SkTDArray<uint32_t> fPathIndexBuffer;
+ SkTDArray<float> fPathTransformBuffer;
struct GeometryPoolState {
const GrVertexBuffer* fPoolVertexBuffer;
« no previous file with comments | « src/gpu/GrClipMaskManager.h ('k') | src/gpu/GrInOrderDrawBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698