OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkData.h" | 8 #include "SkData.h" |
9 #include "SkMallocPixelRef.h" | 9 #include "SkMallocPixelRef.h" |
10 #include "Test.h" | 10 #include "Test.h" |
11 #include "TestClassDef.h" | |
12 | 11 |
13 static void delete_uint8_proc(void* ptr, void*) { | 12 static void delete_uint8_proc(void* ptr, void*) { |
14 delete[] static_cast<uint8_t*>(ptr); | 13 delete[] static_cast<uint8_t*>(ptr); |
15 } | 14 } |
16 | 15 |
17 static void set_to_one_proc(void*, void* context) { | 16 static void set_to_one_proc(void*, void* context) { |
18 *(static_cast<int*>(context)) = 1; | 17 *(static_cast<int*>(context)) = 1; |
19 } | 18 } |
20 | 19 |
21 /** | 20 /** |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 REPORTER_ASSERT(reporter, dataPtr->unique()); | 105 REPORTER_ASSERT(reporter, dataPtr->unique()); |
107 SkAutoTUnref<SkMallocPixelRef> pr( | 106 SkAutoTUnref<SkMallocPixelRef> pr( |
108 SkMallocPixelRef::NewWithData(info, rowBytes, NULL, data.get(), 4)); | 107 SkMallocPixelRef::NewWithData(info, rowBytes, NULL, data.get(), 4)); |
109 REPORTER_ASSERT(reporter, !(dataPtr->unique())); | 108 REPORTER_ASSERT(reporter, !(dataPtr->unique())); |
110 data.reset(NULL); | 109 data.reset(NULL); |
111 REPORTER_ASSERT(reporter, dataPtr->unique()); | 110 REPORTER_ASSERT(reporter, dataPtr->unique()); |
112 REPORTER_ASSERT(reporter, | 111 REPORTER_ASSERT(reporter, |
113 static_cast<const void*>(dataPtr->bytes() + 4) == pr->pixels()); | 112 static_cast<const void*>(dataPtr->bytes() + 4) == pr->pixels()); |
114 } | 113 } |
115 } | 114 } |
OLD | NEW |