aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-09 14:01:44 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-09 14:01:44 +0000
commitdf3695e5c72b3b4401e71ff259827d87bfe8a06f (patch)
treedf996b69d83f3847a1f8a835fd14ec6c0c8c81ac /include
parent62f60bb1d419ac17df5c41162c0d50b7610c4ddf (diff)
First pass at Rect Effect
Diffstat (limited to 'include')
-rw-r--r--include/core/SkMatrix.h6
-rw-r--r--include/gpu/GrAARectRenderer.h10
2 files changed, 15 insertions, 1 deletions
diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h
index 87599d4cfb..f148e390b5 100644
--- a/include/core/SkMatrix.h
+++ b/include/core/SkMatrix.h
@@ -90,6 +90,12 @@ public:
*/
bool isSimilarity(SkScalar tol = SK_ScalarNearlyZero) const;
+ /** Returns true if the matrix contains only translation, rotation or scale
+ (non-uniform scale is allowed).
+ Returns false if other transformation types are included or is degenerate
+ */
+ bool preservesRightAngles(SkScalar tol = SK_ScalarNearlyZero) const;
+
enum {
kMScaleX,
kMSkewX,
diff --git a/include/gpu/GrAARectRenderer.h b/include/gpu/GrAARectRenderer.h
index 0cf7faac05..84dd52fe94 100644
--- a/include/gpu/GrAARectRenderer.h
+++ b/include/gpu/GrAARectRenderer.h
@@ -15,6 +15,7 @@
class GrGpu;
class GrDrawTarget;
class GrIndexBuffer;
+class SkMatrix;
/*
* This class wraps helper functions that draw AA rects (filled & stroked)
@@ -35,7 +36,7 @@ public:
}
// TODO: potentialy fuse the fill & stroke methods and differentiate
- // btween them by passing in strokeWidth (<0 means fill).
+ // between them by passing in strokeWidth (<0 means fill).
// TODO: Remove the useVertexCoverage boolean. Just use it all the time
// since we now have a coverage vertex attribute
@@ -44,6 +45,13 @@ public:
const GrRect& devRect,
bool useVertexCoverage);
+ void shaderFillAARect(GrGpu* gpu,
+ GrDrawTarget* target,
+ const GrRect& rect,
+ const SkMatrix& combinedMatrix,
+ const GrRect& devRect,
+ bool useVertexCoverage);
+
void strokeAARect(GrGpu* gpu,
GrDrawTarget* target,
const GrRect& devRect,