| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "GrAAConvexTessellator.h" | 8 #include "GrAAConvexTessellator.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkPath.h" | 10 #include "SkPath.h" |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 fInitialRing.addIdx(i, i); | 401 fInitialRing.addIdx(i, i); |
| 402 } | 402 } |
| 403 fInitialRing.init(fNorms, fBisectors); | 403 fInitialRing.init(fNorms, fBisectors); |
| 404 | 404 |
| 405 this->validate(); | 405 this->validate(); |
| 406 return true; | 406 return true; |
| 407 } | 407 } |
| 408 | 408 |
| 409 GrAAConvexTessellator::Ring* GrAAConvexTessellator::getNextRing(Ring* lastRing)
{ | 409 GrAAConvexTessellator::Ring* GrAAConvexTessellator::getNextRing(Ring* lastRing)
{ |
| 410 #if GR_AA_CONVEX_TESSELLATOR_VIZ | 410 #if GR_AA_CONVEX_TESSELLATOR_VIZ |
| 411 Ring* ring = *fRings.push() = SkNEW(Ring); | 411 Ring* ring = *fRings.push() = new Ring; |
| 412 ring->setReserve(fInitialRing.numPts()); | 412 ring->setReserve(fInitialRing.numPts()); |
| 413 ring->rewind(); | 413 ring->rewind(); |
| 414 return ring; | 414 return ring; |
| 415 #else | 415 #else |
| 416 // Flip flop back and forth between fRings[0] & fRings[1] | 416 // Flip flop back and forth between fRings[0] & fRings[1] |
| 417 int nextRing = (lastRing == &fRings[0]) ? 1 : 0; | 417 int nextRing = (lastRing == &fRings[0]) ? 1 : 0; |
| 418 fRings[nextRing].setReserve(fInitialRing.numPts()); | 418 fRings[nextRing].setReserve(fInitialRing.numPts()); |
| 419 fRings[nextRing].rewind(); | 419 fRings[nextRing].rewind(); |
| 420 return &fRings[nextRing]; | 420 return &fRings[nextRing]; |
| 421 #endif | 421 #endif |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1018 SkString num; | 1018 SkString num; |
| 1019 num.printf("%d", i); | 1019 num.printf("%d", i); |
| 1020 canvas->drawText(num.c_str(), num.size(), | 1020 canvas->drawText(num.c_str(), num.size(), |
| 1021 this->point(i).fX, this->point(i).fY+(kPointRadius/2.0f
), | 1021 this->point(i).fX, this->point(i).fY+(kPointRadius/2.0f
), |
| 1022 paint); | 1022 paint); |
| 1023 } | 1023 } |
| 1024 } | 1024 } |
| 1025 | 1025 |
| 1026 #endif | 1026 #endif |
| 1027 | 1027 |
| OLD | NEW |