Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: tests/ImageDecodingTest.cpp

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/ImageCacheTest.cpp ('k') | tests/ImageFilterTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "Resources.h" 8 #include "Resources.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 735
736 static const uint16_t sentinal = 0xBEEF; 736 static const uint16_t sentinal = 0xBEEF;
737 static const int pixelCount = 16; 737 static const int pixelCount = 16;
738 SkAutoTMalloc<uint16_t> pixels(pixelCount + 1); 738 SkAutoTMalloc<uint16_t> pixels(pixelCount + 1);
739 // pixels.get() should be 4-byte aligned. 739 // pixels.get() should be 4-byte aligned.
740 // This is necessary to reproduce the bug. 740 // This is necessary to reproduce the bug.
741 741
742 pixels[pixelCount] = sentinal; // This value should not be changed. 742 pixels[pixelCount] = sentinal; // This value should not be changed.
743 743
744 SkAutoTUnref<SingleAllocator> allocator( 744 SkAutoTUnref<SingleAllocator> allocator(
745 SkNEW_ARGS(SingleAllocator, 745 new SingleAllocator((void*)pixels.get(), sizeof(uint16_t) * pixelCou nt));
746 ((void*)pixels.get(), sizeof(uint16_t) * pixelCount)));
747 decoder->setAllocator(allocator); 746 decoder->setAllocator(allocator);
748 decoder->setSampleSize(2); 747 decoder->setSampleSize(2);
749 SkBitmap bitmap; 748 SkBitmap bitmap;
750 bool success = decoder->decode(stream, &bitmap, kRGB_565_SkColorType, 749 bool success = decoder->decode(stream, &bitmap, kRGB_565_SkColorType,
751 SkImageDecoder::kDecodePixels_Mode) != SkImag eDecoder::kFailure; 750 SkImageDecoder::kDecodePixels_Mode) != SkImag eDecoder::kFailure;
752 REPORTER_ASSERT(r, success); 751 REPORTER_ASSERT(r, success);
753 REPORTER_ASSERT(r, !allocator->ready()); // Decoder used correct memory 752 REPORTER_ASSERT(r, !allocator->ready()); // Decoder used correct memory
754 REPORTER_ASSERT(r, sentinal == pixels[pixelCount]); 753 REPORTER_ASSERT(r, sentinal == pixels[pixelCount]);
755 } 754 }
OLDNEW
« no previous file with comments | « tests/ImageCacheTest.cpp ('k') | tests/ImageFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698