Add special handling of rectori case for gpu
https://codereview.chromium.org/15080010/
git-svn-id: http://skia.googlecode.com/svn/trunk/include@9175 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/core/SkPath.h b/core/SkPath.h
index 3b5424f..7769b6f 100644
--- a/core/SkPath.h
+++ b/core/SkPath.h
@@ -246,16 +246,6 @@
*/
bool isRect(SkRect* rect) const;
- /** Returns true if the path specifies a pair of nested rectangles. If so, and if
- rect is not null, set rect[0] to the outer rectangle and rect[1] to the inner
- rectangle. If the path does not specify a pair of nested rectangles, return
- false and ignore rect.
-
- @param rect If not null, returns the path as a pair of nested rectangles
- @return true if the path describes a pair of nested rectangles
- */
- bool isNestedRects(SkRect rect[2]) const;
-
/** Return the number of points in the path
*/
int countPoints() const;
@@ -586,6 +576,19 @@
*/
bool isRect(bool* isClosed, Direction* direction) const;
+ /** Returns true if the path specifies a pair of nested rectangles. If so, and if
+ rect is not null, set rect[0] to the outer rectangle and rect[1] to the inner
+ rectangle. If so, and dirs is not null, set dirs[0] to the direction of
+ the outer rectangle and dirs[1] to the direction of the inner rectangle. If
+ the path does not specify a pair of nested rectangles, return
+ false and ignore rect and dirs.
+
+ @param rect If not null, returns the path as a pair of nested rectangles
+ @param dirs If not null, returns the direction of the rects
+ @return true if the path describes a pair of nested rectangles
+ */
+ bool isNestedRects(SkRect rect[2], Direction dirs[2] = NULL) const;
+
/**
* Add a closed rectangle contour to the path
* @param rect The rectangle to add as a closed contour to the path
diff --git a/gpu/GrAARectRenderer.h b/gpu/GrAARectRenderer.h
index 549c2ca..a19b07a 100644
--- a/gpu/GrAARectRenderer.h
+++ b/gpu/GrAARectRenderer.h
@@ -64,9 +64,16 @@
const GrRect& rect,
const SkMatrix& combinedMatrix,
const GrRect& devRect,
- const GrVec& devStrokeSize,
+ SkScalar width,
bool useVertexCoverage);
+ // First rect is outer; second rect is inner
+ void fillAANestedRects(GrGpu* gpu,
+ GrDrawTarget* target,
+ const SkRect rects[2],
+ const SkMatrix& combinedMatrix,
+ bool useVertexCoverage);
+
private:
GrIndexBuffer* fAAFillRectIndexBuffer;
GrIndexBuffer* fAAStrokeRectIndexBuffer;
@@ -95,6 +102,12 @@
const GrRect& rect,
const SkMatrix& combinedMatrix);
+ void geometryStrokeAARect(GrGpu* gpu,
+ GrDrawTarget* target,
+ const SkRect& devOutside,
+ const SkRect& devInside,
+ bool useVertexCoverage);
+
typedef GrRefCnt INHERITED;
};