Simple GPU based dithering:
If dithering is turned on, apply an effect that filters the pixel through
the following pipeline:
for each channel c:
1. Compute quantized colors [low, high] that c is between
2. Pick high by flipping a coin weighted by (c - low)
R=bsalomon@google.com, egdaniel@google.com, robertphillips@google.com
Author: krajcevski@google.com
Review URL: https://codereview.chromium.org/321253002
diff --git a/src/gpu/effects/GrDitherEffect.h b/src/gpu/effects/GrDitherEffect.h
new file mode 100644
index 0000000..63036c0
--- /dev/null
+++ b/src/gpu/effects/GrDitherEffect.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrDitherEffect_DEFINED
+#define GrDitherEffect_DEFINED
+
+#include "GrTypes.h"
+#include "GrTypesPriv.h"
+
+class GrEffectRef;
+
+namespace GrDitherEffect {
+ /**
+ * Creates an effect that dithers the resulting color to an RGBA8 framebuffer
+ */
+ GrEffectRef* Create();
+};
+
+#endif