| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 bool result = INHERITED::concat(matrix); | 70 bool result = INHERITED::concat(matrix); |
| 71 fStateTree->appendTransform(getTotalMatrix()); | 71 fStateTree->appendTransform(getTotalMatrix()); |
| 72 return result; | 72 return result; |
| 73 } | 73 } |
| 74 | 74 |
| 75 void SkBBoxHierarchyRecord::setMatrix(const SkMatrix& matrix) { | 75 void SkBBoxHierarchyRecord::setMatrix(const SkMatrix& matrix) { |
| 76 INHERITED::setMatrix(matrix); | 76 INHERITED::setMatrix(matrix); |
| 77 fStateTree->appendTransform(getTotalMatrix()); | 77 fStateTree->appendTransform(getTotalMatrix()); |
| 78 } | 78 } |
| 79 | 79 |
| 80 bool SkBBoxHierarchyRecord::clipRect(const SkRect& rect, | 80 void SkBBoxHierarchyRecord::onClipRect(const SkRect& rect, |
| 81 SkRegion::Op op, | 81 SkRegion::Op op, |
| 82 bool doAntiAlias) { | 82 ClipEdgeStyle edgeStyle) { |
| 83 fStateTree->appendClip(this->writeStream().bytesWritten()); | 83 fStateTree->appendClip(this->writeStream().bytesWritten()); |
| 84 return INHERITED::clipRect(rect, op, doAntiAlias); | 84 this->INHERITED::onClipRect(rect, op, edgeStyle); |
| 85 } | 85 } |
| 86 | 86 |
| 87 bool SkBBoxHierarchyRecord::clipRegion(const SkRegion& region, | 87 void SkBBoxHierarchyRecord::onClipRegion(const SkRegion& region, |
| 88 SkRegion::Op op) { | 88 SkRegion::Op op) { |
| 89 fStateTree->appendClip(this->writeStream().bytesWritten()); | 89 fStateTree->appendClip(this->writeStream().bytesWritten()); |
| 90 return INHERITED::clipRegion(region, op); | 90 this->INHERITED::onClipRegion(region, op); |
| 91 } | 91 } |
| 92 | 92 |
| 93 bool SkBBoxHierarchyRecord::clipPath(const SkPath& path, | 93 void SkBBoxHierarchyRecord::onClipPath(const SkPath& path, |
| 94 SkRegion::Op op, | 94 SkRegion::Op op, |
| 95 bool doAntiAlias) { | 95 ClipEdgeStyle edgeStyle) { |
| 96 fStateTree->appendClip(this->writeStream().bytesWritten()); | 96 fStateTree->appendClip(this->writeStream().bytesWritten()); |
| 97 return INHERITED::clipPath(path, op, doAntiAlias); | 97 this->INHERITED::onClipPath(path, op, edgeStyle); |
| 98 } | 98 } |
| 99 | 99 |
| 100 bool SkBBoxHierarchyRecord::clipRRect(const SkRRect& rrect, | 100 void SkBBoxHierarchyRecord::onClipRRect(const SkRRect& rrect, |
| 101 SkRegion::Op op, | 101 SkRegion::Op op, |
| 102 bool doAntiAlias) { | 102 ClipEdgeStyle edgeStyle) { |
| 103 fStateTree->appendClip(this->writeStream().bytesWritten()); | 103 fStateTree->appendClip(this->writeStream().bytesWritten()); |
| 104 return INHERITED::clipRRect(rrect, op, doAntiAlias); | 104 this->INHERITED::onClipRRect(rrect, op, edgeStyle); |
| 105 } | 105 } |
| 106 | 106 |
| 107 bool SkBBoxHierarchyRecord::shouldRewind(void* data) { | 107 bool SkBBoxHierarchyRecord::shouldRewind(void* data) { |
| 108 // SkBBoxHierarchy::rewindInserts is called by SkPicture after the | 108 // SkBBoxHierarchy::rewindInserts is called by SkPicture after the |
| 109 // SkPicture has rewound its command stream. To match that rewind in the | 109 // SkPicture has rewound its command stream. To match that rewind in the |
| 110 // BBH, we rewind all draws that reference commands that were recorded | 110 // BBH, we rewind all draws that reference commands that were recorded |
| 111 // past the point to which the SkPicture has rewound, which is given by | 111 // past the point to which the SkPicture has rewound, which is given by |
| 112 // writeStream().bytesWritten(). | 112 // writeStream().bytesWritten(). |
| 113 SkPictureStateTree::Draw* draw = static_cast<SkPictureStateTree::Draw*>(data
); | 113 SkPictureStateTree::Draw* draw = static_cast<SkPictureStateTree::Draw*>(data
); |
| 114 return draw->fOffset >= writeStream().bytesWritten(); | 114 return draw->fOffset >= writeStream().bytesWritten(); |
| 115 } | 115 } |
| OLD | NEW |