| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 | 8 |
| 9 #include "SkBBoxHierarchyRecord.h" | 9 #include "SkBBoxHierarchyRecord.h" |
| 10 #include "SkPictureStateTree.h" | 10 #include "SkPictureStateTree.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 SaveFlags flags
) { | 36 SaveFlags flags
) { |
| 37 fStateTree->appendSaveLayer(this->writeStream().bytesWritten()); | 37 fStateTree->appendSaveLayer(this->writeStream().bytesWritten()); |
| 38 return this->INHERITED::willSaveLayer(bounds, paint, flags); | 38 return this->INHERITED::willSaveLayer(bounds, paint, flags); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void SkBBoxHierarchyRecord::willRestore() { | 41 void SkBBoxHierarchyRecord::willRestore() { |
| 42 fStateTree->appendRestore(); | 42 fStateTree->appendRestore(); |
| 43 this->INHERITED::willRestore(); | 43 this->INHERITED::willRestore(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 bool SkBBoxHierarchyRecord::translate(SkScalar dx, SkScalar dy) { | 46 void SkBBoxHierarchyRecord::didTranslate(SkScalar dx, SkScalar dy) { |
| 47 bool result = INHERITED::translate(dx, dy); | |
| 48 fStateTree->appendTransform(getTotalMatrix()); | 47 fStateTree->appendTransform(getTotalMatrix()); |
| 49 return result; | 48 INHERITED::didTranslate(dx, dy); |
| 50 } | 49 } |
| 51 | 50 |
| 52 bool SkBBoxHierarchyRecord::scale(SkScalar sx, SkScalar sy) { | 51 void SkBBoxHierarchyRecord::didScale(SkScalar sx, SkScalar sy) { |
| 53 bool result = INHERITED::scale(sx, sy); | |
| 54 fStateTree->appendTransform(getTotalMatrix()); | 52 fStateTree->appendTransform(getTotalMatrix()); |
| 55 return result; | 53 INHERITED::didScale(sx, sy); |
| 56 } | 54 } |
| 57 | 55 |
| 58 bool SkBBoxHierarchyRecord::rotate(SkScalar degrees) { | 56 void SkBBoxHierarchyRecord::didRotate(SkScalar degrees) { |
| 59 bool result = INHERITED::rotate(degrees); | |
| 60 fStateTree->appendTransform(getTotalMatrix()); | 57 fStateTree->appendTransform(getTotalMatrix()); |
| 61 return result; | 58 INHERITED::didRotate(degrees); |
| 62 } | 59 } |
| 63 | 60 |
| 64 bool SkBBoxHierarchyRecord::skew(SkScalar sx, SkScalar sy) { | 61 void SkBBoxHierarchyRecord::didSkew(SkScalar sx, SkScalar sy) { |
| 65 bool result = INHERITED::skew(sx, sy); | |
| 66 fStateTree->appendTransform(getTotalMatrix()); | 62 fStateTree->appendTransform(getTotalMatrix()); |
| 67 return result; | 63 INHERITED::didSkew(sx, sy); |
| 68 } | 64 } |
| 69 | 65 |
| 70 bool SkBBoxHierarchyRecord::concat(const SkMatrix& matrix) { | 66 void SkBBoxHierarchyRecord::didConcat(const SkMatrix& matrix) { |
| 71 bool result = INHERITED::concat(matrix); | |
| 72 fStateTree->appendTransform(getTotalMatrix()); | 67 fStateTree->appendTransform(getTotalMatrix()); |
| 73 return result; | 68 INHERITED::didConcat(matrix); |
| 74 } | 69 } |
| 75 | 70 |
| 76 void SkBBoxHierarchyRecord::setMatrix(const SkMatrix& matrix) { | 71 void SkBBoxHierarchyRecord::didSetMatrix(const SkMatrix& matrix) { |
| 77 INHERITED::setMatrix(matrix); | |
| 78 fStateTree->appendTransform(getTotalMatrix()); | 72 fStateTree->appendTransform(getTotalMatrix()); |
| 73 INHERITED::didSetMatrix(matrix); |
| 79 } | 74 } |
| 80 | 75 |
| 81 void SkBBoxHierarchyRecord::onClipRect(const SkRect& rect, | 76 void SkBBoxHierarchyRecord::onClipRect(const SkRect& rect, |
| 82 SkRegion::Op op, | 77 SkRegion::Op op, |
| 83 ClipEdgeStyle edgeStyle) { | 78 ClipEdgeStyle edgeStyle) { |
| 84 fStateTree->appendClip(this->writeStream().bytesWritten()); | 79 fStateTree->appendClip(this->writeStream().bytesWritten()); |
| 85 this->INHERITED::onClipRect(rect, op, edgeStyle); | 80 this->INHERITED::onClipRect(rect, op, edgeStyle); |
| 86 } | 81 } |
| 87 | 82 |
| 88 void SkBBoxHierarchyRecord::onClipRegion(const SkRegion& region, | 83 void SkBBoxHierarchyRecord::onClipRegion(const SkRegion& region, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 107 | 102 |
| 108 bool SkBBoxHierarchyRecord::shouldRewind(void* data) { | 103 bool SkBBoxHierarchyRecord::shouldRewind(void* data) { |
| 109 // SkBBoxHierarchy::rewindInserts is called by SkPicture after the | 104 // SkBBoxHierarchy::rewindInserts is called by SkPicture after the |
| 110 // SkPicture has rewound its command stream. To match that rewind in the | 105 // SkPicture has rewound its command stream. To match that rewind in the |
| 111 // BBH, we rewind all draws that reference commands that were recorded | 106 // BBH, we rewind all draws that reference commands that were recorded |
| 112 // past the point to which the SkPicture has rewound, which is given by | 107 // past the point to which the SkPicture has rewound, which is given by |
| 113 // writeStream().bytesWritten(). | 108 // writeStream().bytesWritten(). |
| 114 SkPictureStateTree::Draw* draw = static_cast<SkPictureStateTree::Draw*>(data
); | 109 SkPictureStateTree::Draw* draw = static_cast<SkPictureStateTree::Draw*>(data
); |
| 115 return draw->fOffset >= writeStream().bytesWritten(); | 110 return draw->fOffset >= writeStream().bytesWritten(); |
| 116 } | 111 } |
| OLD | NEW |