| 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 | 8 |
| 9 #include "GrRectanizer_skyline.h" | 9 #include "GrRectanizer_skyline.h" |
| 10 #include "SkPoint.h" |
| 10 | 11 |
| 11 bool GrRectanizerSkyline::addRect(int width, int height, GrIPoint16* loc) { | 12 bool GrRectanizerSkyline::addRect(int width, int height, SkIPoint16* loc) { |
| 12 if ((unsigned)width > (unsigned)this->width() || | 13 if ((unsigned)width > (unsigned)this->width() || |
| 13 (unsigned)height > (unsigned)this->height()) { | 14 (unsigned)height > (unsigned)this->height()) { |
| 14 return false; | 15 return false; |
| 15 } | 16 } |
| 16 | 17 |
| 17 // find position for new rectangle | 18 // find position for new rectangle |
| 18 int bestWidth = this->width() + 1; | 19 int bestWidth = this->width() + 1; |
| 19 int bestX; | 20 int bestX; |
| 20 int bestY = this->height() + 1; | 21 int bestY = this->height() + 1; |
| 21 int bestIndex = -1; | 22 int bestIndex = -1; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 --i; | 110 --i; |
| 110 } | 111 } |
| 111 } | 112 } |
| 112 } | 113 } |
| 113 | 114 |
| 114 /////////////////////////////////////////////////////////////////////////////// | 115 /////////////////////////////////////////////////////////////////////////////// |
| 115 | 116 |
| 116 GrRectanizer* GrRectanizer::Factory(int width, int height) { | 117 GrRectanizer* GrRectanizer::Factory(int width, int height) { |
| 117 return SkNEW_ARGS(GrRectanizerSkyline, (width, height)); | 118 return SkNEW_ARGS(GrRectanizerSkyline, (width, height)); |
| 118 } | 119 } |
| OLD | NEW |