Add sizeInBytes to GrResource, make GrRenderTarget aware of its pixel config
Review URL: http://codereview.appspot.com/4802058/
git-svn-id: http://skia.googlecode.com/svn/trunk@1951 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/include/GrIndexBuffer.h b/gpu/include/GrIndexBuffer.h
index 366640e..23078c3 100644
--- a/gpu/include/GrIndexBuffer.h
+++ b/gpu/include/GrIndexBuffer.h
@@ -27,7 +27,9 @@
* from the index buffer (using kTriangles_PrimitiveType).
* @return the maximum number of quads using full size of index buffer.
*/
- int maxQuads() const { return size() / (sizeof(uint16_t) * 6); }
+ int maxQuads() const {
+ return this->sizeInBytes() / (sizeof(uint16_t) * 6);
+ }
protected:
GrIndexBuffer(GrGpu* gpu, size_t sizeInBytes, bool dynamic)
: INHERITED(gpu, sizeInBytes, dynamic) {}