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

Side by Side Diff: experimental/fiddle/fiddle_main.cpp

Issue 1843733002: fiddle: Only output errors to stderr. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 8 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 | « no previous file | 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 2015 Google Inc. 2 * Copyright 2015 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 <stdio.h> 8 #include <stdio.h>
9 9
10 #include <GL/osmesa.h> 10 #include <GL/osmesa.h>
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 static GrContext* create_mesa_grcontext() { 75 static GrContext* create_mesa_grcontext() {
76 sk_sp<const GrGLInterface> mesa(GrGLCreateMesaInterface()); 76 sk_sp<const GrGLInterface> mesa(GrGLCreateMesaInterface());
77 intptr_t backend = reinterpret_cast<intptr_t>(mesa.get()); 77 intptr_t backend = reinterpret_cast<intptr_t>(mesa.get());
78 return backend ? GrContext::Create(kOpenGL_GrBackend, backend) : nullptr; 78 return backend ? GrContext::Create(kOpenGL_GrBackend, backend) : nullptr;
79 } 79 }
80 80
81 81
82 int main() { 82 int main() {
83 const DrawOptions options = GetDrawOptions(); 83 const DrawOptions options = GetDrawOptions();
84 fprintf(stderr, "%s\n", options.source);
85 if (options.source) { 84 if (options.source) {
86 sk_sp<SkData> data(SkData::NewFromFileName(options.source)); 85 sk_sp<SkData> data(SkData::NewFromFileName(options.source));
87 if (!data) { 86 if (!data) {
88 perror(options.source); 87 perror(options.source);
89 return 1; 88 return 1;
90 } else { 89 } else {
91 image = SkImage::NewFromEncoded(data.get()); 90 image = SkImage::NewFromEncoded(data.get());
92 if (!image) { 91 if (!image) {
93 perror("Unable to decode the source image."); 92 perror("Unable to decode the source image.");
94 return 1; 93 return 1;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 printf("{\n"); 145 printf("{\n");
147 dump_output(rasterData, "Raster", !gpuData && !pdfData && !skpData); 146 dump_output(rasterData, "Raster", !gpuData && !pdfData && !skpData);
148 dump_output(gpuData, "Gpu", !pdfData && !skpData); 147 dump_output(gpuData, "Gpu", !pdfData && !skpData);
149 dump_output(pdfData, "Pdf", !skpData); 148 dump_output(pdfData, "Pdf", !skpData);
150 dump_output(skpData, "Skp"); 149 dump_output(skpData, "Skp");
151 printf("}\n"); 150 printf("}\n");
152 151
153 SkSafeSetNull(image); 152 SkSafeSetNull(image);
154 return 0; 153 return 0;
155 } 154 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698