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

Side by Side Diff: fuzz/fuzz.cpp

Issue 1811703002: return pictures as sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rely on RVO in picturerecorder 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 | « dm/DMSrcSink.cpp ('k') | gm/distantclip.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 2016 Google Inc. 2 * Copyright 2016 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 "Fuzz.h" 8 #include "Fuzz.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkCodec.h" 10 #include "SkCodec.h"
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 SkDebugf("[terminated] Mode not implemented yet\n"); 351 SkDebugf("[terminated] Mode not implemented yet\n");
352 } 352 }
353 353
354 dump_png(bitmap); 354 dump_png(bitmap);
355 return 0; 355 return 0;
356 } 356 }
357 357
358 int fuzz_skp(SkData* bytes) { 358 int fuzz_skp(SkData* bytes) {
359 SkMemoryStream stream(bytes); 359 SkMemoryStream stream(bytes);
360 SkDebugf("Decoding\n"); 360 SkDebugf("Decoding\n");
361 SkAutoTUnref<SkPicture> pic(SkPicture::CreateFromStream(&stream)); 361 sk_sp<SkPicture> pic(SkPicture::MakeFromStream(&stream));
362 if (!pic) { 362 if (!pic) {
363 SkDebugf("[terminated] Couldn't decode as a picture.\n"); 363 SkDebugf("[terminated] Couldn't decode as a picture.\n");
364 return 3; 364 return 3;
365 } 365 }
366 SkDebugf("Rendering\n"); 366 SkDebugf("Rendering\n");
367 SkBitmap bitmap; 367 SkBitmap bitmap;
368 if (!FLAGS_dump.isEmpty()) { 368 if (!FLAGS_dump.isEmpty()) {
369 SkIRect size = pic->cullRect().roundOut(); 369 SkIRect size = pic->cullRect().roundOut();
370 bitmap.allocN32Pixels(size.width(), size.height()); 370 bitmap.allocN32Pixels(size.width(), size.height());
371 } 371 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 if (min > max) { 415 if (min > max) {
416 SkDebugf("Check mins and maxes (%f, %f)\n", min, max); 416 SkDebugf("Check mins and maxes (%f, %f)\n", min, max);
417 this->signalBoring(); 417 this->signalBoring();
418 } 418 }
419 float f = std::abs(this->nextF()); 419 float f = std::abs(this->nextF());
420 if (!std::isnormal(f) && f != 0.0) { 420 if (!std::isnormal(f) && f != 0.0) {
421 this->signalBoring(); 421 this->signalBoring();
422 } 422 }
423 return min + fmod(f, (max - min + 1)); 423 return min + fmod(f, (max - min + 1));
424 } 424 }
OLDNEW
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | gm/distantclip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698