diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-04-19 20:22:39 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-04-19 20:22:39 +0000 |
commit | 3cceb9f400583be4ec70da526c23fe81b68dc6ee (patch) | |
tree | 38952c34f034e396dfb37cdf725b984268b3c061 /src/core | |
parent | 8c5c7a905b708f7c0a991ca7c872af645544afef (diff) |
add SkDataTable::NewEmpty()
git-svn-id: http://skia.googlecode.com/svn/trunk@8780 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkDataTable.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/SkDataTable.cpp b/src/core/SkDataTable.cpp index fa7ff7149a..f04b2152fa 100644 --- a/src/core/SkDataTable.cpp +++ b/src/core/SkDataTable.cpp @@ -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) { |