diff options
author | 2013-11-06 10:08:21 +0000 | |
---|---|---|
committer | 2013-11-06 10:08:21 +0000 | |
commit | 6006d0f8c4f19d19a12de20826f731f52ac822a7 (patch) | |
tree | 6ec1663c2591016c0a5e91543ace2e3018617212 /src/gpu/GrAARectRenderer.h | |
parent | 382fde3a3c5cb5e8e3dcdc4c549541453851d8d0 (diff) |
Add bevel-stroke support in GrAARectRenderer
Committed: http://code.google.com/p/skia/source/detail?r=12082
R=robertphillips@google.com, bsalomon@google.com
Author: yunchao.he@intel.com
Review URL: https://codereview.chromium.org/23712005
git-svn-id: http://skia.googlecode.com/svn/trunk@12148 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/GrAARectRenderer.h')
-rw-r--r-- | src/gpu/GrAARectRenderer.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/gpu/GrAARectRenderer.h b/src/gpu/GrAARectRenderer.h index 2e705ca801..3e7e980e59 100644 --- a/src/gpu/GrAARectRenderer.h +++ b/src/gpu/GrAARectRenderer.h @@ -11,6 +11,7 @@ #include "SkMatrix.h" #include "SkRect.h" #include "SkRefCnt.h" +#include "SkStrokeRec.h" class GrGpu; class GrDrawTarget; @@ -25,7 +26,8 @@ public: GrAARectRenderer() : fAAFillRectIndexBuffer(NULL) - , fAAStrokeRectIndexBuffer(NULL) { + , fAAMiterStrokeRectIndexBuffer(NULL) + , fAABevelStrokeRectIndexBuffer(NULL) { } void reset(); @@ -35,7 +37,7 @@ public: } // TODO: potentialy fuse the fill & stroke methods and differentiate - // between them by passing in strokeWidth (<0 means fill). + // between them by passing in stroke (==NULL means fill). void fillAARect(GrGpu* gpu, GrDrawTarget* target, @@ -63,7 +65,7 @@ public: const SkRect& rect, const SkMatrix& combinedMatrix, const SkRect& devRect, - SkScalar width, + const SkStrokeRec* stroke, bool useVertexCoverage); // First rect is outer; second rect is inner @@ -75,12 +77,13 @@ public: private: GrIndexBuffer* fAAFillRectIndexBuffer; - GrIndexBuffer* fAAStrokeRectIndexBuffer; + GrIndexBuffer* fAAMiterStrokeRectIndexBuffer; + GrIndexBuffer* fAABevelStrokeRectIndexBuffer; GrIndexBuffer* aaFillRectIndexBuffer(GrGpu* gpu); - static int aaStrokeRectIndexCount(); - GrIndexBuffer* aaStrokeRectIndexBuffer(GrGpu* gpu); + static int aaStrokeRectIndexCount(bool miterStroke); + GrIndexBuffer* aaStrokeRectIndexBuffer(GrGpu* gpu, bool miterStroke); // TODO: Remove the useVertexCoverage boolean. Just use it all the time // since we now have a coverage vertex attribute @@ -104,8 +107,10 @@ private: void geometryStrokeAARect(GrGpu* gpu, GrDrawTarget* target, const SkRect& devOutside, + const SkRect& devOutsideAssist, const SkRect& devInside, - bool useVertexCoverage); + bool useVertexCoverage, + bool miterStroke); typedef SkRefCnt INHERITED; }; |