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>
This commit is contained in:
Ben Wagner 2016-11-02 17:07:33 -04:00
parent d5def99232
commit 7ecc59610d
34 changed files with 47 additions and 52 deletions

View File

@ -145,7 +145,7 @@ private:
bool fShuffle;
SkString fName;
sk_sp<SkImage> fImages[kImagesToDraw];
SkAutoTDeleteArray<int> fIndices;
std::unique_ptr<int[]> fIndices;
size_t fOldBytes;
int fOldCount;

View File

@ -170,7 +170,7 @@ protected:
};
static_assert(SK_ARRAY_COUNT(gSizes) == SK_ARRAY_COUNT(gPoints), "array_mismatch");
SkAutoTDeleteArray<SkPoint> data(nullptr);
std::unique_ptr<SkPoint[]> data(nullptr);
const SkPoint* points;
int numPts;
if (index < (int) SK_ARRAY_COUNT(gPoints)) {

View File

@ -72,9 +72,9 @@ DEF_SIMPLE_GM(image_to_yuv_planes, canvas, 120, 525) {
for (int i = 0; i < 3; ++i) {
realRowBytes[i] = kRowBytes[s][i] ? kRowBytes[s][i] : kSizes[s][i].fWidth;
}
SkAutoTDeleteArray<uint8_t> yPlane(new uint8_t[realRowBytes[0] * sizes[0].fHeight]);
SkAutoTDeleteArray<uint8_t> uPlane(new uint8_t[realRowBytes[1] * sizes[1].fHeight]);
SkAutoTDeleteArray<uint8_t> vPlane(new uint8_t[realRowBytes[2] * sizes[2].fHeight]);
std::unique_ptr<uint8_t[]> yPlane(new uint8_t[realRowBytes[0] * sizes[0].fHeight]);
std::unique_ptr<uint8_t[]> uPlane(new uint8_t[realRowBytes[1] * sizes[1].fHeight]);
std::unique_ptr<uint8_t[]> vPlane(new uint8_t[realRowBytes[2] * sizes[2].fHeight]);
void *planes[3] = {yPlane.get(), uPlane.get(), vPlane.get()};

View File

@ -103,11 +103,6 @@ public:
#endif
};
template <typename T> class SkAutoTDeleteArray : public std::unique_ptr<T[]> {
public:
SkAutoTDeleteArray(T array[]) : std::unique_ptr<T[]>(array) {}
};
/** Allocate an array of T elements, and free the array in the destructor
*/
template <typename T> class SkAutoTArray : SkNoncopyable {

View File

@ -111,7 +111,7 @@ bool SkBmpCodec::ReadHeader(SkStream* stream, bool inIco, SkCodec** codecOut) {
// Bmps embedded in Icos skip the first Bmp header
if (!inIco) {
// Read the first header and the size of the second header
SkAutoTDeleteArray<uint8_t> hBuffer(new uint8_t[kBmpHeaderBytesPlusFour]);
std::unique_ptr<uint8_t[]> hBuffer(new uint8_t[kBmpHeaderBytesPlusFour]);
if (stream->read(hBuffer.get(), kBmpHeaderBytesPlusFour) !=
kBmpHeaderBytesPlusFour) {
SkCodecPrintf("Error: unable to read first bitmap header.\n");
@ -145,7 +145,7 @@ bool SkBmpCodec::ReadHeader(SkStream* stream, bool inIco, SkCodec** codecOut) {
offset = 0;
// Read the size of the second header
SkAutoTDeleteArray<uint8_t> hBuffer(new uint8_t[4]);
std::unique_ptr<uint8_t[]> hBuffer(new uint8_t[4]);
if (stream->read(hBuffer.get(), 4) != 4) {
SkCodecPrintf("Error: unable to read size of second bitmap header.\n");
return false;
@ -161,7 +161,7 @@ bool SkBmpCodec::ReadHeader(SkStream* stream, bool inIco, SkCodec** codecOut) {
const uint32_t infoBytesRemaining = infoBytes - 4;
// Read the second header
SkAutoTDeleteArray<uint8_t> iBuffer(new uint8_t[infoBytesRemaining]);
std::unique_ptr<uint8_t[]> iBuffer(new uint8_t[infoBytesRemaining]);
if (stream->read(iBuffer.get(), infoBytesRemaining) != infoBytesRemaining) {
SkCodecPrintf("Error: unable to read second bitmap header.\n");
return false;
@ -320,7 +320,7 @@ bool SkBmpCodec::ReadHeader(SkStream* stream, bool inIco, SkCodec** codecOut) {
switch (headerType) {
case kInfoV1_BmpHeaderType: {
// The V1 header stores the bit masks after the header
SkAutoTDeleteArray<uint8_t> mBuffer(new uint8_t[kBmpMaskBytes]);
std::unique_ptr<uint8_t[]> mBuffer(new uint8_t[kBmpMaskBytes]);
if (stream->read(mBuffer.get(), kBmpMaskBytes) !=
kBmpMaskBytes) {
SkCodecPrintf("Error: unable to read bit inputMasks.\n");

View File

@ -54,7 +54,7 @@ private:
SkAutoTDelete<SkMasks> fMasks; // owned
SkAutoTDelete<SkMaskSwizzler> fMaskSwizzler;
SkAutoTDeleteArray<uint8_t> fSrcBuffer;
std::unique_ptr<uint8_t[]> fSrcBuffer;
typedef SkBmpCodec INHERITED;
};

View File

@ -89,7 +89,7 @@ SkCodec::Result SkBmpRLECodec::onGetPixels(const SkImageInfo& dstInfo,
// Read the color table from the stream
colorBytes = numColorsToRead * fBytesPerColor;
SkAutoTDeleteArray<uint8_t> cBuffer(new uint8_t[colorBytes]);
std::unique_ptr<uint8_t[]> cBuffer(new uint8_t[colorBytes]);
if (stream()->read(cBuffer.get(), colorBytes) != colorBytes) {
SkCodecPrintf("Error: unable to read color table.\n");
return false;

View File

@ -99,7 +99,7 @@ private:
const uint32_t fNumColors;
const uint32_t fBytesPerColor;
const uint32_t fOffset;
SkAutoTDeleteArray<uint8_t> fStreamBuffer;
std::unique_ptr<uint8_t[]> fStreamBuffer;
size_t fRLEBytes;
const size_t fOrigRLEBytes;
uint32_t fCurrRLEByte;

View File

@ -88,7 +88,7 @@ SkCodec::Result SkBmpStandardCodec::onGetPixels(const SkImageInfo& dstInfo,
// Read the color table from the stream
colorBytes = numColorsToRead * fBytesPerColor;
SkAutoTDeleteArray<uint8_t> cBuffer(new uint8_t[colorBytes]);
std::unique_ptr<uint8_t[]> cBuffer(new uint8_t[colorBytes]);
if (stream()->read(cBuffer.get(), colorBytes) != colorBytes) {
SkCodecPrintf("Error: unable to read color table.\n");
return false;

View File

@ -90,7 +90,7 @@ private:
const uint32_t fBytesPerColor;
const uint32_t fOffset;
SkAutoTDelete<SkSwizzler> fSwizzler;
SkAutoTDeleteArray<uint8_t> fSrcBuffer;
std::unique_ptr<uint8_t[]> fSrcBuffer;
const bool fIsOpaque;
const bool fInIco;
const size_t fAndMaskRowBytes; // only used for fInIco decodes

View File

@ -40,7 +40,7 @@ SkCodec* SkIcoCodec::NewFromStream(SkStream* stream) {
static const uint32_t kIcoDirEntryBytes = 16;
// Read the directory header
SkAutoTDeleteArray<uint8_t> dirBuffer(new uint8_t[kIcoDirectoryBytes]);
std::unique_ptr<uint8_t[]> dirBuffer(new uint8_t[kIcoDirectoryBytes]);
if (inputStream.get()->read(dirBuffer.get(), kIcoDirectoryBytes) !=
kIcoDirectoryBytes) {
SkCodecPrintf("Error: unable to read ico directory header.\n");
@ -55,7 +55,7 @@ SkCodec* SkIcoCodec::NewFromStream(SkStream* stream) {
}
// Ensure that we can read all of indicated directory entries
SkAutoTDeleteArray<uint8_t> entryBuffer(new uint8_t[numImages * kIcoDirEntryBytes]);
std::unique_ptr<uint8_t[]> entryBuffer(new uint8_t[numImages * kIcoDirEntryBytes]);
if (inputStream.get()->read(entryBuffer.get(), numImages*kIcoDirEntryBytes) !=
numImages*kIcoDirEntryBytes) {
SkCodecPrintf("Error: unable to read ico directory entries.\n");
@ -69,7 +69,7 @@ SkCodec* SkIcoCodec::NewFromStream(SkStream* stream) {
uint32_t offset;
uint32_t size;
};
SkAutoTDeleteArray<Entry> directoryEntries(new Entry[numImages]);
std::unique_ptr<Entry[]> directoryEntries(new Entry[numImages]);
// Iterate over directory entries
for (uint32_t i = 0; i < numImages; i++) {

View File

@ -310,7 +310,7 @@ static GrTexture* create_profile_texture(GrTextureProvider* textureProvider, con
texDesc.fHeight = 1;
texDesc.fConfig = kAlpha_8_GrPixelConfig;
SkAutoTDeleteArray<uint8_t> profile(nullptr);
std::unique_ptr<uint8_t[]> profile(nullptr);
if (useHalfPlaneApprox) {
profile.reset(create_half_plane_profile(kProfileTextureWidth));
} else {

View File

@ -769,7 +769,7 @@ bool SkBlurMask::BlurRect(SkScalar sigma, SkMask *dst,
return true;
}
SkAutoTDeleteArray<uint8_t> profile(ComputeBlurProfile(sigma));
std::unique_ptr<uint8_t[]> profile(ComputeBlurProfile(sigma));
size_t dstSize = dst->computeImageSize();
if (0 == dstSize) {

View File

@ -959,7 +959,7 @@ GrTexture* GrRectBlurEffect::CreateBlurProfileTexture(GrTextureProvider* texture
GrTexture *blurProfile = textureProvider->findAndRefTextureByUniqueKey(key);
if (!blurProfile) {
SkAutoTDeleteArray<uint8_t> profile(SkBlurMask::ComputeBlurProfile(sigma));
std::unique_ptr<uint8_t[]> profile(SkBlurMask::ComputeBlurProfile(sigma));
blurProfile = textureProvider->createTexture(texDesc, SkBudgeted::kYes, profile.get(), 0);
if (blurProfile) {

View File

@ -82,8 +82,8 @@ sk_sp<SkSpecialImage> SkMergeImageFilter::onFilterImage(SkSpecialImage* source,
SkIRect bounds;
bounds.setEmpty();
SkAutoTDeleteArray<sk_sp<SkSpecialImage>> inputs(new sk_sp<SkSpecialImage>[inputCount]);
SkAutoTDeleteArray<SkIPoint> offsets(new SkIPoint[inputCount]);
std::unique_ptr<sk_sp<SkSpecialImage>[]> inputs(new sk_sp<SkSpecialImage>[inputCount]);
std::unique_ptr<SkIPoint[]> offsets(new SkIPoint[inputCount]);
// Filter all of the inputs.
for (int i = 0; i < inputCount; ++i) {

View File

@ -1699,7 +1699,7 @@ Poly* path_to_polys(const SkPath& path, SkScalar tolerance, const SkRect& clipBo
if (SkPath::IsInverseFillType(fillType)) {
contourCnt++;
}
SkAutoTDeleteArray<Vertex*> contours(new Vertex* [contourCnt]);
std::unique_ptr<Vertex*[]> contours(new Vertex* [contourCnt]);
path_to_contours(path, tolerance, clipBounds, contours.get(), alloc, isLinear);
return contours_to_polys(contours.get(), contourCnt, path.getFillType(), path.getBounds(),

View File

@ -253,7 +253,7 @@ void TestStyle(SkRandom* random, GrStyle* style) {
sk_sp<SkPathEffect> pe;
if (random->nextBool()) {
int cnt = random->nextRangeU(1, 50) * 2;
SkAutoTDeleteArray<SkScalar> intervals(new SkScalar[cnt]);
std::unique_ptr<SkScalar[]> intervals(new SkScalar[cnt]);
SkScalar sum = 0;
for (int i = 0; i < cnt; i++) {
intervals[i] = random->nextRangeScalar(SkDoubleToScalar(0.01),

View File

@ -1605,7 +1605,7 @@ void SkGpuDevice::drawVertices(const SkDraw& draw, SkCanvas::VertexMode vmode,
//number of indices for lines per triangle with kLines
indexCount = triangleCount * 6;
SkAutoTDeleteArray<uint16_t> lineIndices(new uint16_t[indexCount]);
std::unique_ptr<uint16_t[]> lineIndices(new uint16_t[indexCount]);
int i = 0;
while (vertProc(&state)) {
lineIndices[i] = state.f0;

View File

@ -391,7 +391,7 @@ GrTexture* GrGenerateMipMapsAndUploadToTexture(GrContext* ctx, const SkBitmap& b
const bool isMipMapped = mipLevelCount > 1;
desc.fIsMipMapped = isMipMapped;
SkAutoTDeleteArray<GrMipLevel> texels(new GrMipLevel[mipLevelCount]);
std::unique_ptr<GrMipLevel[]> texels(new GrMipLevel[mipLevelCount]);
texels[0].fPixels = pixmap.addr();
texels[0].fRowBytes = pixmap.rowBytes();

View File

@ -241,7 +241,7 @@ sk_sp<GrFragmentProcessor> GrMatrixConvolutionEffect::TestCreate(GrProcessorTest
int width = d->fRandom->nextRangeU(1, MAX_KERNEL_SIZE);
int height = d->fRandom->nextRangeU(1, MAX_KERNEL_SIZE / width);
SkISize kernelSize = SkISize::Make(width, height);
SkAutoTDeleteArray<SkScalar> kernel(new SkScalar[width * height]);
std::unique_ptr<SkScalar[]> kernel(new SkScalar[width * height]);
for (int i = 0; i < width * height; i++) {
kernel.get()[i] = d->fRandom->nextSScalar1();
}

View File

@ -2484,7 +2484,7 @@ bool GrGLGpu::onReadPixels(GrSurface* surface,
}
if (kAlpha_8_GrPixelConfig == config &&
this->readPixelsSupported(renderTarget, tempConfig)) {
SkAutoTDeleteArray<uint32_t> temp(new uint32_t[width * height * 4]);
std::unique_ptr<uint32_t[]> temp(new uint32_t[width * height * 4]);
if (this->onReadPixels(renderTarget, left, top, width, height, tempConfig, temp.get(),
width*4)) {
uint8_t* dst = reinterpret_cast<uint8_t*>(buffer);

View File

@ -180,7 +180,7 @@ void GrVkDescriptorSetManager::DescriptorPoolManager::init(GrVkGpu* gpu,
numSamplers = (uint32_t)visibilities->count();
}
SkAutoTDeleteArray<VkDescriptorSetLayoutBinding> dsSamplerBindings(
std::unique_ptr<VkDescriptorSetLayoutBinding[]> dsSamplerBindings(
new VkDescriptorSetLayoutBinding[numSamplers]);
for (uint32_t i = 0; i < numSamplers; ++i) {
uint32_t visibility;

View File

@ -682,7 +682,7 @@ sk_sp<SkImage> SkImage::MakeFromDeferredTextureImageData(GrContext* context, con
dti->fMipMapLevelData[0].fRowBytes, colorTable.get());
return SkImage::MakeTextureFromPixmap(context, pixmap, budgeted);
} else {
SkAutoTDeleteArray<GrMipLevel> texels(new GrMipLevel[mipLevelCount]);
std::unique_ptr<GrMipLevel[]> texels(new GrMipLevel[mipLevelCount]);
for (int i = 0; i < mipLevelCount; i++) {
texels[i].fPixels = dti->fMipMapLevelData[i].fPixelData;
texels[i].fRowBytes = dti->fMipMapLevelData[i].fRowBytes;

View File

@ -363,7 +363,7 @@ static void populate_glyph_to_unicode(HDC fontHdc, const unsigned glyphCount,
return;
}
SkAutoTDeleteArray<BYTE> glyphSetBuffer(new BYTE[glyphSetBufferSize]);
std::unique_ptr<BYTE[]> glyphSetBuffer(new BYTE[glyphSetBufferSize]);
GLYPHSET* glyphSet =
reinterpret_cast<LPGLYPHSET>(glyphSetBuffer.get());
if (GetFontUnicodeRanges(fontHdc, glyphSet) != glyphSetBufferSize) {

View File

@ -168,7 +168,7 @@ SkOTUtils::LocalizedStrings_NameTable::CreateForFamilyNames(const SkTypeface& ty
if (0 == nameTableSize) {
return nullptr;
}
SkAutoTDeleteArray<uint8_t> nameTableData(new uint8_t[nameTableSize]);
std::unique_ptr<uint8_t[]> nameTableData(new uint8_t[nameTableSize]);
size_t copied = typeface.getTableData(nameTag, 0, nameTableSize, nameTableData.get());
if (copied != nameTableSize) {
return nullptr;

View File

@ -61,7 +61,7 @@ struct SkOTUtils {
SkOTTableName::Record::NameID::Predefined::Value* fTypes;
int fTypesCount;
int fTypesIndex;
SkAutoTDeleteArray<SkOTTableName> fNameTableData;
std::unique_ptr<SkOTTableName[]> fNameTableData;
SkOTTableName::Iterator fFamilyNameIter;
};

View File

@ -96,7 +96,7 @@
int index = 0, count = 0;
SkOSMenu::FindListItemCount(*item->getEvent(), &count);
NSMutableArray* optionstrs = [[NSMutableArray alloc] initWithCapacity:count];
SkAutoTDeleteArray<SkString> ada(new SkString[count]);
std::unique_ptr<SkString[]> ada(new SkString[count]);
SkString* options = ada.get();
SkOSMenu::FindListItems(*item->getEvent(), options);
for (int i = 0; i < count; ++i)

View File

@ -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) {

View File

@ -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;

View File

@ -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;
}

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -457,7 +457,7 @@ SkBitmap slow_blur(const SkBitmap& src, float sigma) {
dst.allocN32Pixels(src.width(), src.height(), true);
int wh;
SkAutoTDeleteArray<float> kernel(create_2d_kernel(sigma, &wh));
std::unique_ptr<float[]> kernel(create_2d_kernel(sigma, &wh));
for (int y = 0; y < src.height(); ++y) {
for (int x = 0; x < src.width(); ++x) {