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

Unified Diff: src/gpu/GrRectanizer_skyline.cpp

Issue 304313002: Add testing for Rectanizer-derived classes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Renaming file Created 6 years, 7 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/GrRectanizer_skyline.h ('k') | tests/GpuRectanizerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrRectanizer_skyline.cpp
diff --git a/src/gpu/GrRectanizer_skyline.cpp b/src/gpu/GrRectanizer_skyline.cpp
index d485ce3ff053e04a5b7ee505019307ccd182cf7a..200fa8327912f229e3956cfe1648761fd07f4b87 100755
--- a/src/gpu/GrRectanizer_skyline.cpp
+++ b/src/gpu/GrRectanizer_skyline.cpp
@@ -6,57 +6,7 @@
* found in the LICENSE file.
*/
-#include "GrRectanizer.h"
-#include "SkTDArray.h"
-
-// Pack rectangles and track the current silhouette
-// Based in part on Jukka Jylänki's work at http://clb.demon.fi
-
-class GrRectanizerSkyline : public GrRectanizer {
-public:
- GrRectanizerSkyline(int w, int h) : INHERITED(w, h) {
- this->reset();
- }
-
- virtual ~GrRectanizerSkyline() {
- }
-
- virtual void reset() SK_OVERRIDE {
- fAreaSoFar = 0;
- fSkyline.reset();
- SkylineSegment* seg = fSkyline.append(1);
- seg->fX = 0;
- seg->fY = 0;
- seg->fWidth = this->width();
- }
-
- virtual bool addRect(int w, int h, GrIPoint16* loc) SK_OVERRIDE;
-
- virtual float percentFull() const SK_OVERRIDE {
- return fAreaSoFar / ((float)this->width() * this->height());
- }
-
- virtual int stripToPurge(int height) const SK_OVERRIDE { return -1; }
- virtual void purgeStripAtY(int yCoord) SK_OVERRIDE { }
-
- ///////////////////////////////////////////////////////////////////////////
-
- struct SkylineSegment {
- int fX;
- int fY;
- int fWidth;
- };
-
- SkTDArray<SkylineSegment> fSkyline;
-
- int32_t fAreaSoFar;
-
- 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;
-};
+#include "GrRectanizer_skyline.h"
bool GrRectanizerSkyline::addRect(int width, int height, GrIPoint16* loc) {
if ((unsigned)width > (unsigned)this->width() ||
« no previous file with comments | « src/gpu/GrRectanizer_skyline.h ('k') | tests/GpuRectanizerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698