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 "GrDrawTarget.h" | 10 #include "GrDrawTarget.h" |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 | 568 |
569 SkFixed tx = SkIntToFixed(glyph->fAtlasLocation.fX); | 569 SkFixed tx = SkIntToFixed(glyph->fAtlasLocation.fX); |
570 SkFixed ty = SkIntToFixed(glyph->fAtlasLocation.fY); | 570 SkFixed ty = SkIntToFixed(glyph->fAtlasLocation.fY); |
571 | 571 |
572 SkRect r; | 572 SkRect r; |
573 r.fLeft = SkFixedToFloat(vx); | 573 r.fLeft = SkFixedToFloat(vx); |
574 r.fTop = SkFixedToFloat(vy); | 574 r.fTop = SkFixedToFloat(vy); |
575 r.fRight = SkFixedToFloat(vx + width); | 575 r.fRight = SkFixedToFloat(vx + width); |
576 r.fBottom = SkFixedToFloat(vy + height); | 576 r.fBottom = SkFixedToFloat(vy + height); |
577 | 577 |
578 fVertexBounds.growToInclude(r); | 578 fVertexBounds.joinNonEmptyArg(r); |
579 | 579 |
580 size_t vertSize = useColorVerts ? (2 * sizeof(SkPoint) + sizeof(GrColor)) : | 580 size_t vertSize = useColorVerts ? (2 * sizeof(SkPoint) + sizeof(GrColor)) : |
581 (2 * sizeof(SkPoint)); | 581 (2 * sizeof(SkPoint)); |
582 | 582 |
583 SkASSERT(vertSize == fDrawTarget->getDrawState().getVertexStride()); | 583 SkASSERT(vertSize == fDrawTarget->getDrawState().getVertexStride()); |
584 | 584 |
585 SkPoint* positions = reinterpret_cast<SkPoint*>( | 585 SkPoint* positions = reinterpret_cast<SkPoint*>( |
586 reinterpret_cast<intptr_t>(fVertices) + vertSize * fCurrVertex); | 586 reinterpret_cast<intptr_t>(fVertices) + vertSize * fCurrVertex); |
587 positions->setRectFan(r.fLeft, r.fTop, r.fRight, r.fBottom, vertSize); | 587 positions->setRectFan(r.fLeft, r.fTop, r.fRight, r.fBottom, vertSize); |
588 | 588 |
(...skipping 11 matching lines...) Expand all Loading... |
600 } | 600 } |
601 // color comes after position. | 601 // color comes after position. |
602 GrColor* colors = reinterpret_cast<GrColor*>(positions + 1); | 602 GrColor* colors = reinterpret_cast<GrColor*>(positions + 1); |
603 for (int i = 0; i < 4; ++i) { | 603 for (int i = 0; i < 4; ++i) { |
604 *colors = fPaint.getColor(); | 604 *colors = fPaint.getColor(); |
605 colors = reinterpret_cast<GrColor*>(reinterpret_cast<intptr_t>(colors
) + vertSize); | 605 colors = reinterpret_cast<GrColor*>(reinterpret_cast<intptr_t>(colors
) + vertSize); |
606 } | 606 } |
607 } | 607 } |
608 fCurrVertex += 4; | 608 fCurrVertex += 4; |
609 } | 609 } |
OLD | NEW |