From 1eadb955be555e2360fbe9ca94e603949a8938fa Mon Sep 17 00:00:00 2001 From: "reed@android.com" Date: Mon, 25 Jan 2010 22:09:16 +0000 Subject: [PATCH] check for gl-canvas before calling GL git-svn-id: http://skia.googlecode.com/svn/trunk@480 2bbb7eff-a529-9590-31e7-b0007b416f81 --- samplecode/SampleTestGL.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/samplecode/SampleTestGL.cpp b/samplecode/SampleTestGL.cpp index 04e47b6b3e..c5938baabe 100644 --- a/samplecode/SampleTestGL.cpp +++ b/samplecode/SampleTestGL.cpp @@ -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);