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 "GrBitmapTextContext.h" | 8 #include "GrBitmapTextContext.h" |
9 #include "GrAtlas.h" | 9 #include "GrAtlas.h" |
10 #include "GrDefaultGeoProcFactory.h" | 10 #include "GrDefaultGeoProcFactory.h" |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 } | 414 } |
415 | 415 |
416 vx += SkIntToFixed(glyph->fBounds.fLeft); | 416 vx += SkIntToFixed(glyph->fBounds.fLeft); |
417 vy += SkIntToFixed(glyph->fBounds.fTop); | 417 vy += SkIntToFixed(glyph->fBounds.fTop); |
418 | 418 |
419 // keep them as ints until we've done the clip-test | 419 // keep them as ints until we've done the clip-test |
420 SkFixed width = glyph->fBounds.width(); | 420 SkFixed width = glyph->fBounds.width(); |
421 SkFixed height = glyph->fBounds.height(); | 421 SkFixed height = glyph->fBounds.height(); |
422 | 422 |
423 // check if we clipped out | 423 // check if we clipped out |
424 if (true || NULL == glyph->fPlot) { | 424 int x = vx >> 16; |
425 int x = vx >> 16; | 425 int y = vy >> 16; |
426 int y = vy >> 16; | 426 if (fClipRect.quickReject(x, y, x + width, y + height)) { |
427 if (fClipRect.quickReject(x, y, x + width, y + height)) { | 427 return; |
428 // SkCLZ(3); // so we can set a break-point in the debugger | |
429 return; | |
430 } | |
431 } | 428 } |
432 | 429 |
433 // If the glyph is too large we fall back to paths | 430 // If the glyph is too large we fall back to paths |
434 if (NULL == glyph->fPlot && !uploadGlyph(glyph, scaler)) { | 431 if (NULL == glyph->fPlot && !uploadGlyph(glyph, scaler)) { |
435 if (NULL == glyph->fPath) { | 432 if (NULL == glyph->fPath) { |
436 SkPath* path = SkNEW(SkPath); | 433 SkPath* path = SkNEW(SkPath); |
437 if (!scaler->getGlyphPath(glyph->glyphID(), path)) { | 434 if (!scaler->getGlyphPath(glyph->glyphID(), path)) { |
438 // flag the glyph as being dead? | 435 // flag the glyph as being dead? |
439 delete path; | 436 delete path; |
440 return; | 437 return; |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 } | 604 } |
608 } | 605 } |
609 | 606 |
610 inline void GrBitmapTextContext::finish() { | 607 inline void GrBitmapTextContext::finish() { |
611 this->flush(); | 608 this->flush(); |
612 fTotalVertexCount = 0; | 609 fTotalVertexCount = 0; |
613 | 610 |
614 GrTextContext::finish(); | 611 GrTextContext::finish(); |
615 } | 612 } |
616 | 613 |
OLD | NEW |