Reapply r1951.
git-svn-id: http://skia.googlecode.com/svn/trunk@1959 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/include/GrResource.h b/gpu/include/GrResource.h
index 8cc4d57..eee1a81 100644
--- a/gpu/include/GrResource.h
+++ b/gpu/include/GrResource.h
@@ -54,6 +54,14 @@
*/
bool isValid() const { return NULL != fGpu; }
+ /**
+ * Retrieves the size of the object in GPU memory. This is approximate since
+ * we aren't aware of additional padding or copies made by the driver.
+ *
+ * @return the size of the buffer in bytes
+ */
+ virtual size_t sizeInBytes() const = 0;
+
protected:
virtual void onRelease() = 0;