| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "GrDistanceFieldTextContext.h" | 8 #include "GrDistanceFieldTextContext.h" |
| 9 #include "GrAtlas.h" | 9 #include "GrAtlas.h" |
| 10 #include "GrBitmapTextContext.h" | 10 #include "GrBitmapTextContext.h" |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 SkRect glyphRect = SkRect::MakeXYWH(sx, sy, width, height); | 521 SkRect glyphRect = SkRect::MakeXYWH(sx, sy, width, height); |
| 522 | 522 |
| 523 // check if we clipped out | 523 // check if we clipped out |
| 524 SkRect dstRect; | 524 SkRect dstRect; |
| 525 const SkMatrix& ctm = fViewMatrix; | 525 const SkMatrix& ctm = fViewMatrix; |
| 526 (void) ctm.mapRect(&dstRect, glyphRect); | 526 (void) ctm.mapRect(&dstRect, glyphRect); |
| 527 if (fClipRect.quickReject(SkScalarTruncToInt(dstRect.left()), | 527 if (fClipRect.quickReject(SkScalarTruncToInt(dstRect.left()), |
| 528 SkScalarTruncToInt(dstRect.top()), | 528 SkScalarTruncToInt(dstRect.top()), |
| 529 SkScalarTruncToInt(dstRect.right()), | 529 SkScalarTruncToInt(dstRect.right()), |
| 530 SkScalarTruncToInt(dstRect.bottom()))) { | 530 SkScalarTruncToInt(dstRect.bottom()))) { |
| 531 // SkCLZ(3); // so we can set a break-point in the debugger | |
| 532 return true; | 531 return true; |
| 533 } | 532 } |
| 534 | 533 |
| 535 if (NULL == glyph->fPlot) { | 534 if (NULL == glyph->fPlot) { |
| 536 // needs to be a separate conditional to avoid over-optimization | 535 // needs to be a separate conditional to avoid over-optimization |
| 537 // on Nexus 7 and Nexus 10 | 536 // on Nexus 7 and Nexus 10 |
| 538 | 537 |
| 539 // If the glyph is too large we fall back to paths | 538 // If the glyph is too large we fall back to paths |
| 540 if (!uploadGlyph(glyph, scaler)) { | 539 if (!uploadGlyph(glyph, scaler)) { |
| 541 if (NULL == glyph->fPath) { | 540 if (NULL == glyph->fPath) { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 } | 678 } |
| 680 } | 679 } |
| 681 | 680 |
| 682 inline void GrDistanceFieldTextContext::finish() { | 681 inline void GrDistanceFieldTextContext::finish() { |
| 683 this->flush(); | 682 this->flush(); |
| 684 fTotalVertexCount = 0; | 683 fTotalVertexCount = 0; |
| 685 | 684 |
| 686 GrTextContext::finish(); | 685 GrTextContext::finish(); |
| 687 } | 686 } |
| 688 | 687 |
| OLD | NEW |