Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Unified Diff: src/gpu/GrRectanizer_skyline.cpp

Issue 217423014: Minor changes to GrFontCache system (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Addressed code review comments Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrAtlas.cpp ('k') | src/gpu/GrTextStrike.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrRectanizer_skyline.cpp
===================================================================
--- src/gpu/GrRectanizer_skyline.cpp (revision 14007)
+++ src/gpu/GrRectanizer_skyline.cpp (working copy)
@@ -14,30 +14,30 @@
class GrRectanizerSkyline : public GrRectanizer {
public:
- GrRectanizerSkyline(int w, int h) : GrRectanizer(w, h) {
- reset();
+ GrRectanizerSkyline(int w, int h) : INHERITED(w, h) {
+ this->reset();
}
virtual ~GrRectanizerSkyline() {
}
- virtual void reset() {
+ virtual void reset() SK_OVERRIDE {
fAreaSoFar = 0;
fSkyline.reset();
SkylineSegment* seg = fSkyline.append(1);
seg->fX = 0;
seg->fY = 0;
- seg->fWidth = width();
+ seg->fWidth = this->width();
}
- virtual bool addRect(int w, int h, GrIPoint16* loc);
+ virtual bool addRect(int w, int h, GrIPoint16* loc) SK_OVERRIDE;
- virtual float percentFull() const {
+ virtual float percentFull() const SK_OVERRIDE {
return fAreaSoFar / ((float)this->width() * this->height());
}
- virtual int stripToPurge(int height) const { return -1; }
- virtual void purgeStripAtY(int yCoord) { }
+ virtual int stripToPurge(int height) const SK_OVERRIDE { return -1; }
+ virtual void purgeStripAtY(int yCoord) SK_OVERRIDE { }
///////////////////////////////////////////////////////////////////////////
@@ -53,6 +53,9 @@
bool rectangleFits(int skylineIndex, int width, int height, int* y) const;
void addSkylineLevel(int skylineIndex, int x, int y, int width, int height);
+
+private:
+ typedef GrRectanizer INHERITED;
};
bool GrRectanizerSkyline::addRect(int width, int height, GrIPoint16* loc) {
@@ -104,13 +107,13 @@
int i = skylineIndex;
int y = fSkyline[skylineIndex].fY;
while (widthLeft > 0) {
- y = SkMax32(y, fSkyline[i].fY);
+ y = SkMax32(y, fSkyline[i].fY);
if (y + height > this->height()) {
return false;
}
- widthLeft -= fSkyline[i].fWidth;
- ++i;
- SkASSERT(i < fSkyline.count() || widthLeft <= 0);
+ widthLeft -= fSkyline[i].fWidth;
+ ++i;
+ SkASSERT(i < fSkyline.count() || widthLeft <= 0);
}
*ypos = y;
@@ -140,12 +143,12 @@
if (fSkyline[i].fWidth <= 0) {
fSkyline.remove(i);
--i;
+ } else {
+ break;
}
- else
- break;
+ } else {
+ break;
}
- else
- break;
}
// merge fSkylines
« no previous file with comments | « src/gpu/GrAtlas.cpp ('k') | src/gpu/GrTextStrike.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698