aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/aaclip.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gm/aaclip.cpp')
-rw-r--r--gm/aaclip.cpp39
1 files changed, 1 insertions, 38 deletions
diff --git a/gm/aaclip.cpp b/gm/aaclip.cpp
index ef73614c6b..f67ac17a9f 100644
--- a/gm/aaclip.cpp
+++ b/gm/aaclip.cpp
@@ -9,43 +9,6 @@
#include "SkCanvas.h"
#include "SkPath.h"
-#if 0
-def unpremul(x,alpha):
-assert x <= alpha
-if alpha == 0:
-return 0
-else:
-return math.floor(x*MAXVAL/alpha)
-
-def premul(X,alpha):
-return math.ceil(X*alpha/MAXVAL)
-#endif
-
-static int premul(int r, int a) {
- SkASSERT(a >= 0 && a <= 255);
- SkASSERT(r >= 0 && r <= 255);
- return (int)ceil(r * a / 255.0);
-}
-
-static int unpremul(int r, int a) {
- SkASSERT(a >= 0 && a <= 255);
- SkASSERT(r >= 0 && r <= a);
- if (0 == a) {
- return 0;
- }
- return (int)floor(r * 255.0 / a);
-}
-
-static void test_premul() {
- for (int a = 0; a <= 255; ++a) {
- for (int r = 0; r <= a; ++r) {
- int tmpr = unpremul(r, a);
- int newr = premul(tmpr, a);
- SkASSERT(newr == r);
- }
- }
-}
-
static SkCanvas* MakeCanvas(const SkIRect& bounds) {
SkBitmap bm;
bm.setConfig(SkBitmap::kARGB_8888_Config, bounds.width(), bounds.height());
@@ -182,7 +145,7 @@ static void draw_rect_tests (SkCanvas* canvas) {
class AAClipGM : public GM {
public:
AAClipGM() {
- test_premul();
+
}
protected: