check for gl-canvas before calling GL
authorreed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 25 Jan 2010 22:09:16 +0000 (22:09 +0000)
committerreed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 25 Jan 2010 22:09:16 +0000 (22:09 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@480 2bbb7eff-a529-9590-31e7-b0007b416f81

samplecode/SampleTestGL.cpp

index 04e47b6b3e95d2474dd920a73f6e061792495640..c5938baabe0b63ab924ff8d2460939dd1dec32f0 100644 (file)
@@ -202,9 +202,11 @@ protected:
     
     virtual void onDraw(SkCanvas* canvas) {
         drawBG(canvas);
-        
-        test_glshader(canvas);
-        return;
+
+        if (canvas->getViewport(NULL)) {
+            test_glshader(canvas);
+            return;
+        }
         
         SkRect r;
         r.set(0, 0, 100, 100);