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 "SkPictureRecord.h" | 8 #include "SkPictureRecord.h" |
9 #include "SkTSearch.h" | 9 #include "SkTSearch.h" |
10 #include "SkPixelRef.h" | 10 #include "SkPixelRef.h" |
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 size += kUInt32Size; | 776 size += kUInt32Size; |
777 } | 777 } |
778 uint32_t initialOffset = this->addDraw(CLIP_PATH, &size); | 778 uint32_t initialOffset = this->addDraw(CLIP_PATH, &size); |
779 addPath(path); | 779 addPath(path); |
780 addInt(ClipParams_pack(op, doAA)); | 780 addInt(ClipParams_pack(op, doAA)); |
781 recordRestoreOffsetPlaceholder(op); | 781 recordRestoreOffsetPlaceholder(op); |
782 | 782 |
783 validate(initialOffset, size); | 783 validate(initialOffset, size); |
784 | 784 |
785 if (fRecordFlags & SkPicture::kUsePathBoundsForClip_RecordingFlag) { | 785 if (fRecordFlags & SkPicture::kUsePathBoundsForClip_RecordingFlag) { |
786 return this->INHERITED::clipRect(path.getBounds(), op, doAA); | 786 if (path.isInverseFillType()) { |
| 787 return this->getClipDeviceBounds(NULL); |
| 788 } else { |
| 789 return this->INHERITED::clipRect(path.getBounds(), op, doAA); |
| 790 } |
787 } else { | 791 } else { |
788 return this->INHERITED::clipPath(path, op, doAA); | 792 return this->INHERITED::clipPath(path, op, doAA); |
789 } | 793 } |
790 } | 794 } |
791 | 795 |
792 bool SkPictureRecord::clipRegion(const SkRegion& region, SkRegion::Op op) { | 796 bool SkPictureRecord::clipRegion(const SkRegion& region, SkRegion::Op op) { |
793 // op + region index + clip params | 797 // op + region index + clip params |
794 uint32_t size = 3 * kUInt32Size; | 798 uint32_t size = 3 * kUInt32Size; |
795 // recordRestoreOffsetPlaceholder doesn't always write an offset | 799 // recordRestoreOffsetPlaceholder doesn't always write an offset |
796 if (!fRestoreOffsetStack.isEmpty()) { | 800 if (!fRestoreOffsetStack.isEmpty()) { |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1450 void SkPictureRecord::validateRegions() const { | 1454 void SkPictureRecord::validateRegions() const { |
1451 int count = fRegions.count(); | 1455 int count = fRegions.count(); |
1452 SkASSERT((unsigned) count < 0x1000); | 1456 SkASSERT((unsigned) count < 0x1000); |
1453 for (int index = 0; index < count; index++) { | 1457 for (int index = 0; index < count; index++) { |
1454 const SkFlatData* region = fRegions[index]; | 1458 const SkFlatData* region = fRegions[index]; |
1455 SkASSERT(region); | 1459 SkASSERT(region); |
1456 // region->validate(); | 1460 // region->validate(); |
1457 } | 1461 } |
1458 } | 1462 } |
1459 #endif | 1463 #endif |
OLD | NEW |