| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkPictureRecord.h" | 8 #include "SkPictureRecord.h" |
| 9 #include "SkTSearch.h" | 9 #include "SkTSearch.h" |
| 10 #include "SkPixelRef.h" | 10 #include "SkPixelRef.h" |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 result[numMatched].fOffset = curOffset; | 312 result[numMatched].fOffset = curOffset; |
| 313 result[numMatched].fSize = curSize; | 313 result[numMatched].fSize = curSize; |
| 314 | 314 |
| 315 curOffset += curSize; | 315 curOffset += curSize; |
| 316 } | 316 } |
| 317 | 317 |
| 318 if (numMatched != numCommands) { | 318 if (numMatched != numCommands) { |
| 319 return false; | 319 return false; |
| 320 } | 320 } |
| 321 | 321 |
| 322 curOffset += curSize; | |
| 323 if (curOffset < writer->bytesWritten()) { | 322 if (curOffset < writer->bytesWritten()) { |
| 324 // Something else between the last command and the end of the stream | 323 // Something else between the last command and the end of the stream |
| 325 return false; | 324 return false; |
| 326 } | 325 } |
| 327 | 326 |
| 328 return true; | 327 return true; |
| 329 } | 328 } |
| 330 | 329 |
| 331 // temporarily here to make code review easier | 330 // temporarily here to make code review easier |
| 332 static bool merge_savelayer_paint_into_drawbitmp(SkWriter32* writer, | 331 static bool merge_savelayer_paint_into_drawbitmp(SkWriter32* writer, |
| (...skipping 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1822 void SkPictureRecord::validateRegions() const { | 1821 void SkPictureRecord::validateRegions() const { |
| 1823 int count = fRegions.count(); | 1822 int count = fRegions.count(); |
| 1824 SkASSERT((unsigned) count < 0x1000); | 1823 SkASSERT((unsigned) count < 0x1000); |
| 1825 for (int index = 0; index < count; index++) { | 1824 for (int index = 0; index < count; index++) { |
| 1826 const SkFlatData* region = fRegions[index]; | 1825 const SkFlatData* region = fRegions[index]; |
| 1827 SkASSERT(region); | 1826 SkASSERT(region); |
| 1828 // region->validate(); | 1827 // region->validate(); |
| 1829 } | 1828 } |
| 1830 } | 1829 } |
| 1831 #endif | 1830 #endif |
| OLD | NEW |