diff options
author | reed <reed@google.com> | 2015-06-17 09:58:24 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-17 09:58:25 -0700 |
commit | 6b7f34e34cc0ce397ce5e4ddc0c244f372b4f840 (patch) | |
tree | 8a346c19453a4a2a073153bd13723907535da8fe /tests | |
parent | 12555d7efbd1e2238e7e7a7eee6b651f304ba451 (diff) |
simplify release-proc for SkData, removing unneeded size param
request https://codereview.chromium.org/1184953005 to land first
BUG=skia:
Review URL: https://codereview.chromium.org/1193553002
Diffstat (limited to 'tests')
-rw-r--r-- | tests/DataRefTest.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/DataRefTest.cpp b/tests/DataRefTest.cpp index 981ac54fcf..9fcbeb0502 100644 --- a/tests/DataRefTest.cpp +++ b/tests/DataRefTest.cpp @@ -143,12 +143,20 @@ DEF_TEST(DataTable, reporter) { static void* gGlobal; -static void delete_int_proc(const void* ptr, size_t len, void* context) { +static void delete_int_proc(const void* ptr, void* context) { int* data = (int*)ptr; SkASSERT(context == gGlobal); delete[] data; } +#ifdef SK_SUPPORT_LEGACY_DATARELEASEPROC_PARAMS +static void legacy_delete_int_proc(const void* ptr, size_t size, void* context) { + int* data = (int*)ptr; + SkASSERT(context == gGlobal); + delete[] data; +} +#endif + static void assert_len(skiatest::Reporter* reporter, SkData* ref, size_t len) { REPORTER_ASSERT(reporter, ref->size() == len); } @@ -213,6 +221,10 @@ DEF_TEST(Data, reporter) { SkAutoTUnref<SkData> r2(SkData::NewWithProc(new int[N], N*sizeof(int), delete_int_proc, gGlobal)); SkAutoTUnref<SkData> r3(SkData::NewSubset(r1, 7, 6)); +#ifdef SK_SUPPORT_LEGACY_DATARELEASEPROC_PARAMS + SkAutoTUnref<SkData> r4(SkData::NewWithProc(new int[N], N*sizeof(int), + legacy_delete_int_proc, gGlobal)); +#endif assert_len(reporter, r0, 0); assert_len(reporter, r1, strlen(str)); |