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

Side by Side Diff: dm/DMSrcSink.cpp

Issue 1305123002: Scanline decoding for gifs (Closed) Base URL: https://skia.googlesource.com/skia.git@real-bmp-scan
Patch Set: Compile fix 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 const SkCodec::Result result = scanlineDecoder->getScanlines( 355 SkCodec::Result result = SkCodec::kUnimplemented;
356 bitmap.getAddr(0, 0), decodeInfo.height(), bitmap.rowBytes() ); 356 switch (scanlineDecoder->getScanlineOrder()) {
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
357 switch (result) { 377 switch (result) {
358 case SkCodec::kSuccess: 378 case SkCodec::kSuccess:
359 case SkCodec::kIncompleteInput: 379 case SkCodec::kIncompleteInput:
360 break; 380 break;
361 default: 381 default:
362 return SkStringPrintf("%s failed with error message %d", 382 return SkStringPrintf("%s failed with error message %d",
363 fPath.c_str(), (int) result); 383 fPath.c_str(), (int) result);
364 } 384 }
365 canvas->drawBitmap(bitmap, 0, 0); 385 canvas->drawBitmap(bitmap, 0, 0);
366 break; 386 break;
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 skr.visit<void>(i, drawsAsSingletonPictures); 1262 skr.visit<void>(i, drawsAsSingletonPictures);
1243 } 1263 }
1244 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); 1264 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture());
1245 1265
1246 canvas->drawPicture(macroPic); 1266 canvas->drawPicture(macroPic);
1247 return ""; 1267 return "";
1248 }); 1268 });
1249 } 1269 }
1250 1270
1251 } // namespace DM 1271 } // 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