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

Side by Side Diff: tests/SkpSkGrTest.cpp

Issue 1733863003: Fix bug in SkGifCodec / Switch SkImageDec tests to use Codec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Gif bug fix! Created 4 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
« no previous file with comments | « tests/PathOpsSkpClipTest.cpp ('k') | no next file » | 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 "GrContext.h" 8 #include "GrContext.h"
9 #include "GrContextFactory.h" 9 #include "GrContextFactory.h"
10 #include "GrRenderTarget.h" 10 #include "GrRenderTarget.h"
11 #include "SkGpuDevice.h" 11 #include "SkGpuDevice.h"
12 #include "gl/GrGLDefines.h" 12 #include "gl/GrGLDefines.h"
13 13
14 #include "SkBitmap.h" 14 #include "SkBitmap.h"
15 #include "SkCanvas.h" 15 #include "SkCanvas.h"
16 #include "SkColor.h" 16 #include "SkColor.h"
17 #include "SkDevice.h" 17 #include "SkDevice.h"
18 #include "SkGraphics.h" 18 #include "SkGraphics.h"
19 #include "SkImageDecoder.h"
20 #include "SkImageEncoder.h" 19 #include "SkImageEncoder.h"
21 #include "SkOSFile.h" 20 #include "SkOSFile.h"
22 #include "SkPicture.h" 21 #include "SkPicture.h"
23 #include "SkRTConf.h" 22 #include "SkRTConf.h"
24 #include "SkStream.h" 23 #include "SkStream.h"
25 #include "SkString.h" 24 #include "SkString.h"
26 #include "SkTArray.h" 25 #include "SkTArray.h"
27 #include "SkTDArray.h" 26 #include "SkTDArray.h"
28 #include "SkTaskGroup.h" 27 #include "SkTaskGroup.h"
29 #include "SkTime.h" 28 #include "SkTime.h"
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 size_t length = stream.getLength(); 392 size_t length = stream.getLength();
394 SkTArray<char, true> bytes; 393 SkTArray<char, true> bytes;
395 bytes.push_back_n(length); 394 bytes.push_back_n(length);
396 stream.read(&bytes[0], length); 395 stream.read(&bytes[0], length);
397 stream.rewind(); 396 stream.rewind();
398 SkString wPath = make_filepath(0, outSkpDir, fFilename); 397 SkString wPath = make_filepath(0, outSkpDir, fFilename);
399 SkFILEWStream wStream(wPath.c_str()); 398 SkFILEWStream wStream(wPath.c_str());
400 wStream.write(&bytes[0], length); 399 wStream.write(&bytes[0], length);
401 wStream.flush(); 400 wStream.flush();
402 } 401 }
403 pic = SkPicture::CreateFromStream(&stream, &SkImageDecoder::DecodeMemory ); 402 pic = SkPicture::CreateFromStream(&stream);
404 if (!pic) { 403 if (!pic) {
405 SkDebugf("unable to decode %s\n", fFilename); 404 SkDebugf("unable to decode %s\n", fFilename);
406 goto finish; 405 goto finish;
407 } 406 }
408 int pWidth = pic->width(); 407 int pWidth = pic->width();
409 int pHeight = pic->height(); 408 int pHeight = pic->height();
410 int pLargerWH = SkTMax(pWidth, pHeight); 409 int pLargerWH = SkTMax(pWidth, pHeight);
411 GrContextFactory contextFactory; 410 GrContextFactory contextFactory;
412 #ifdef SK_BUILD_FOR_WIN 411 #ifdef SK_BUILD_FOR_WIN
413 GrContext* context = contextFactory.get(kAngle); 412 GrContext* context = contextFactory.get(kAngle);
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 int testIndex = 166; 747 int testIndex = 166;
749 int dirIndex = skipOverSkGr[testIndex - 166].directory; 748 int dirIndex = skipOverSkGr[testIndex - 166].directory;
750 SkString pictDir = make_in_dir_name(dirIndex); 749 SkString pictDir = make_in_dir_name(dirIndex);
751 if (pictDir.size() == 0) { 750 if (pictDir.size() == 0) {
752 return; 751 return;
753 } 752 }
754 SkString filename(skipOverSkGr[testIndex - 166].filename); 753 SkString filename(skipOverSkGr[testIndex - 166].filename);
755 TestResult::Test(dirIndex, filename.c_str(), kCompareBits, reporter->verbose ()); 754 TestResult::Test(dirIndex, filename.c_str(), kCompareBits, reporter->verbose ());
756 TestResult::Test(dirIndex, filename.c_str(), kEncodeFiles, reporter->verbose ()); 755 TestResult::Test(dirIndex, filename.c_str(), kEncodeFiles, reporter->verbose ());
757 } 756 }
OLDNEW
« no previous file with comments | « tests/PathOpsSkpClipTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698