Fix ref leak on GrGpu.

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



git-svn-id: http://skia.googlecode.com/svn/trunk@1015 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 0cc85fe..c71326b 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -342,6 +342,13 @@
 
 #if defined(SK_SUPPORT_GL)
     if (attachGL()) {
+#if 0
+        if (NULL != fGrContext) {
+            GrAssert(1 == fGrContext->refcnt());
+            fGrContext->unref();
+            fGrContext = NULL;
+        }
+#endif
         if (NULL == fGrContext) {
         #if defined(SK_USE_SHADERS)
             fGrContext = GrContext::Create(GrGpu::kOpenGL_Shaders_Engine, NULL);
@@ -490,14 +497,14 @@
         m.mapXY(cx, cy, &center);
         cx = center.fX;
         cy = center.fY;
-        
+
         m.setTranslate(-cx, -cy);
         m.postScale(fZoomScale, fZoomScale);
         m.postTranslate(cx, cy);
-        
+
         canvas->concat(m);
     }
-    
+
     // Apply any gesture matrix
     if (true) {
         const SkMatrix& localM = fGesture.localM();
@@ -506,12 +513,12 @@
         }
         canvas->concat(localM);
         canvas->concat(fGesture.globalM());
-        
+
         if (fGesture.isActive()) {
             this->inval(NULL);
         }
     }
-    
+
     if (fNClip) {
         this->INHERITED::draw(canvas);
         SkBitmap orig = capture_bitmap(canvas);
@@ -684,7 +691,7 @@
                                                   bitmap.width(), bitmap.height(),
                                                   false, false);
                 fGpuCanvas->setDevice(device)->unref();
-                
+
                 fGpuCanvas->concat(canvas->getTotalMatrix());
                 canvas = fGpuCanvas;