add SkDataTable::NewEmpty()
git-svn-id: http://skia.googlecode.com/svn/trunk@8780 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
8c5c7a905b
commit
3cceb9f400
@ -64,6 +64,8 @@ public:
|
||||
return str;
|
||||
}
|
||||
|
||||
static SkDataTable* NewEmpty();
|
||||
|
||||
/**
|
||||
* Return a new DataTable that contains a copy of the data stored in each
|
||||
* "array".
|
||||
|
@ -53,6 +53,17 @@ void SkDataTable::flatten(SkFlattenableWriteBuffer& buffer) const {
|
||||
buffer.writeFlattenable(fData);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
SkDataTable* SkDataTable::NewEmpty() {
|
||||
static SkDataTable* gEmpty;
|
||||
if (NULL == gEmpty) {
|
||||
gEmpty = SkNEW_ARGS(SkDataTable, (0, SkData::NewEmpty()));
|
||||
}
|
||||
gEmpty->ref();
|
||||
return gEmpty;
|
||||
}
|
||||
|
||||
SkDataTable* SkDataTable::NewCopyArrays(const void * const * ptrs,
|
||||
const size_t sizes[], int count) {
|
||||
if (count < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user