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/gpu/GrRectanizer_fifo.cpp b/src/gpu/GrRectanizer_fifo.cpp
index 0f412b8..aab012d 100644
--- a/src/gpu/GrRectanizer_fifo.cpp
+++ b/src/gpu/GrRectanizer_fifo.cpp
@@ -20,44 +20,44 @@
fAreaSoFar = 0;
Gr_bzero(fRows, sizeof(fRows));
}
-
+
virtual ~GrRectanizerFIFO() {
}
-
+
virtual bool addRect(int w, int h, GrIPoint16* loc);
-
+
virtual float percentFull() const {
return fAreaSoFar / ((float)this->width() * this->height());
}
-
+
virtual int stripToPurge(int height) const { return -1; }
virtual void purgeStripAtY(int yCoord) { }
-
+
///////////////////////////////////////////////////////////////////////////
-
+
struct Row {
GrIPoint16 fLoc;
int fRowHeight;
-
+
bool canAddWidth(int width, int containerWidth) const {
return fLoc.fX + width <= containerWidth;
}
};
-
+
Row fRows[16];
-
+
static int HeightToRowIndex(int height) {
GrAssert(height >= MIN_HEIGHT_POW2);
return 32 - Gr_clz(height - 1);
}
-
+
int fNextStripY;
int32_t fAreaSoFar;
-
+
bool canAddStrip(int height) const {
return fNextStripY + height <= this->height();
}
-
+
void initRow(Row* row, int rowHeight) {
row->fLoc.set(0, fNextStripY);
row->fRowHeight = rowHeight;
@@ -70,9 +70,9 @@
(unsigned)height > (unsigned)this->height()) {
return false;
}
-
+
int32_t area = width * height;
-
+
/*
We use bsearch, but there may be more than one row with the same height,
so we actually search for height-1, which can only be a pow2 itself if
@@ -82,10 +82,10 @@
if (height < MIN_HEIGHT_POW2) {
height = MIN_HEIGHT_POW2;
}
-
+
Row* row = &fRows[HeightToRowIndex(height)];
GrAssert(row->fRowHeight == 0 || row->fRowHeight == height);
-
+
if (0 == row->fRowHeight) {
if (!this->canAddStrip(height)) {
return false;
@@ -101,12 +101,12 @@
this->initRow(row, height);
}
}
-
+
GrAssert(row->fRowHeight == height);
GrAssert(row->canAddWidth(width, this->width()));
*loc = row->fLoc;
row->fLoc.fX += width;
-
+
GrAssert(row->fLoc.fX <= this->width());
GrAssert(row->fLoc.fY <= this->height());
GrAssert(fNextStripY <= this->height());