Correctly determine whether HW AA lines can be used
Review URL: http://codereview.appspot.com/4937049/
git-svn-id: http://skia.googlecode.com/svn/trunk@2162 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrDrawTarget.h b/gpu/src/GrDrawTarget.h
index 8196beb..f170fda 100644
--- a/gpu/src/GrDrawTarget.h
+++ b/gpu/src/GrDrawTarget.h
@@ -536,6 +536,13 @@
bool canDisableBlend() const;
/**
+ * Given the current draw state, vertex layout, and hw support, will HW AA
+ * lines be used (if line primitive type is drawn)? (Note that lines are
+ * always 1 pixel wide)
+ */
+ virtual bool willUseHWAALines() const = 0;
+
+ /**
* Sets the edge data required for edge antialiasing.
*
* @param edges 3 * 6 float values, representing the edge
@@ -1142,7 +1149,13 @@
static void VertexLayoutUnitTest();
protected:
-
+
+ // determines whether HW blending can be disabled or not
+ static bool CanDisableBlend(GrVertexLayout layout, const DrState& state);
+
+ // determines whether HW AA lines can be used or not
+ static bool CanUseHWAALines(GrVertexLayout layout, const DrState& state);
+
enum GeometrySrcType {
kNone_GeometrySrcType, //<! src has not been specified
kReserved_GeometrySrcType, //<! src was set using reserve*Space