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

Side by Side Diff: dm/DMSrcSink.cpp

Issue 1419403003: Fix DMSrcSink bug (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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 "DMSrcSink.h" 8 #include "DMSrcSink.h"
9 #include "SamplePipeControllers.h" 9 #include "SamplePipeControllers.h"
10 #include "SkAndroidCodec.h" 10 #include "SkAndroidCodec.h"
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 } 257 }
258 *decodeInfo = defaultInfo.makeColorType(kGray_8_SkColorType); 258 *decodeInfo = defaultInfo.makeColorType(kGray_8_SkColorType);
259 break; 259 break;
260 default: 260 default:
261 *decodeInfo = defaultInfo.makeColorType(canvasColorType); 261 *decodeInfo = defaultInfo.makeColorType(canvasColorType);
262 break; 262 break;
263 } 263 }
264 264
265 // FIXME: Currently we cannot draw unpremultiplied sources. 265 // FIXME: Currently we cannot draw unpremultiplied sources.
266 if (decodeInfo->alphaType() == kUnpremul_SkAlphaType) { 266 if (decodeInfo->alphaType() == kUnpremul_SkAlphaType) {
267 decodeInfo->makeAlphaType(kPremul_SkAlphaType); 267 *decodeInfo = decodeInfo->makeAlphaType(kPremul_SkAlphaType);
scroggo 2015/10/27 13:59:04 I wonder if makeAlphaType should be SK_WARN_UNUSED
268 } 268 }
269 return true; 269 return true;
270 } 270 }
271 271
272 Error CodecSrc::draw(SkCanvas* canvas) const { 272 Error CodecSrc::draw(SkCanvas* canvas) const {
273 SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str())); 273 SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str()));
274 if (!encoded) { 274 if (!encoded) {
275 return SkStringPrintf("Couldn't read %s.", fPath.c_str()); 275 return SkStringPrintf("Couldn't read %s.", fPath.c_str());
276 } 276 }
277 SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded)); 277 SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after
1368 skr.visit<void>(i, drawsAsSingletonPictures); 1368 skr.visit<void>(i, drawsAsSingletonPictures);
1369 } 1369 }
1370 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); 1370 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture());
1371 1371
1372 canvas->drawPicture(macroPic); 1372 canvas->drawPicture(macroPic);
1373 return ""; 1373 return "";
1374 }); 1374 });
1375 } 1375 }
1376 1376
1377 } // namespace DM 1377 } // namespace DM
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