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

Side by Side Diff: dm/DMSrcSink.cpp

Issue 1378923002: Small DM cleanup (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 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 | 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 "SkCodec.h" 10 #include "SkCodec.h"
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 switch (skipResult) { 434 switch (skipResult) {
435 case SkCodec::kSuccess: 435 case SkCodec::kSuccess:
436 case SkCodec::kIncompleteInput: 436 case SkCodec::kIncompleteInput:
437 break; 437 break;
438 default: 438 default:
439 return SkStringPrintf("%s failed after attempting to skip %d scanlines" 439 return SkStringPrintf("%s failed after attempting to skip %d scanlines"
440 "with error message %d", fPath.c_str(), y, ( int) skipResult); 440 "with error message %d", fPath.c_str(), y, ( int) skipResult);
441 } 441 }
442 //create and set size of subsetBm 442 //create and set size of subsetBm
443 SkBitmap subsetBm; 443 SkBitmap subsetBm;
444 SkIRect bounds = SkIRect::MakeWH(subsetWidth, subsetHeight); 444 SkIRect bounds = SkIRect::MakeWH(currentSubsetWidth, current SubsetHeight);
445 bounds.setXYWH(0, 0, currentSubsetWidth, currentSubsetHeight );
446 SkAssertResult(largestSubsetBm.extractSubset(&subsetBm, boun ds)); 445 SkAssertResult(largestSubsetBm.extractSubset(&subsetBm, boun ds));
447 SkAutoLockPixels autlockSubsetBm(subsetBm, true); 446 SkAutoLockPixels autlockSubsetBm(subsetBm, true);
448 const SkCodec::Result subsetResult = 447 const SkCodec::Result subsetResult =
449 codec->getScanlines(buffer, currentSubsetHeight, row Bytes); 448 codec->getScanlines(buffer, currentSubsetHeight, row Bytes);
450 switch (subsetResult) { 449 switch (subsetResult) {
451 case SkCodec::kSuccess: 450 case SkCodec::kSuccess:
452 case SkCodec::kIncompleteInput: 451 case SkCodec::kIncompleteInput:
453 break; 452 break;
454 default: 453 default:
455 return SkStringPrintf("%s failed with error message %d", 454 return SkStringPrintf("%s failed with error message %d",
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 skr.visit<void>(i, drawsAsSingletonPictures); 1254 skr.visit<void>(i, drawsAsSingletonPictures);
1256 } 1255 }
1257 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); 1256 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture());
1258 1257
1259 canvas->drawPicture(macroPic); 1258 canvas->drawPicture(macroPic);
1260 return ""; 1259 return "";
1261 }); 1260 });
1262 } 1261 }
1263 1262
1264 } // namespace DM 1263 } // 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