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

Side by Side Diff: tools/skdiff_utils.cpp

Issue 334793002: hide Config in SkImageDecoder -- use SkColorType instead (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix warning Created 6 years, 6 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/render_pictures_main.cpp ('k') | tools/skimage_main.cpp » ('j') | 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 2012 Google Inc. 2 * Copyright 2012 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 #include "skdiff.h" 7 #include "skdiff.h"
8 #include "skdiff_utils.h" 8 #include "skdiff_utils.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 SkDebugf("ERROR: no codec found for <%s>\n", resource.fFullPath.c_str()) ; 56 SkDebugf("ERROR: no codec found for <%s>\n", resource.fFullPath.c_str()) ;
57 resource.fStatus = DiffResource::kCouldNotDecode_Status; 57 resource.fStatus = DiffResource::kCouldNotDecode_Status;
58 return false; 58 return false;
59 } 59 }
60 60
61 // In debug, the DLL will automatically be unloaded when this is deleted, 61 // In debug, the DLL will automatically be unloaded when this is deleted,
62 // but that shouldn't be a problem in release mode. 62 // but that shouldn't be a problem in release mode.
63 SkAutoTDelete<SkImageDecoder> ad(codec); 63 SkAutoTDelete<SkImageDecoder> ad(codec);
64 64
65 stream.rewind(); 65 stream.rewind();
66 if (!codec->decode(&stream, &resource.fBitmap, SkBitmap::kARGB_8888_Config, mode)) { 66 if (!codec->decode(&stream, &resource.fBitmap, kN32_SkColorType, mode)) {
67 SkDebugf("ERROR: codec failed for basePath <%s>\n", resource.fFullPath.c _str()); 67 SkDebugf("ERROR: codec failed for basePath <%s>\n", resource.fFullPath.c _str());
68 resource.fStatus = DiffResource::kCouldNotDecode_Status; 68 resource.fStatus = DiffResource::kCouldNotDecode_Status;
69 return false; 69 return false;
70 } 70 }
71 71
72 resource.fStatus = DiffResource::kDecoded_Status; 72 resource.fStatus = DiffResource::kDecoded_Status;
73 return true; 73 return true;
74 } 74 }
75 75
76 /** Thanks to PNG, we need to force all pixels 100% opaque. */ 76 /** Thanks to PNG, we need to force all pixels 100% opaque. */
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 drp->fDifference.fStatus = DiffResource::kDoesNotExist_Status; 175 drp->fDifference.fStatus = DiffResource::kDoesNotExist_Status;
176 } 176 }
177 if (write_bitmap(drp->fWhite.fFullPath, drp->fWhite.fBitmap)) { 177 if (write_bitmap(drp->fWhite.fFullPath, drp->fWhite.fBitmap)) {
178 drp->fWhite.fStatus = DiffResource::kExists_Status; 178 drp->fWhite.fStatus = DiffResource::kExists_Status;
179 } else { 179 } else {
180 drp->fWhite.fStatus = DiffResource::kDoesNotExist_Status; 180 drp->fWhite.fStatus = DiffResource::kDoesNotExist_Status;
181 } 181 }
182 } 182 }
183 } 183 }
184 } 184 }
OLDNEW
« no previous file with comments | « tools/render_pictures_main.cpp ('k') | tools/skimage_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698