aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-01-12 12:06:06 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-12 19:31:03 +0000
commit7cdabedc8b73b70e4aa70c5621a4bdc8e00ede44 (patch)
tree3068170ce9076b048fc322546be948a6f2eb9381 /include
parent1001f843a45e95f6df1d44242b6b06c77898e870 (diff)
Use GrOvalOpFactory ops to draw non-AA rrects, ovals, and arcs.
This improves performance. Bug: skia: Change-Id: Ie01170ec084be66ea166b2baffcdb415583aa523 Reviewed-on: https://skia-review.googlesource.com/93321 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/private/GrTypesPriv.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/private/GrTypesPriv.h b/include/private/GrTypesPriv.h
index cfcbff9af9..a379135532 100644
--- a/include/private/GrTypesPriv.h
+++ b/include/private/GrTypesPriv.h
@@ -9,11 +9,12 @@
#define GrTypesPriv_DEFINED
#include <chrono>
+#include "GrSharedEnums.h"
#include "GrTypes.h"
#include "SkRefCnt.h"
-#include "GrSharedEnums.h"
class GrCaps;
+class GrPaint;
// The old libstdc++ uses the draft name "monotonic_clock" rather than "steady_clock". This might
// not actually be monotonic, depending on how libstdc++ was built. However, this is only currently
@@ -87,7 +88,18 @@ enum class GrFSAAType {
*/
enum class GrAllowMixedSamples : bool { kNo = false, kYes = true };
-GrAAType GrChooseAAType(GrAA, GrFSAAType, GrAllowMixedSamples, const GrCaps&);
+/**
+ * We have code paths for some shapes that can draw non-AA using boolean fragment shader coverage.
+ * However, it may not be desirable to use this if it will trigger a dst copy. If the caller
+ * of GrChooseAAType passes GrAllowNonAABinaryCoverage::kYes and GrAA::kNo then GrChooseAAType will
+ * consider whether it is efficient to use coverage to implement a non-AA draw and if so return
+ * will GrAAType::kCoverage. If GrAA::kYes is passed then this value is ignored.
+ */
+enum class GrAllowNonAABinaryCoverage : bool { kNo = false, kYes = true };
+
+/** GrPaint is only required if GrAllowNonAABinaryCoverage and GrAA are both kYes. */
+GrAAType GrChooseAAType(GrAA, GrFSAAType, GrAllowMixedSamples, GrAllowNonAABinaryCoverage,
+ const GrPaint*, const GrCaps&);
/**
* Some pixel configs are inherently clamped to [0,1], while others can hold values outside of that