Towards issue #106

Adds notion of texture multiple stages but currently just uses 1.


git-svn-id: http://skia.googlecode.com/svn/trunk@694 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrInOrderDrawBuffer.cpp b/gpu/src/GrInOrderDrawBuffer.cpp
index 952ba83..494f227 100644
--- a/gpu/src/GrInOrderDrawBuffer.cpp
+++ b/gpu/src/GrInOrderDrawBuffer.cpp
@@ -156,9 +156,11 @@
     GrAssert(!fReservedGeometry.fLocked);
     uint32_t numStates = fStates.count();
     for (uint32_t i = 0; i < numStates; ++i) {
-        GrTexture* tex = accessSavedDrawState(fStates[i]).fTexture;
-        if (NULL != tex) {
-            tex->unref();
+        for (int s = 0; s < kNumStages; ++s) {
+            GrTexture* tex = accessSavedDrawState(fStates[i]).fTextures[s];
+            if (NULL != tex) {
+                tex->unref();
+            }
         }
     }
     fDraws.reset();
@@ -320,8 +322,10 @@
         newState = old != fCurrDrawState;
     }
     if (newState) {
-        if (NULL != fCurrDrawState.fTexture) {
-            fCurrDrawState.fTexture->ref();
+        for (int s = 0; s < kNumStages; ++s) {
+            if (NULL != fCurrDrawState.fTextures[s]) {
+                fCurrDrawState.fTextures[s]->ref();
+            }
         }
         saveCurrentDrawState(&fStates.push_back());
     }