landing mirror of https://codereview.appspot.com/6304098/
by kondapallykalyan

fixing  compiler warnings in SkAAClip



git-svn-id: http://skia.googlecode.com/svn/trunk@4283 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkAAClip.cpp b/src/core/SkAAClip.cpp
index 86c99d8..c4b15b6 100644
--- a/src/core/SkAAClip.cpp
+++ b/src/core/SkAAClip.cpp
@@ -135,6 +135,7 @@
         fDone = true;
         fTop = fBottom = clip.fBounds.fBottom;
         fData = NULL;
+        fStopYOff = NULL;
         return;
     }
     
@@ -809,7 +810,9 @@
     for (;;) {
         int n = data[0];
         if (x < n) {
-            *initialCount = n - x;
+            if (initialCount) {
+                *initialCount = n - x;
+            }
             break;
         }
         data += 2;
@@ -831,7 +834,7 @@
     }
 #endif
 
-    int lastY;
+    int lastY SK_INIT_TO_AVOID_WARNING;
     const uint8_t* row = this->findRow(top, &lastY);
     if (lastY < bottom) {
         return false;
@@ -1835,8 +1838,7 @@
     SkASSERT(fAAClipBounds.contains(x, y));
     SkASSERT(fAAClipBounds.contains(x + width  - 1, y));
 
-    int lastY;
-    const uint8_t* row = fAAClip->findRow(y, &lastY);
+    const uint8_t* row = fAAClip->findRow(y);
     int initialCount;
     row = fAAClip->findX(row, x, &initialCount);
 
@@ -1903,8 +1905,8 @@
 
 void SkAAClipBlitter::blitAntiH(int x, int y, const SkAlpha aa[],
                                 const int16_t runs[]) {
-    int lastY;
-    const uint8_t* row = fAAClip->findRow(y, &lastY);
+
+    const uint8_t* row = fAAClip->findRow(y);
     int initialCount;
     row = fAAClip->findX(row, x, &initialCount);
 
@@ -1921,7 +1923,7 @@
     }
 
     for (;;) {
-        int lastY;
+        int lastY SK_INIT_TO_AVOID_WARNING;
         const uint8_t* row = fAAClip->findRow(y, &lastY);
         int dy = lastY - y + 1;
         if (dy > height) {
@@ -1929,8 +1931,7 @@
         }
         height -= dy;
 
-        int initialCount;
-        row = fAAClip->findX(row, x, &initialCount);
+        row = fAAClip->findX(row, x);
         SkAlpha newAlpha = SkMulDiv255Round(alpha, row[1]);
         if (newAlpha) {
             fBlitter->blitV(x, y, dy, newAlpha);
@@ -2138,7 +2139,7 @@
     const int stopY = y + clip.height();
 
     do {
-        int localStopY;
+        int localStopY SK_INIT_TO_AVOID_WARNING;
         const uint8_t* row = fAAClip->findRow(y, &localStopY);
         // findRow returns last Y, not stop, so we add 1
         localStopY = SkMin32(localStopY + 1, stopY);