| 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 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1571 | 1571 |
| 1572 void SkPictureRecord::addMatrix(const SkMatrix& matrix) { | 1572 void SkPictureRecord::addMatrix(const SkMatrix& matrix) { |
| 1573 fWriter.writeMatrix(matrix); | 1573 fWriter.writeMatrix(matrix); |
| 1574 } | 1574 } |
| 1575 | 1575 |
| 1576 const SkFlatData* SkPictureRecord::getFlatPaintData(const SkPaint& paint) { | 1576 const SkFlatData* SkPictureRecord::getFlatPaintData(const SkPaint& paint) { |
| 1577 return fPaints.findAndReturnFlat(paint); | 1577 return fPaints.findAndReturnFlat(paint); |
| 1578 } | 1578 } |
| 1579 | 1579 |
| 1580 const SkFlatData* SkPictureRecord::addPaintPtr(const SkPaint* paint) { | 1580 const SkFlatData* SkPictureRecord::addPaintPtr(const SkPaint* paint) { |
| 1581 if (NULL != paint && NULL != paint->getPathEffect()) { |
| 1582 fPicture->setHasPathEffects(); |
| 1583 } |
| 1584 |
| 1581 const SkFlatData* data = paint ? getFlatPaintData(*paint) : NULL; | 1585 const SkFlatData* data = paint ? getFlatPaintData(*paint) : NULL; |
| 1582 this->addFlatPaint(data); | 1586 this->addFlatPaint(data); |
| 1583 return data; | 1587 return data; |
| 1584 } | 1588 } |
| 1585 | 1589 |
| 1586 void SkPictureRecord::addFlatPaint(const SkFlatData* flatPaint) { | 1590 void SkPictureRecord::addFlatPaint(const SkFlatData* flatPaint) { |
| 1587 int index = flatPaint ? flatPaint->index() : 0; | 1591 int index = flatPaint ? flatPaint->index() : 0; |
| 1588 this->addInt(index); | 1592 this->addInt(index); |
| 1589 } | 1593 } |
| 1590 | 1594 |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1799 void SkPictureRecord::validateRegions() const { | 1803 void SkPictureRecord::validateRegions() const { |
| 1800 int count = fRegions.count(); | 1804 int count = fRegions.count(); |
| 1801 SkASSERT((unsigned) count < 0x1000); | 1805 SkASSERT((unsigned) count < 0x1000); |
| 1802 for (int index = 0; index < count; index++) { | 1806 for (int index = 0; index < count; index++) { |
| 1803 const SkFlatData* region = fRegions[index]; | 1807 const SkFlatData* region = fRegions[index]; |
| 1804 SkASSERT(region); | 1808 SkASSERT(region); |
| 1805 // region->validate(); | 1809 // region->validate(); |
| 1806 } | 1810 } |
| 1807 } | 1811 } |
| 1808 #endif | 1812 #endif |
| OLD | NEW |