Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/)
This CL is part I of IV (I broke down the 1280 files into 4 CLs).
Review URL: https://codereview.appspot.com/6485054
git-svn-id: http://skia.googlecode.com/svn/trunk@5262 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkClipStack.cpp b/src/core/SkClipStack.cpp
index e8ff6e8..3c9705d 100644
--- a/src/core/SkClipStack.cpp
+++ b/src/core/SkClipStack.cpp
@@ -13,7 +13,7 @@
// 0-2 are reserved for invalid, empty & wide-open
-int32_t SkClipStack::gGenID = 3;
+int32_t SkClipStack::gGenID = 3;
struct SkClipStack::Rec {
enum State {
@@ -30,13 +30,13 @@
bool fDoAA;
// fFiniteBoundType and fFiniteBound are used to incrementally update
- // the clip stack's bound. When fFiniteBoundType is kNormal_BoundsType,
- // fFiniteBound represents the conservative bounding box of the pixels
- // that aren't clipped (i.e., any pixels that can be drawn to are inside
- // the bound). When fFiniteBoundType is kInsideOut_BoundsType (which occurs
- // when a clip is inverse filled), fFiniteBound represents the
- // conservative bounding box of the pixels that _are_ clipped (i.e., any
- // pixels that cannot be drawn to are inside the bound). When
+ // the clip stack's bound. When fFiniteBoundType is kNormal_BoundsType,
+ // fFiniteBound represents the conservative bounding box of the pixels
+ // that aren't clipped (i.e., any pixels that can be drawn to are inside
+ // the bound). When fFiniteBoundType is kInsideOut_BoundsType (which occurs
+ // when a clip is inverse filled), fFiniteBound represents the
+ // conservative bounding box of the pixels that _are_ clipped (i.e., any
+ // pixels that cannot be drawn to are inside the bound). When
// fFiniteBoundType is kInsideOut_BoundsType the actual bound is
// the infinite plane. This behavior of fFiniteBoundType and
// fFiniteBound is required so that we can capture the cancelling out
@@ -48,13 +48,13 @@
int fGenID;
- Rec(int saveCount)
+ Rec(int saveCount)
: fGenID(kInvalidGenID) {
fSaveCount = saveCount;
this->setEmpty();
}
-
- Rec(int saveCount, const SkRect& rect, SkRegion::Op op, bool doAA)
+
+ Rec(int saveCount, const SkRect& rect, SkRegion::Op op, bool doAA)
: fRect(rect)
, fGenID(kInvalidGenID) {
fSaveCount = saveCount;
@@ -64,7 +64,7 @@
// bounding box members are updated in a following updateBound call
}
- Rec(int saveCount, const SkPath& path, SkRegion::Op op, bool doAA)
+ Rec(int saveCount, const SkPath& path, SkRegion::Op op, bool doAA)
: fPath(path)
, fGenID(kInvalidGenID) {
fRect.setEmpty();
@@ -91,8 +91,8 @@
}
bool operator==(const Rec& b) const {
- if (fSaveCount != b.fSaveCount ||
- fOp != b.fOp ||
+ if (fSaveCount != b.fSaveCount ||
+ fOp != b.fOp ||
fState != b.fState ||
fDoAA != b.fDoAA) {
return false;
@@ -124,7 +124,7 @@
}
// Only clips within the same save/restore frame (as captured by
// the save count) can be merged
- return fSaveCount == saveCount &&
+ return fSaveCount == saveCount &&
SkRegion::kIntersect_Op == op &&
(SkRegion::kIntersect_Op == fOp || SkRegion::kReplace_Op == fOp);
}
@@ -155,8 +155,8 @@
// So either the two overlap in some complex manner or newR contains oldR.
// In the first, case the edges will require different AA. In the second,
- // the AA setting that would be carried forward is incorrect (e.g., oldR
- // is AA while newR is BW but since newR contains oldR, oldR will be
+ // the AA setting that would be carried forward is incorrect (e.g., oldR
+ // is AA while newR is BW but since newR contains oldR, oldR will be
// drawn BW) since the new AA setting will predominate.
return false;
}
@@ -165,7 +165,7 @@
/**
* The different combination of fill & inverse fill when combining
* bounding boxes
- */
+ */
enum FillCombo {
kPrev_Cur_FillCombo,
kPrev_InvCur_FillCombo,
@@ -192,7 +192,7 @@
break;
case kPrev_InvCur_FillCombo:
// In this case everything outside of this clip's bound
- // is erased, so the only pixels that can remain set
+ // is erased, so the only pixels that can remain set
// occur w/in the intersection of the two finite bounds
if (!fFiniteBound.intersect(prevFinite)) {
fFiniteBound.setEmpty();
@@ -200,11 +200,11 @@
fFiniteBoundType = kNormal_BoundsType;
break;
case kPrev_Cur_FillCombo:
- // The most conservative result bound is that of the
- // prior clip. This could be wildly incorrect if the
- // second clip either exactly matches the first clip
+ // The most conservative result bound is that of the
+ // prior clip. This could be wildly incorrect if the
+ // second clip either exactly matches the first clip
// (which should yield the empty set) or reduces the
- // size of the prior bound (e.g., if the second clip
+ // size of the prior bound (e.g., if the second clip
// exactly matched the bottom half of the prior clip).
// We ignore these two possibilities.
fFiniteBound = prevFinite;
@@ -227,16 +227,16 @@
fFiniteBoundType = kInsideOut_BoundsType;
break;
case kInvPrev_InvCur_FillCombo:
- // The only pixels that can survive are within the
+ // The only pixels that can survive are within the
// union of the two bounding boxes since the extensions
// to infinity of both clips cancel out
// fall through!
case kPrev_Cur_FillCombo:
- // The most conservative bound for xor is the
+ // The most conservative bound for xor is the
// union of the two bounds. If the two clips exactly overlapped
- // the xor could yield the empty set. Similarly the xor
- // could reduce the size of the original clip's bound (e.g.,
- // if the second clip exactly matched the bottom half of the
+ // the xor could yield the empty set. Similarly the xor
+ // could reduce the size of the original clip's bound (e.g.,
+ // if the second clip exactly matched the bottom half of the
// first clip). We ignore these two cases.
fFiniteBound.join(prevFinite);
fFiniteBoundType = kNormal_BoundsType;
@@ -281,12 +281,12 @@
switch (combination) {
case kInvPrev_InvCur_FillCombo:
- // The only pixels that aren't writable in this case
+ // The only pixels that aren't writable in this case
// occur in the union of the two finite bounds
fFiniteBound.join(prevFinite);
fFiniteBoundType = kInsideOut_BoundsType;
break;
- case kInvPrev_Cur_FillCombo:
+ case kInvPrev_Cur_FillCombo:
// In this case the only pixels that will remain writeable
// are within the current clip
break;
@@ -312,7 +312,7 @@
switch (combination) {
case kInvPrev_InvCur_FillCombo:
- // The only pixels that can survive are in the
+ // The only pixels that can survive are in the
// previous bound since the extensions to infinity in
// both clips cancel out
fFiniteBound = prevFinite;
@@ -329,10 +329,10 @@
fFiniteBoundType = kInsideOut_BoundsType;
break;
case kPrev_Cur_FillCombo:
- // Fall through - as with the kDifference_Op case, the
+ // Fall through - as with the kDifference_Op case, the
// most conservative result bound is the bound of the
- // current clip. The prior clip could reduce the size of this
- // bound (as in the kDifference_Op case) but we are ignoring
+ // current clip. The prior clip could reduce the size of this
+ // bound (as in the kDifference_Op case) but we are ignoring
// those cases.
break;
default:
@@ -343,7 +343,7 @@
void updateBound(const Rec* prior) {
- // First, optimistically update the current Rec's bound information
+ // First, optimistically update the current Rec's bound information
// with the current clip's bound
fIsIntersectionOfRects = false;
if (kRect_State == fState) {
@@ -351,7 +351,7 @@
fFiniteBoundType = kNormal_BoundsType;
if (SkRegion::kReplace_Op == fOp ||
- (SkRegion::kIntersect_Op == fOp && NULL == prior) ||
+ (SkRegion::kIntersect_Op == fOp && NULL == prior) ||
(SkRegion::kIntersect_Op == fOp && prior->fIsIntersectionOfRects &&
prior->rectRectIntersectAllowed(fRect, fDoAA))) {
fIsIntersectionOfRects = true;
@@ -359,7 +359,7 @@
} else {
SkASSERT(kPath_State == fState);
-
+
fFiniteBound = fPath.getBounds();
if (fPath.isInverseFillType()) {
@@ -376,9 +376,9 @@
// Note: the left edge is handled slightly differently below. We
// are a bit more generous in the rounding since we don't want to
// risk missing the left pixels when fLeft is very close to .5
- fFiniteBound.set(SkIntToScalar(SkScalarFloorToInt(fFiniteBound.fLeft+0.45f)),
- SkIntToScalar(SkScalarRound(fFiniteBound.fTop)),
- SkIntToScalar(SkScalarRound(fFiniteBound.fRight)),
+ fFiniteBound.set(SkIntToScalar(SkScalarFloorToInt(fFiniteBound.fLeft+0.45f)),
+ SkIntToScalar(SkScalarRound(fFiniteBound.fTop)),
+ SkIntToScalar(SkScalarRound(fFiniteBound.fRight)),
SkIntToScalar(SkScalarRound(fFiniteBound.fBottom)));
}
@@ -404,9 +404,9 @@
combination = (FillCombo) (combination | 0x02);
}
- SkASSERT(kInvPrev_InvCur_FillCombo == combination ||
+ SkASSERT(kInvPrev_InvCur_FillCombo == combination ||
kInvPrev_Cur_FillCombo == combination ||
- kPrev_InvCur_FillCombo == combination ||
+ kPrev_InvCur_FillCombo == combination ||
kPrev_Cur_FillCombo == combination);
// Now integrate with clip with the prior clips
@@ -439,23 +439,23 @@
}
};
-// This constant determines how many Rec's are allocated together as a block in
+// This constant determines how many Rec's are allocated together as a block in
// the deque. As such it needs to balance allocating too much memory vs.
// incurring allocation/deallocation thrashing. It should roughly correspond to
// the deepest save/restore stack we expect to see.
static const int kDefaultRecordAllocCnt = 8;
-SkClipStack::SkClipStack()
+SkClipStack::SkClipStack()
: fDeque(sizeof(Rec), kDefaultRecordAllocCnt)
, fSaveCount(0) {
}
-SkClipStack::SkClipStack(const SkClipStack& b)
+SkClipStack::SkClipStack(const SkClipStack& b)
: fDeque(sizeof(Rec), kDefaultRecordAllocCnt) {
*this = b;
}
-SkClipStack::SkClipStack(const SkRect& r)
+SkClipStack::SkClipStack(const SkRect& r)
: fDeque(sizeof(Rec), kDefaultRecordAllocCnt)
, fSaveCount(0) {
if (!r.isEmpty()) {
@@ -463,7 +463,7 @@
}
}
-SkClipStack::SkClipStack(const SkIRect& r)
+SkClipStack::SkClipStack(const SkIRect& r)
: fDeque(sizeof(Rec), kDefaultRecordAllocCnt)
, fSaveCount(0) {
if (!r.isEmpty()) {
@@ -495,7 +495,7 @@
}
bool SkClipStack::operator==(const SkClipStack& b) const {
- if (fSaveCount != b.fSaveCount ||
+ if (fSaveCount != b.fSaveCount ||
fDeque.count() != b.fDeque.count()) {
return false;
}
@@ -543,7 +543,7 @@
}
}
-void SkClipStack::getBounds(SkRect* canvFiniteBound,
+void SkClipStack::getBounds(SkRect* canvFiniteBound,
BoundsType* boundType,
bool* isIntersectionOfRects) const {
SkASSERT(NULL != canvFiniteBound && NULL != boundType);
@@ -670,17 +670,17 @@
}
}
new (fDeque.push_back()) Rec(fSaveCount);
-
+
if (rec && rec->fSaveCount == fSaveCount) {
this->purgeClip(rec);
}
}
-bool SkClipStack::isWideOpen() const {
+bool SkClipStack::isWideOpen() const {
if (0 == fDeque.count()) {
return true;
}
-
+
const Rec* back = (const Rec*) fDeque.back();
return kInsideOut_BoundsType == back->fFiniteBoundType &&
back->fFiniteBound.isEmpty();
@@ -766,10 +766,10 @@
if (op == rec->fOp) {
// The Deque's iterator is actually one pace ahead of the
- // returned value. So while "rec" is the element we want to
+ // returned value. So while "rec" is the element we want to
// return, the iterator is actually pointing at (and will
// return on the next "next" or "prev" call) the element
- // in front of it in the deque. Bump the iterator forward a
+ // in front of it in the deque. Bump the iterator forward a
// step so we get the expected result.
if (NULL == fIter.next()) {
// The reverse iterator has run off the front of the deque
@@ -803,12 +803,12 @@
bool* isIntersectionOfRects) const {
SkASSERT(NULL != devBounds);
- devBounds->setLTRB(0, 0,
+ devBounds->setLTRB(0, 0,
SkIntToScalar(maxWidth), SkIntToScalar(maxHeight));
SkRect temp;
SkClipStack::BoundsType boundType;
-
+
// temp starts off in canvas space here
this->getBounds(&temp, &boundType, isIntersectionOfRects);
if (SkClipStack::kInsideOut_BoundsType == boundType) {