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

Side by Side Diff: tests/SkpSkGrTest.cpp

Issue 1018953003: Add SkEncodedFormat, used by SkCodec. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use a common enum for SkImageEncoder and SkImageDecoder and SkCodec Created 5 years, 9 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
OLDNEW
1 #include "SkTypes.h"
2
1 #if !SK_SUPPORT_GPU 3 #if !SK_SUPPORT_GPU
2 #error "GPU support required" 4 #error "GPU support required"
3 #endif 5 #endif
4 6
5 #include "GrContext.h" 7 #include "GrContext.h"
6 #include "GrContextFactory.h" 8 #include "GrContextFactory.h"
7 #include "GrRenderTarget.h" 9 #include "GrRenderTarget.h"
8 #include "SkGpuDevice.h" 10 #include "SkGpuDevice.h"
9 #include "gl/GrGLDefines.h" 11 #include "gl/GrGLDefines.h"
10 12
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 } 362 }
361 pic->draw(canvas); 363 pic->draw(canvas);
362 if (scale != 1) { 364 if (scale != 1) {
363 canvas->restore(); 365 canvas->restore();
364 } 366 }
365 } 367 }
366 368
367 static void writePict(const SkBitmap& bitmap, const char* outDir, const char* pn gName) { 369 static void writePict(const SkBitmap& bitmap, const char* outDir, const char* pn gName) {
368 SkString outFile = make_filepath(0, outDir, pngName); 370 SkString outFile = make_filepath(0, outDir, pngName);
369 if (!SkImageEncoder::EncodeFile(outFile.c_str(), bitmap, 371 if (!SkImageEncoder::EncodeFile(outFile.c_str(), bitmap,
370 SkImageEncoder::kPNG_Type, 100)) { 372 kPNG_SkEncodedFormat, 100)) {
371 SkDebugf("unable to encode gr %s (width=%d height=%d)br \n", pngName, 373 SkDebugf("unable to encode gr %s (width=%d height=%d)br \n", pngName,
372 bitmap.width(), bitmap.height()); 374 bitmap.width(), bitmap.height());
373 } 375 }
374 } 376 }
375 377
376 void TestResult::testOne() { 378 void TestResult::testOne() {
377 SkPicture* pic = NULL; 379 SkPicture* pic = NULL;
378 { 380 {
379 SkString d; 381 SkString d;
380 d.printf(" {%d, \"%s\"},", fDirNo, fFilename); 382 d.printf(" {%d, \"%s\"},", fDirNo, fFilename);
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 int testIndex = 166; 745 int testIndex = 166;
744 int dirIndex = skipOverSkGr[testIndex - 166].directory; 746 int dirIndex = skipOverSkGr[testIndex - 166].directory;
745 SkString pictDir = make_in_dir_name(dirIndex); 747 SkString pictDir = make_in_dir_name(dirIndex);
746 if (pictDir.size() == 0) { 748 if (pictDir.size() == 0) {
747 return; 749 return;
748 } 750 }
749 SkString filename(skipOverSkGr[testIndex - 166].filename); 751 SkString filename(skipOverSkGr[testIndex - 166].filename);
750 TestResult::Test(dirIndex, filename.c_str(), kCompareBits, reporter->verbose ()); 752 TestResult::Test(dirIndex, filename.c_str(), kCompareBits, reporter->verbose ());
751 TestResult::Test(dirIndex, filename.c_str(), kEncodeFiles, reporter->verbose ()); 753 TestResult::Test(dirIndex, filename.c_str(), kEncodeFiles, reporter->verbose ());
752 } 754 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698