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

Side by Side Diff: tools/visualize_color_gamut.cpp

Issue 2333713002: change SkStreams to work with sk_sp<SkData> instead of SkData* (Closed)
Patch Set: fix xpsdevice Created 4 years, 3 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 | « tools/viewer/ImageSlide.cpp ('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 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 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 "Resources.h" 8 #include "Resources.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 if (!input || !output) { 117 if (!input || !output) {
118 SkCommandLineFlags::PrintUsage(); 118 SkCommandLineFlags::PrintUsage();
119 return -1; 119 return -1;
120 } 120 }
121 121
122 sk_sp<SkData> data(SkData::MakeFromFileName(input)); 122 sk_sp<SkData> data(SkData::MakeFromFileName(input));
123 if (!data) { 123 if (!data) {
124 SkDebugf("Cannot find input image.\n"); 124 SkDebugf("Cannot find input image.\n");
125 return -1; 125 return -1;
126 } 126 }
127 SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(data.get())); 127 SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(data));
128 if (!codec) { 128 if (!codec) {
129 SkDebugf("Invalid input image.\n"); 129 SkDebugf("Invalid input image.\n");
130 return -1; 130 return -1;
131 } 131 }
132 132
133 // Load a graph of the CIE XYZ color gamut. 133 // Load a graph of the CIE XYZ color gamut.
134 SkBitmap gamut; 134 SkBitmap gamut;
135 if (!GetResourceAsBitmap("gamut.png", &gamut)) { 135 if (!GetResourceAsBitmap("gamut.png", &gamut)) {
136 SkDebugf("Program failure.\n"); 136 SkDebugf("Program failure.\n");
137 return -1; 137 return -1;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 SkFILEWStream bitmapStream(FLAGS_uncorrected[0]); 192 SkFILEWStream bitmapStream(FLAGS_uncorrected[0]);
193 result = bitmapStream.write(out->data(), out->size()); 193 result = bitmapStream.write(out->data(), out->size());
194 if (!result) { 194 if (!result) {
195 SkDebugf("Failed to write uncorrected image output.\n"); 195 SkDebugf("Failed to write uncorrected image output.\n");
196 return -1; 196 return -1;
197 } 197 }
198 } 198 }
199 199
200 return 0; 200 return 0;
201 } 201 }
OLDNEW
« no previous file with comments | « tools/viewer/ImageSlide.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698