aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrInOrderDrawBuffer.h
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-28 18:48:06 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-28 18:48:06 +0000
commitded4f4b163f5aa19c22c871178c55ecb34623846 (patch)
tree20c052999f9345c8cc8d0196e92760a5f4ca9273 /src/gpu/GrInOrderDrawBuffer.h
parent28060e7c940b07038bdaa3c5f8d1d87cf199e228 (diff)
Initial support for GL_NV_path_renering. Experimental, there are still some issues to resolve, set gyp variable skia_nv_path_rendering=1 or build flag GR_GL_USE_NV_PATH_RENDERING to enable.
Diffstat (limited to 'src/gpu/GrInOrderDrawBuffer.h')
-rw-r--r--src/gpu/GrInOrderDrawBuffer.h34
1 files changed, 23 insertions, 11 deletions
diff --git a/src/gpu/GrInOrderDrawBuffer.h b/src/gpu/GrInOrderDrawBuffer.h
index 61fa9e2a86..72ebe4d084 100644
--- a/src/gpu/GrInOrderDrawBuffer.h
+++ b/src/gpu/GrInOrderDrawBuffer.h
@@ -14,8 +14,11 @@
#include "GrDrawTarget.h"
#include "GrAllocPool.h"
#include "GrAllocator.h"
+#include "GrPath.h"
#include "GrClip.h"
+#include "SkTemplates.h"
+
class GrGpu;
class GrIndexBufferAllocPool;
class GrVertexBufferAllocPool;
@@ -136,10 +139,11 @@ protected:
int indexCount) SK_OVERRIDE;
private:
enum Cmd {
- kDraw_Cmd = 1,
- kSetState_Cmd = 2,
- kSetClip_Cmd = 3,
- kClear_Cmd = 4,
+ kDraw_Cmd = 1,
+ kStencilPath_Cmd = 2,
+ kSetState_Cmd = 3,
+ kSetClip_Cmd = 4,
+ kClear_Cmd = 5,
};
struct Draw {
@@ -153,6 +157,11 @@ private:
const GrIndexBuffer* fIndexBuffer;
};
+ struct StencilPath {
+ SkAutoTUnref<const GrPath> fPath;
+ GrPathFill fFill;
+ };
+
struct Clear {
Clear() : fRenderTarget(NULL) {}
~Clear() { GrSafeUnref(fRenderTarget); }
@@ -171,7 +180,7 @@ private:
virtual void onDrawNonIndexed(GrPrimitiveType primitiveType,
int startVertex,
int vertexCount) SK_OVERRIDE;
- virtual void onStencilPath(const GrPath&, GrPathFill) SK_OVERRIDE;
+ virtual void onStencilPath(const GrPath*, GrPathFill) SK_OVERRIDE;
virtual bool onReserveVertexSpace(GrVertexLayout layout,
int vertexCount,
void** vertices) SK_OVERRIDE;
@@ -196,12 +205,13 @@ private:
bool needsNewClip() const;
// these functions record a command
- void recordState();
- void recordDefaultState();
- void recordClip();
- void recordDefaultClip();
- Draw* recordDraw();
- Clear* recordClear();
+ void recordState();
+ void recordDefaultState();
+ void recordClip();
+ void recordDefaultClip();
+ Draw* recordDraw();
+ StencilPath* recordStencilPath();
+ Clear* recordClear();
// call this to invalidate the tracking data that is used to concatenate
// multiple draws into a single draw.
@@ -210,6 +220,7 @@ private:
enum {
kCmdPreallocCnt = 32,
kDrawPreallocCnt = 8,
+ kStencilPathPreallocCnt = 8,
kStatePreallocCnt = 8,
kClipPreallocCnt = 8,
kClearPreallocCnt = 4,
@@ -218,6 +229,7 @@ private:
SkSTArray<kCmdPreallocCnt, uint8_t, true> fCmds;
GrSTAllocator<kDrawPreallocCnt, Draw> fDraws;
+ GrSTAllocator<kStatePreallocCnt, StencilPath> fStencilPaths;
GrSTAllocator<kStatePreallocCnt, GrDrawState> fStates;
GrSTAllocator<kClearPreallocCnt, Clear> fClears;
GrSTAllocator<kClipPreallocCnt, GrClip> fClips;