aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrInOrderDrawBuffer.h
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-09 15:14:18 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-09 15:14:18 +0000
commit32184d81629e39809bb9e915286d8fe971a8ed68 (patch)
tree51daf51f89699ddc902212654b473f09f1875e41 /src/gpu/GrInOrderDrawBuffer.h
parent598cf5d3cfc428108cf21ab45d73a995d7e5c2a8 (diff)
Implement stroking a path with nv_path_rendering
Initialize the path stroke properties in the GrGLPath constructor. Use StencilStrokePath and CoverStrokePath to stroke the path. The order of the GL calls is: 1. StencilFill, if needed 2. StencilStroke, if needed 2a. CoverStroke, if stroke was applied 2b. CoverFill, if stroke was not applied The reason for not pairing StencilFill + CoverFill, StencilStroke + CoverStroke is that Skia API does not allow separate fill and stroke color within one call. Covering the stroke bounding box should also cover the fill bounding box. Causes different rendering in gm/dashcubics due to different rendering algorithm. (?) (TODO: this should be resolved somehow.) R=bsalomon@google.com, markkilgard@gmail.com, cdalton@nvidia.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/23440049 git-svn-id: http://skia.googlecode.com/svn/trunk@11672 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/GrInOrderDrawBuffer.h')
-rw-r--r--src/gpu/GrInOrderDrawBuffer.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/gpu/GrInOrderDrawBuffer.h b/src/gpu/GrInOrderDrawBuffer.h
index b9e5ca8718..275d7e06fa 100644
--- a/src/gpu/GrInOrderDrawBuffer.h
+++ b/src/gpu/GrInOrderDrawBuffer.h
@@ -14,7 +14,6 @@
#include "GrPath.h"
#include "SkClipStack.h"
-#include "SkStrokeRec.h"
#include "SkTemplates.h"
#include "SkTypes.h"
@@ -87,7 +86,7 @@ private:
kSetClip_Cmd = 4,
kClear_Cmd = 5,
kCopySurface_Cmd = 6,
- kFillPath_Cmd = 7,
+ kDrawPath_Cmd = 7,
};
class DrawRecord : public DrawInfo {
@@ -101,15 +100,13 @@ private:
StencilPath();
SkAutoTUnref<const GrPath> fPath;
- SkStrokeRec fStroke;
SkPath::FillType fFill;
};
- struct FillPath : public ::SkNoncopyable {
- FillPath();
+ struct DrawPath : public ::SkNoncopyable {
+ DrawPath();
SkAutoTUnref<const GrPath> fPath;
- SkStrokeRec fStroke;
SkPath::FillType fFill;
GrDeviceCoordTexture fDstCopy;
};
@@ -136,9 +133,11 @@ private:
const SkMatrix* matrix,
const SkRect* localRect,
const SkMatrix* localMatrix) SK_OVERRIDE;
- virtual void onStencilPath(const GrPath*, const SkStrokeRec& stroke, SkPath::FillType) SK_OVERRIDE;
- virtual void onFillPath(const GrPath*, const SkStrokeRec& stroke, SkPath::FillType,
+
+ virtual void onStencilPath(const GrPath*, SkPath::FillType) SK_OVERRIDE;
+ virtual void onDrawPath(const GrPath*, SkPath::FillType,
const GrDeviceCoordTexture* dstCopy) SK_OVERRIDE;
+
virtual bool onReserveVertexSpace(size_t vertexSize,
int vertexCount,
void** vertices) SK_OVERRIDE;
@@ -181,7 +180,7 @@ private:
void recordClip();
DrawRecord* recordDraw(const DrawInfo&);
StencilPath* recordStencilPath();
- FillPath* recordFillPath();
+ DrawPath* recordDrawPath();
Clear* recordClear();
CopySurface* recordCopySurface();
@@ -190,7 +189,7 @@ private:
kCmdPreallocCnt = 32,
kDrawPreallocCnt = 8,
kStencilPathPreallocCnt = 8,
- kFillPathPreallocCnt = 8,
+ kDrawPathPreallocCnt = 8,
kStatePreallocCnt = 8,
kClipPreallocCnt = 8,
kClearPreallocCnt = 4,
@@ -201,7 +200,7 @@ private:
SkSTArray<kCmdPreallocCnt, uint8_t, true> fCmds;
GrSTAllocator<kDrawPreallocCnt, DrawRecord> fDraws;
GrSTAllocator<kStatePreallocCnt, StencilPath> fStencilPaths;
- GrSTAllocator<kStatePreallocCnt, FillPath> fFillPaths;
+ GrSTAllocator<kStatePreallocCnt, DrawPath> fDrawPaths;
GrSTAllocator<kStatePreallocCnt, GrDrawState::DeferredState> fStates;
GrSTAllocator<kClearPreallocCnt, Clear> fClears;
GrSTAllocator<kCopySurfacePreallocCnt, CopySurface> fCopySurfaces;