aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2016-11-02 17:07:33 -0400
committerGravatar Ben Wagner <bungeman@google.com>2016-11-02 21:30:38 +0000
commit7ecc59610de72043e9b7ebaf1ef45c43425e54fc (patch)
tree25bdd613cc4096d02218308b6648e458737292a9 /tests
parentd5def99232f0c66de8da213fff09fa4bcaa9df4d (diff)
Remove SkAutoTDeleteArray
This class is already just an alias for std::unique_ptr<T[]>, so replace all uses with that and delete the class. CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot,Test-Ubuntu-Clang-Golo-GPU-GT610-x86_64-Debug-ASAN-Trybot Change-Id: I40668d398356a22da071ee791666c7f728b59266 Reviewed-on: https://skia-review.googlesource.com/4362 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/ClearTest.cpp2
-rw-r--r--tests/ImageTest.cpp2
-rw-r--r--tests/PathOpsSkpClipTest.cpp6
-rw-r--r--tests/ReadWriteAlphaTest.cpp4
-rw-r--r--tests/SurfaceTest.cpp8
-rw-r--r--tests/SwizzlerTest.cpp2
6 files changed, 12 insertions, 12 deletions
diff --git a/tests/ClearTest.cpp b/tests/ClearTest.cpp
index 4a6e26c86a..d83fb92b53 100644
--- a/tests/ClearTest.cpp
+++ b/tests/ClearTest.cpp
@@ -20,7 +20,7 @@ static bool check_rect(GrRenderTargetContext* rtc, const SkIRect& rect, uint32_t
GrRenderTarget* rt = rtc->accessRenderTarget();
int w = rect.width();
int h = rect.height();
- SkAutoTDeleteArray<uint32_t> pixels(new uint32_t[w * h]);
+ std::unique_ptr<uint32_t[]> pixels(new uint32_t[w * h]);
memset(pixels.get(), ~expectedValue, sizeof(uint32_t) * w * h);
rt->readPixels(rect.fLeft, rect.fTop, w, h, kRGBA_8888_GrPixelConfig, pixels.get());
for (int y = 0; y < h; ++y) {
diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp
index a0ce16fcab..58576251fe 100644
--- a/tests/ImageTest.cpp
+++ b/tests/ImageTest.cpp
@@ -799,7 +799,7 @@ struct TextureReleaseChecker {
DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SkImage_NewFromTextureRelease, reporter, ctxInfo) {
const int kWidth = 10;
const int kHeight = 10;
- SkAutoTDeleteArray<uint32_t> pixels(new uint32_t[kWidth * kHeight]);
+ std::unique_ptr<uint32_t[]> pixels(new uint32_t[kWidth * kHeight]);
GrBackendTextureDesc backendDesc;
backendDesc.fConfig = kRGBA_8888_GrPixelConfig;
backendDesc.fFlags = kRenderTarget_GrBackendTextureFlag;
diff --git a/tests/PathOpsSkpClipTest.cpp b/tests/PathOpsSkpClipTest.cpp
index 3c958f1bec..e16be4c8f3 100644
--- a/tests/PathOpsSkpClipTest.cpp
+++ b/tests/PathOpsSkpClipTest.cpp
@@ -882,8 +882,8 @@ DEF_TEST(PathOpsSkpClipUberThreaded) {
const int firstDirNo = gDirs.next();
const int lastDirNo = gDirs.last();
int dirCount = lastDirNo - firstDirNo + 1;
- SkAutoTDeleteArray<SkTDArray<TestResult> > tests(new SkTDArray<TestResult>[dirCount]);
- SkAutoTDeleteArray<SkTDArray<SortByName*> > sorted(new SkTDArray<SortByName*>[dirCount]);
+ std::unique_ptr<SkTDArray<TestResult>[]> tests(new SkTDArray<TestResult>[dirCount]);
+ std::unique_ptr<SkTDArray<SortByName*>[]> sorted(new SkTDArray<SortByName*>[dirCount]);
if (!buildTests(tests.get(), sorted.get())) {
return;
}
@@ -921,7 +921,7 @@ DEF_TEST(PathOpsSkpClipUberThreaded) {
}
testRunner.render();
- SkAutoTDeleteArray<SkTDArray<TestResult> > results(new SkTDArray<TestResult>[dirCount]);
+ std::unique_ptr<SkTDArray<TestResult>[]> results(new SkTDArray<TestResult>[dirCount]);
if (!buildTests(results.get(), nullptr)) {
return;
}
diff --git a/tests/ReadWriteAlphaTest.cpp b/tests/ReadWriteAlphaTest.cpp
index e5240666aa..228277a7fb 100644
--- a/tests/ReadWriteAlphaTest.cpp
+++ b/tests/ReadWriteAlphaTest.cpp
@@ -76,7 +76,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadWriteAlpha, reporter, ctxInfo) {
REPORTER_ASSERT_MESSAGE(reporter, result, "Initial A8 writePixels failed");
size_t nonZeroRowBytes = rowBytes ? rowBytes : X_SIZE;
- SkAutoTDeleteArray<uint8_t> readback(new uint8_t[nonZeroRowBytes * Y_SIZE]);
+ std::unique_ptr<uint8_t[]> readback(new uint8_t[nonZeroRowBytes * Y_SIZE]);
// clear readback to something non-zero so we can detect readback failures
memset(readback.get(), kClearValue, nonZeroRowBytes * Y_SIZE);
@@ -166,7 +166,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadWriteAlpha, reporter, ctxInfo) {
for (auto rowBytes : kRowBytes) {
size_t nonZeroRowBytes = rowBytes ? rowBytes : X_SIZE;
- SkAutoTDeleteArray<uint8_t> readback(new uint8_t[nonZeroRowBytes * Y_SIZE]);
+ std::unique_ptr<uint8_t[]> readback(new uint8_t[nonZeroRowBytes * Y_SIZE]);
// Clear so we don't accidentally see values from previous iteration.
memset(readback.get(), kClearValue, nonZeroRowBytes * Y_SIZE);
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index 908dc169de..9866358dff 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -709,7 +709,7 @@ static sk_sp<SkSurface> create_gpu_surface_backend_texture(
GrContext* context, int sampleCnt, uint32_t color, GrBackendObject* outTexture) {
const int kWidth = 10;
const int kHeight = 10;
- SkAutoTDeleteArray<uint32_t> pixels(new uint32_t[kWidth * kHeight]);
+ std::unique_ptr<uint32_t[]> pixels(new uint32_t[kWidth * kHeight]);
sk_memset32(pixels.get(), color, kWidth * kHeight);
GrBackendTextureDesc desc;
desc.fConfig = kRGBA_8888_GrPixelConfig;
@@ -732,7 +732,7 @@ static sk_sp<SkSurface> create_gpu_surface_backend_texture_as_render_target(
GrContext* context, int sampleCnt, uint32_t color, GrBackendObject* outTexture) {
const int kWidth = 10;
const int kHeight = 10;
- SkAutoTDeleteArray<uint32_t> pixels(new uint32_t[kWidth * kHeight]);
+ std::unique_ptr<uint32_t[]> pixels(new uint32_t[kWidth * kHeight]);
sk_memset32(pixels.get(), color, kWidth * kHeight);
GrBackendTextureDesc desc;
desc.fConfig = kRGBA_8888_GrPixelConfig;
@@ -761,7 +761,7 @@ static void test_surface_clear(skiatest::Reporter* reporter, sk_sp<SkSurface> su
}
int w = surface->width();
int h = surface->height();
- SkAutoTDeleteArray<uint32_t> pixels(new uint32_t[w * h]);
+ std::unique_ptr<uint32_t[]> pixels(new uint32_t[w * h]);
sk_memset32(pixels.get(), ~expectedValue, w * h);
SkAutoTUnref<GrSurface> grSurface(SkSafeRef(grSurfaceGetter(surface.get())));
@@ -830,7 +830,7 @@ static void test_surface_draw_partially(
paint.setColor(kRectColor);
surface->getCanvas()->drawRect(SkRect::MakeWH(SkIntToScalar(kW), SkIntToScalar(kH)/2),
paint);
- SkAutoTDeleteArray<uint32_t> pixels(new uint32_t[kW * kH]);
+ std::unique_ptr<uint32_t[]> pixels(new uint32_t[kW * kH]);
sk_memset32(pixels.get(), ~origColor, kW * kH);
// Read back RGBA to avoid format conversions that may not be supported on all platforms.
SkImageInfo readInfo = SkImageInfo::Make(kW, kH, kRGBA_8888_SkColorType, kPremul_SkAlphaType);
diff --git a/tests/SwizzlerTest.cpp b/tests/SwizzlerTest.cpp
index 1b34669f97..4626a47662 100644
--- a/tests/SwizzlerTest.cpp
+++ b/tests/SwizzlerTest.cpp
@@ -32,7 +32,7 @@ static void check_fill(skiatest::Reporter* r,
const size_t totalBytes = imageInfo.getSafeSize(rowBytes) + offset;
// Create fake image data where every byte has a value of 0
- SkAutoTDeleteArray<uint8_t> storage(new uint8_t[totalBytes]);
+ std::unique_ptr<uint8_t[]> storage(new uint8_t[totalBytes]);
memset(storage.get(), 0, totalBytes);
// Adjust the pointer in order to test on different memory alignments
uint8_t* imageData = storage.get() + offset;