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

Side by Side Diff: trunk/src/skia/tools/filter_fuzz_stub/filter_fuzz_stub.cc

Issue 183003011: Revert 254567 "don't create SkDevice directly, use SkBitmap or (..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « trunk/src/skia/ext/benchmarking_canvas.cc ('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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/file_util.h" 5 #include "base/file_util.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "third_party/skia/include/core/SkBitmapDevice.h"
7 #include "third_party/skia/include/core/SkCanvas.h" 8 #include "third_party/skia/include/core/SkCanvas.h"
8 #include "third_party/skia/include/core/SkFlattenableSerialization.h" 9 #include "third_party/skia/include/core/SkFlattenableSerialization.h"
9 #include "third_party/skia/include/core/SkImageFilter.h" 10 #include "third_party/skia/include/core/SkImageFilter.h"
10 11
11 namespace { 12 namespace {
12 13
13 static const int BitmapSize = 24; 14 static const int BitmapSize = 24;
14 15
15 bool ReadTestCase(const char* filename, std::string* ipc_filter_message) { 16 bool ReadTestCase(const char* filename, std::string* ipc_filter_message) {
16 base::FilePath filepath = base::FilePath::FromUTF8Unsafe(filename); 17 base::FilePath filepath = base::FilePath::FromUTF8Unsafe(filename);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 67
67 return true; 68 return true;
68 } 69 }
69 70
70 } 71 }
71 72
72 int main(int argc, char** argv) { 73 int main(int argc, char** argv) {
73 int ret = 0; 74 int ret = 0;
74 75
75 SkBitmap bitmap; 76 SkBitmap bitmap;
76 bitmap.allocN32Pixels(BitmapSize, BitmapSize); 77 bitmap.setConfig(SkBitmap::kARGB_8888_Config, BitmapSize, BitmapSize);
77 SkCanvas canvas(bitmap); 78 bitmap.allocPixels();
79 SkBitmapDevice device(bitmap);
80 SkCanvas canvas(&device);
78 canvas.clear(0x00000000); 81 canvas.clear(0x00000000);
79 82
80 for (int i = 1; i < argc; i++) 83 for (int i = 1; i < argc; i++)
81 if (!ReadAndRunTestCase(argv[i], bitmap, &canvas)) 84 if (!ReadAndRunTestCase(argv[i], bitmap, &canvas))
82 ret = 2; 85 ret = 2;
83 86
84 // Cluster-Fuzz likes "#EOF" as the last line of output to help distinguish 87 // Cluster-Fuzz likes "#EOF" as the last line of output to help distinguish
85 // successful runs from crashes. 88 // successful runs from crashes.
86 printf("#EOF\n"); 89 printf("#EOF\n");
87 90
88 return ret; 91 return ret;
89 } 92 }
90 93
OLDNEW
« no previous file with comments | « trunk/src/skia/ext/benchmarking_canvas.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698