| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |