| 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 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 981 | 981 |
| 982 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE | 982 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE |
| 983 fMCMgr.call(SkMatrixClipStateMgr::kOther_CallType); | 983 fMCMgr.call(SkMatrixClipStateMgr::kOther_CallType); |
| 984 #endif | 984 #endif |
| 985 | 985 |
| 986 // op + paint index + mode + count + point data | 986 // op + paint index + mode + count + point data |
| 987 size_t size = 4 * kUInt32Size + count * sizeof(SkPoint); | 987 size_t size = 4 * kUInt32Size + count * sizeof(SkPoint); |
| 988 size_t initialOffset = this->addDraw(DRAW_POINTS, &size); | 988 size_t initialOffset = this->addDraw(DRAW_POINTS, &size); |
| 989 SkASSERT(initialOffset+getPaintOffset(DRAW_POINTS, size) == fWriter.bytesWri
tten()); | 989 SkASSERT(initialOffset+getPaintOffset(DRAW_POINTS, size) == fWriter.bytesWri
tten()); |
| 990 this->addPaint(paint); | 990 this->addPaint(paint); |
| 991 if (paint.getPathEffect() != NULL) { |
| 992 SkPathEffect::DashInfo info; |
| 993 SkPathEffect::DashType dashType = paint.getPathEffect()->asADash(&info); |
| 994 if (2 == count && SkPaint::kRound_Cap != paint.getStrokeCap() && |
| 995 SkPathEffect::kDash_DashType == dashType && 2 == info.fCount) { |
| 996 fContentInfo.incFastPathDashEffects(); |
| 997 } |
| 998 } |
| 991 this->addInt(mode); | 999 this->addInt(mode); |
| 992 this->addInt(SkToInt(count)); | 1000 this->addInt(SkToInt(count)); |
| 993 fWriter.writeMul4(pts, count * sizeof(SkPoint)); | 1001 fWriter.writeMul4(pts, count * sizeof(SkPoint)); |
| 994 this->validate(initialOffset, size); | 1002 this->validate(initialOffset, size); |
| 995 } | 1003 } |
| 996 | 1004 |
| 997 void SkPictureRecord::drawOval(const SkRect& oval, const SkPaint& paint) { | 1005 void SkPictureRecord::drawOval(const SkRect& oval, const SkPaint& paint) { |
| 998 | 1006 |
| 999 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE | 1007 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE |
| 1000 fMCMgr.call(SkMatrixClipStateMgr::kOther_CallType); | 1008 fMCMgr.call(SkMatrixClipStateMgr::kOther_CallType); |
| (...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1824 void SkPictureRecord::validateRegions() const { | 1832 void SkPictureRecord::validateRegions() const { |
| 1825 int count = fRegions.count(); | 1833 int count = fRegions.count(); |
| 1826 SkASSERT((unsigned) count < 0x1000); | 1834 SkASSERT((unsigned) count < 0x1000); |
| 1827 for (int index = 0; index < count; index++) { | 1835 for (int index = 0; index < count; index++) { |
| 1828 const SkFlatData* region = fRegions[index]; | 1836 const SkFlatData* region = fRegions[index]; |
| 1829 SkASSERT(region); | 1837 SkASSERT(region); |
| 1830 // region->validate(); | 1838 // region->validate(); |
| 1831 } | 1839 } |
| 1832 } | 1840 } |
| 1833 #endif | 1841 #endif |
| OLD | NEW |