Add getContext to GrResouce

http://codereview.appspot.com/5373106/



git-svn-id: http://skia.googlecode.com/svn/trunk@2688 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrResource.cpp b/src/gpu/GrResource.cpp
index 5d7375f..63d2e7b 100644
--- a/src/gpu/GrResource.cpp
+++ b/src/gpu/GrResource.cpp
@@ -32,3 +32,20 @@
         fGpu = NULL;
     }
 }
+
+const GrContext* GrResource::getContext() const {
+    if (NULL != fGpu) {
+        return fGpu->getContext();
+    } else {
+        return NULL;
+    }
+}
+
+GrContext* GrResource::getContext() {
+    if (NULL != fGpu) {
+        return fGpu->getContext();
+    } else {
+        return NULL;
+    }
+}
+