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:
parent
1e0e607921
commit
1271d78e8f
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user