| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |