Make all pixel ops go thru ctx so we can correctly flush. Unify two texture upload code paths. 

Review URL: http://codereview.appspot.com/5373108/



git-svn-id: http://skia.googlecode.com/svn/trunk@2701 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/texdata.cpp b/gm/texdata.cpp
index a55bdeb..d3cc83c 100644
--- a/gm/texdata.cpp
+++ b/gm/texdata.cpp
@@ -124,9 +124,9 @@
                             ((x + y) % 2) ? (i ? green : red) : blue;
                     }
                 }
-                // BUG: uploadTextureData doesn't force a flush
-                ctx->flush();
-                texture->uploadTextureData(S, i ? 0 : S, S, S, gTextureData, 4 * stride);
+                texture->writePixels(S, (i ? 0 : S), S, S,
+                                     texture->config(), gTextureData,
+                                     4 * stride);
                 ctx->drawRect(paint, GrRect::MakeWH(2*S, 2*S));
             }
         }