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

Side by Side Diff: tests/JpegTest.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/ImageTest.cpp ('k') | tests/KtxTest.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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkDecodingImageGenerator.h" 9 #include "SkDecodingImageGenerator.h"
10 #include "SkForceLinking.h" 10 #include "SkForceLinking.h"
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 #if JPEG_TEST_WRITE_TO_FILE_FOR_DEBUGGING 449 #if JPEG_TEST_WRITE_TO_FILE_FOR_DEBUGGING
450 // Check to see that the resulting bitmap is nice 450 // Check to see that the resulting bitmap is nice
451 bool writeSuccess = (!(bm8888.empty())) && SkImageEncoder::EncodeFile( 451 bool writeSuccess = (!(bm8888.empty())) && SkImageEncoder::EncodeFile(
452 "HalfOfAJpeg.png", bm8888, SkImageEncoder::kPNG_Type, 100); 452 "HalfOfAJpeg.png", bm8888, SkImageEncoder::kPNG_Type, 100);
453 SkASSERT(writeSuccess); 453 SkASSERT(writeSuccess);
454 #endif 454 #endif
455 } 455 }
456 456
457 DEF_TEST(Jpeg_YUV, reporter) { 457 DEF_TEST(Jpeg_YUV, reporter) {
458 size_t len = sizeof(goodJpegImage); 458 size_t len = sizeof(goodJpegImage);
459 SkMemoryStream* stream = SkNEW_ARGS(SkMemoryStream, (goodJpegImage, len)); 459 SkMemoryStream* stream = new SkMemoryStream(goodJpegImage, len);
460 460
461 SkBitmap bitmap; 461 SkBitmap bitmap;
462 SkDecodingImageGenerator::Options opts; 462 SkDecodingImageGenerator::Options opts;
463 bool pixelsInstalled = SkInstallDiscardablePixelRef( 463 bool pixelsInstalled = SkInstallDiscardablePixelRef(
464 SkDecodingImageGenerator::Create(stream, opts), &bitmap); 464 SkDecodingImageGenerator::Create(stream, opts), &bitmap);
465 REPORTER_ASSERT(reporter, pixelsInstalled); 465 REPORTER_ASSERT(reporter, pixelsInstalled);
466 466
467 if (!pixelsInstalled) { 467 if (!pixelsInstalled) {
468 return; 468 return;
469 } 469 }
(...skipping 20 matching lines...) Expand all
490 } 490 }
491 SkAutoMalloc storage(totalSize); 491 SkAutoMalloc storage(totalSize);
492 void* planes[3]; 492 void* planes[3];
493 planes[0] = storage.get(); 493 planes[0] = storage.get();
494 planes[1] = (uint8_t*)planes[0] + sizes[0]; 494 planes[1] = (uint8_t*)planes[0] + sizes[0];
495 planes[2] = (uint8_t*)planes[1] + sizes[1]; 495 planes[2] = (uint8_t*)planes[1] + sizes[1];
496 496
497 // Get the YUV planes 497 // Get the YUV planes
498 REPORTER_ASSERT(reporter, pixelRef->getYUV8Planes(yuvSizes, planes, rowBytes , NULL)); 498 REPORTER_ASSERT(reporter, pixelRef->getYUV8Planes(yuvSizes, planes, rowBytes , NULL));
499 } 499 }
OLDNEW
« no previous file with comments | « tests/ImageTest.cpp ('k') | tests/KtxTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698