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

Side by Side Diff: samplecode/SampleFilterFuzz.cpp

Issue 106943002: Fixed a few places where uninitialized memory could have been read (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Removed bad scalar checks in SkColorMatrixFilter.cpp Created 7 years 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 | Annotate | Revision Log
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 #include "SampleCode.h" 7 #include "SampleCode.h"
8 #include "SkBicubicImageFilter.h" 8 #include "SkBicubicImageFilter.h"
9 #include "SkBitmapDevice.h" 9 #include "SkBitmapDevice.h"
10 #include "SkBitmapSource.h" 10 #include "SkBitmapSource.h"
(...skipping 13 matching lines...) Expand all
24 #include "SkOffsetImageFilter.h" 24 #include "SkOffsetImageFilter.h"
25 #include "SkPerlinNoiseShader.h" 25 #include "SkPerlinNoiseShader.h"
26 #include "SkRandom.h" 26 #include "SkRandom.h"
27 #include "SkRectShaderImageFilter.h" 27 #include "SkRectShaderImageFilter.h"
28 #include "SkTileImageFilter.h" 28 #include "SkTileImageFilter.h"
29 #include "SkView.h" 29 #include "SkView.h"
30 #include "SkXfermodeImageFilter.h" 30 #include "SkXfermodeImageFilter.h"
31 #include <stdio.h> 31 #include <stdio.h>
32 #include <time.h> 32 #include <time.h>
33 33
34 //#define SK_ADD_RANDOM_BIT_FLIPS
35 //#define SK_FUZZER_IS_VERBOSE
36
34 static const uint32_t kSeed = (uint32_t)(time(NULL)); 37 static const uint32_t kSeed = (uint32_t)(time(NULL));
35 static SkRandom gRand(kSeed); 38 static SkRandom gRand(kSeed);
36 static bool return_large = false; 39 static bool return_large = false;
37 static bool return_undef = false; 40 static bool return_undef = false;
38 41
39 static const int kBitmapSize = 24; 42 static const int kBitmapSize = 24;
40 43
41 static int R(float x) { 44 static int R(float x) {
42 return (int)floor(SkScalarToFloat(gRand.nextUScalar1()) * x); 45 return (int)floor(SkScalarToFloat(gRand.nextUScalar1()) * x);
43 } 46 }
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 } 355 }
353 356
354 private: 357 private:
355 typedef SkView INHERITED; 358 typedef SkView INHERITED;
356 }; 359 };
357 360
358 ////////////////////////////////////////////////////////////////////////////// 361 //////////////////////////////////////////////////////////////////////////////
359 362
360 static SkView* MyFactory() { return new ImageFilterFuzzView; } 363 static SkView* MyFactory() { return new ImageFilterFuzzView; }
361 static SkViewRegister reg(MyFactory); 364 static SkViewRegister reg(MyFactory);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698