add bytes() to SkTDArray, which returns the number of bytes in the array,

as opposed to count() which returns the number of elements.



git-svn-id: http://skia.googlecode.com/svn/trunk@2758 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2011-11-28 19:54:12 +00:00
parent 1e0e607921
commit 1271d78e8f

View File

@ -91,7 +91,17 @@ public:
}
bool isEmpty() const { return fCount == 0; }
/**
* Return the number of elements in the array
*/
int count() const { return fCount; }
/**
* return the number of bytes in the array: count * sizeof(T)
*/
size_t bytes() const { return fCount * sizeof(T); }
T* begin() const { return fArray; }
T* end() const { return fArray ? fArray + fCount : NULL; }
T& operator[](int index) const {