OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 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 "SkCanvasStack.h" | 8 #include "SkCanvasStack.h" |
9 | 9 |
10 SkCanvasStack::SkCanvasStack(int width, int height) | 10 SkCanvasStack::SkCanvasStack(int width, int height) |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 for (int i = 0; i < fList.count(); ++i) { | 70 for (int i = 0; i < fList.count(); ++i) { |
71 | 71 |
72 SkMatrix tempMatrix = matrix; | 72 SkMatrix tempMatrix = matrix; |
73 tempMatrix.postTranslate(SkIntToScalar(-fCanvasData[i].origin.x()), | 73 tempMatrix.postTranslate(SkIntToScalar(-fCanvasData[i].origin.x()), |
74 SkIntToScalar(-fCanvasData[i].origin.y())); | 74 SkIntToScalar(-fCanvasData[i].origin.y())); |
75 fList[i]->setMatrix(tempMatrix); | 75 fList[i]->setMatrix(tempMatrix); |
76 } | 76 } |
77 this->SkCanvas::setMatrix(matrix); | 77 this->SkCanvas::setMatrix(matrix); |
78 } | 78 } |
79 | 79 |
80 bool SkCanvasStack::clipRect(const SkRect& r, SkRegion::Op op, bool aa) { | 80 void SkCanvasStack::onClipRect(const SkRect& r, SkRegion::Op op, ClipEdgeStyle e
dgeStyle) { |
81 bool result = this->INHERITED::clipRect(r, op, aa); | 81 this->INHERITED::onClipRect(r, op, edgeStyle); |
82 this->clipToZOrderedBounds(); | 82 this->clipToZOrderedBounds(); |
83 return result; | |
84 } | 83 } |
85 | 84 |
86 bool SkCanvasStack::clipRRect(const SkRRect& rr, SkRegion::Op op, bool aa) { | 85 void SkCanvasStack::onClipRRect(const SkRRect& rr, SkRegion::Op op, ClipEdgeStyl
e edgeStyle) { |
87 bool result = this->INHERITED::clipRRect(rr, op, aa); | 86 this->INHERITED::onClipRRect(rr, op, edgeStyle); |
88 this->clipToZOrderedBounds(); | 87 this->clipToZOrderedBounds(); |
89 return result; | |
90 } | 88 } |
91 | 89 |
92 bool SkCanvasStack::clipPath(const SkPath& p, SkRegion::Op op, bool aa) { | 90 void SkCanvasStack::onClipPath(const SkPath& p, SkRegion::Op op, ClipEdgeStyle e
dgeStyle) { |
93 bool result = this->INHERITED::clipPath(p, op, aa); | 91 this->INHERITED::onClipPath(p, op, edgeStyle); |
94 this->clipToZOrderedBounds(); | 92 this->clipToZOrderedBounds(); |
95 return result; | |
96 } | 93 } |
97 | 94 |
98 bool SkCanvasStack::clipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { | 95 void SkCanvasStack::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { |
99 SkASSERT(fList.count() == fCanvasData.count()); | 96 SkASSERT(fList.count() == fCanvasData.count()); |
100 for (int i = 0; i < fList.count(); ++i) { | 97 for (int i = 0; i < fList.count(); ++i) { |
101 SkRegion tempRegion; | 98 SkRegion tempRegion; |
102 deviceRgn.translate(-fCanvasData[i].origin.x(), | 99 deviceRgn.translate(-fCanvasData[i].origin.x(), |
103 -fCanvasData[i].origin.y(), &tempRegion); | 100 -fCanvasData[i].origin.y(), &tempRegion); |
104 tempRegion.op(fCanvasData[i].requiredClip, SkRegion::kIntersect_Op); | 101 tempRegion.op(fCanvasData[i].requiredClip, SkRegion::kIntersect_Op); |
105 fList[i]->clipRegion(tempRegion, op); | 102 fList[i]->clipRegion(tempRegion, op); |
106 } | 103 } |
107 return this->SkCanvas::clipRegion(deviceRgn, op); | 104 this->SkCanvas::onClipRegion(deviceRgn, op); |
108 } | 105 } |
OLD | NEW |