OLD | NEW |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "SkPicturePlayback.h" | 8 #include "SkPicturePlayback.h" |
9 #include "SkPictureRecord.h" | 9 #include "SkPictureRecord.h" |
10 #include "SkTypeface.h" | 10 #include "SkTypeface.h" |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
708 while (!reader.eof()) { | 708 while (!reader.eof()) { |
709 #ifdef SK_BUILD_FOR_ANDROID | 709 #ifdef SK_BUILD_FOR_ANDROID |
710 if (fAbortCurrentPlayback) { | 710 if (fAbortCurrentPlayback) { |
711 return; | 711 return; |
712 } | 712 } |
713 #endif | 713 #endif |
714 | 714 |
715 size_t curOffset = reader.offset(); | 715 size_t curOffset = reader.offset(); |
716 uint32_t size; | 716 uint32_t size; |
717 DrawType op = read_op_and_size(&reader, &size); | 717 DrawType op = read_op_and_size(&reader, &size); |
718 size_t skipTo = 0; | 718 size_t skipTo = 0; |
robertphillips
2013/05/21 19:47:11
remove "0 == skipTo" check.
| |
719 #ifdef SK_DEVELOPER | |
720 // TODO: once chunk sizes are in all .skps just use | |
721 // "curOffset + size" | |
722 skipTo = this->preDraw(curOffset, op); | |
723 #endif | |
724 if (0 == skipTo && NOOP == op) { | 719 if (0 == skipTo && NOOP == op) { |
725 // NOOPs are to be ignored - do not propagate them any further | 720 // NOOPs are to be ignored - do not propagate them any further |
726 skipTo = curOffset + size; | 721 skipTo = curOffset + size; |
727 } | 722 } |
robertphillips
2013/05/21 19:47:11
add "else { /* put the code you moved here */ }"
| |
728 | 723 |
729 if (0 != skipTo) { | 724 if (0 != skipTo) { |
730 if (it.isValid()) { | 725 if (it.isValid()) { |
731 // If using a bounding box hierarchy, advance the state tree | 726 // If using a bounding box hierarchy, advance the state tree |
732 // iterator until at or after skipTo | 727 // iterator until at or after skipTo |
733 uint32_t adjustedSkipTo; | 728 uint32_t adjustedSkipTo; |
734 do { | 729 do { |
735 adjustedSkipTo = it.draw(); | 730 adjustedSkipTo = it.draw(); |
736 } while (adjustedSkipTo < skipTo); | 731 } while (adjustedSkipTo < skipTo); |
737 skipTo = adjustedSkipTo; | 732 skipTo = adjustedSkipTo; |
738 } | 733 } |
739 if (kDrawComplete == skipTo) { | 734 if (kDrawComplete == skipTo) { |
740 break; | 735 break; |
741 } | 736 } |
742 reader.setOffset(skipTo); | 737 reader.setOffset(skipTo); |
743 continue; | 738 continue; |
744 } | 739 } |
740 #ifdef SK_DEVELOPER | |
741 // TODO: once chunk sizes are in all .skps just use | |
742 // "curOffset + size" | |
743 skipTo = this->preDraw(curOffset, op); | |
744 #endif | |
745 | 745 |
746 switch (op) { | 746 switch (op) { |
747 case CLIP_PATH: { | 747 case CLIP_PATH: { |
748 const SkPath& path = getPath(reader); | 748 const SkPath& path = getPath(reader); |
749 uint32_t packed = reader.readInt(); | 749 uint32_t packed = reader.readInt(); |
750 SkRegion::Op regionOp = ClipParams_unpackRegionOp(packed); | 750 SkRegion::Op regionOp = ClipParams_unpackRegionOp(packed); |
751 bool doAA = ClipParams_unpackDoAA(packed); | 751 bool doAA = ClipParams_unpackDoAA(packed); |
752 size_t offsetToRestore = reader.readInt(); | 752 size_t offsetToRestore = reader.readInt(); |
753 SkASSERT(!offsetToRestore || \ | 753 SkASSERT(!offsetToRestore || \ |
754 offsetToRestore >= reader.offset()); | 754 offsetToRestore >= reader.offset()); |
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1581 for (index = 0; index < fRegionCount; index++) | 1581 for (index = 0; index < fRegionCount; index++) |
1582 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer ), | 1582 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer ), |
1583 "region%p, ", &fRegions[index]); | 1583 "region%p, ", &fRegions[index]); |
1584 if (fRegionCount > 0) | 1584 if (fRegionCount > 0) |
1585 SkDebugf("%s0};\n", pBuffer); | 1585 SkDebugf("%s0};\n", pBuffer); |
1586 | 1586 |
1587 const_cast<SkPicturePlayback*>(this)->dumpStream(); | 1587 const_cast<SkPicturePlayback*>(this)->dumpStream(); |
1588 } | 1588 } |
1589 | 1589 |
1590 #endif | 1590 #endif |
OLD | NEW |