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 #include <stdlib.h> | 9 #include <stdlib.h> |
10 #include "SkForceLinking.h" | 10 #include "SkForceLinking.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 kOpenGL_GrBackend, | 86 kOpenGL_GrBackend, |
87 reinterpret_cast<intptr_t>(mesa.get())))
; | 87 reinterpret_cast<intptr_t>(mesa.get())))
; |
88 } | 88 } |
89 #else | 89 #else |
90 static sk_sp<GrContext> create_grcontext() { return nullptr; } | 90 static sk_sp<GrContext> create_grcontext() { return nullptr; } |
91 #endif | 91 #endif |
92 | 92 |
93 int main() { | 93 int main() { |
94 const DrawOptions options = GetDrawOptions(); | 94 const DrawOptions options = GetDrawOptions(); |
95 if (options.source) { | 95 if (options.source) { |
96 sk_sp<SkData> data(SkData::NewFromFileName(options.source)); | 96 sk_sp<SkData> data(SkData::MakeFromFileName(options.source)); |
97 if (!data) { | 97 if (!data) { |
98 perror(options.source); | 98 perror(options.source); |
99 return 1; | 99 return 1; |
100 } else { | 100 } else { |
101 image = SkImage::MakeFromEncoded(std::move(data)); | 101 image = SkImage::MakeFromEncoded(std::move(data)); |
102 if (!image) { | 102 if (!image) { |
103 perror("Unable to decode the source image."); | 103 perror("Unable to decode the source image."); |
104 return 1; | 104 return 1; |
105 } | 105 } |
106 SkAssertResult(image->asLegacyBitmap( | 106 SkAssertResult(image->asLegacyBitmap( |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 printf("{\n"); | 156 printf("{\n"); |
157 dump_output(rasterData, "Raster", !gpuData && !pdfData && !skpData); | 157 dump_output(rasterData, "Raster", !gpuData && !pdfData && !skpData); |
158 dump_output(gpuData, "Gpu", !pdfData && !skpData); | 158 dump_output(gpuData, "Gpu", !pdfData && !skpData); |
159 dump_output(pdfData, "Pdf", !skpData); | 159 dump_output(pdfData, "Pdf", !skpData); |
160 dump_output(skpData, "Skp"); | 160 dump_output(skpData, "Skp"); |
161 printf("}\n"); | 161 printf("}\n"); |
162 | 162 |
163 return 0; | 163 return 0; |
164 } | 164 } |
OLD | NEW |