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

Side by Side Diff: dm/DMSrcSink.cpp

Issue 1320273004: Revert of Scanline decoding for gifs (Closed) Base URL: https://skia.googlesource.com/skia.git@real-bmp-scan
Patch Set: Created 5 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 | « no previous file | src/codec/SkCodecPriv.h » ('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 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 "SkCodec.h" 10 #include "SkCodec.h"
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 canvas->drawBitmap(bitmap, 0, 0); 345 canvas->drawBitmap(bitmap, 0, 0);
346 break; 346 break;
347 } 347 }
348 case kScanline_Mode: { 348 case kScanline_Mode: {
349 SkAutoTDelete<SkScanlineDecoder> scanlineDecoder( 349 SkAutoTDelete<SkScanlineDecoder> scanlineDecoder(
350 start_scanline_decoder(encoded.get(), decodeInfo, colorPtr, colorCountPtr)); 350 start_scanline_decoder(encoded.get(), decodeInfo, colorPtr, colorCountPtr));
351 if (nullptr == scanlineDecoder) { 351 if (nullptr == scanlineDecoder) {
352 return Error::Nonfatal("Could not start scanline decoder"); 352 return Error::Nonfatal("Could not start scanline decoder");
353 } 353 }
354 354
355 SkCodec::Result result = SkCodec::kUnimplemented; 355 const SkCodec::Result result = scanlineDecoder->getScanlines(
356 switch (scanlineDecoder->getScanlineOrder()) { 356 bitmap.getAddr(0, 0), decodeInfo.height(), bitmap.rowBytes() );
357 case SkScanlineDecoder::kTopDown_SkScanlineOrder:
358 case SkScanlineDecoder::kBottomUp_SkScanlineOrder:
359 case SkScanlineDecoder::kNone_SkScanlineOrder:
360 result = scanlineDecoder->getScanlines(bitmap.getAddr(0, 0),
361 decodeInfo.height(), bitmap.rowBytes());
362 break;
363 case SkScanlineDecoder::kOutOfOrder_SkScanlineOrder: {
364 for (int y = 0; y < decodeInfo.height(); y++) {
365 int dstY = scanlineDecoder->getY();
366 void* dstPtr = bitmap.getAddr(0, dstY);
367 result = scanlineDecoder->getScanlines(dstPtr, 1, bitmap .rowBytes());
368 if (SkCodec::kSuccess != result && SkCodec::kIncompleteI nput != result) {
369 return SkStringPrintf("%s failed with error message %d",
370 fPath.c_str(), (int) result);
371 }
372 }
373 break;
374 }
375 }
376
377 switch (result) { 357 switch (result) {
378 case SkCodec::kSuccess: 358 case SkCodec::kSuccess:
379 case SkCodec::kIncompleteInput: 359 case SkCodec::kIncompleteInput:
380 break; 360 break;
381 default: 361 default:
382 return SkStringPrintf("%s failed with error message %d", 362 return SkStringPrintf("%s failed with error message %d",
383 fPath.c_str(), (int) result); 363 fPath.c_str(), (int) result);
384 } 364 }
385 canvas->drawBitmap(bitmap, 0, 0); 365 canvas->drawBitmap(bitmap, 0, 0);
386 break; 366 break;
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 skr.visit<void>(i, drawsAsSingletonPictures); 1242 skr.visit<void>(i, drawsAsSingletonPictures);
1263 } 1243 }
1264 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); 1244 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture());
1265 1245
1266 canvas->drawPicture(macroPic); 1246 canvas->drawPicture(macroPic);
1267 return ""; 1247 return "";
1268 }); 1248 });
1269 } 1249 }
1270 1250
1271 } // namespace DM 1251 } // namespace DM
OLDNEW
« no previous file with comments | « no previous file | src/codec/SkCodecPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698