| 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 "GrDrawTarget.h" | 10 #include "GrDrawTarget.h" |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 SkFixed ty = SkIntToFixed(glyph->fAtlasLocation.fY + SK_DistanceFieldInset); | 404 SkFixed ty = SkIntToFixed(glyph->fAtlasLocation.fY + SK_DistanceFieldInset); |
| 405 SkFixed tw = SkIntToFixed(glyph->fBounds.width() - 2*SK_DistanceFieldInset); | 405 SkFixed tw = SkIntToFixed(glyph->fBounds.width() - 2*SK_DistanceFieldInset); |
| 406 SkFixed th = SkIntToFixed(glyph->fBounds.height() - 2*SK_DistanceFieldInset)
; | 406 SkFixed th = SkIntToFixed(glyph->fBounds.height() - 2*SK_DistanceFieldInset)
; |
| 407 | 407 |
| 408 SkRect r; | 408 SkRect r; |
| 409 r.fLeft = sx; | 409 r.fLeft = sx; |
| 410 r.fTop = sy; | 410 r.fTop = sy; |
| 411 r.fRight = sx + width; | 411 r.fRight = sx + width; |
| 412 r.fBottom = sy + height; | 412 r.fBottom = sy + height; |
| 413 | 413 |
| 414 fVertexBounds.growToInclude(r); | 414 fVertexBounds.joinNonEmptyArg(r); |
| 415 | 415 |
| 416 size_t vertSize = fUseLCDText ? (2 * sizeof(SkPoint)) | 416 size_t vertSize = fUseLCDText ? (2 * sizeof(SkPoint)) |
| 417 : (2 * sizeof(SkPoint) + sizeof(GrColor)); | 417 : (2 * sizeof(SkPoint) + sizeof(GrColor)); |
| 418 | 418 |
| 419 SkASSERT(vertSize == fDrawTarget->getDrawState().getVertexStride()); | 419 SkASSERT(vertSize == fDrawTarget->getDrawState().getVertexStride()); |
| 420 | 420 |
| 421 SkPoint* positions = reinterpret_cast<SkPoint*>( | 421 SkPoint* positions = reinterpret_cast<SkPoint*>( |
| 422 reinterpret_cast<intptr_t>(fVertices) + vertSize * fCurrVertex); | 422 reinterpret_cast<intptr_t>(fVertices) + vertSize * fCurrVertex); |
| 423 positions->setRectFan(r.fLeft, r.fTop, r.fRight, r.fBottom, vertSize); | 423 positions->setRectFan(r.fLeft, r.fTop, r.fRight, r.fBottom, vertSize); |
| 424 | 424 |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 SkScalarToFixed(x) - (glyph.fAdvanceX >> a
lignShift), | 668 SkScalarToFixed(x) - (glyph.fAdvanceX >> a
lignShift), |
| 669 SkScalarToFixed(y) - (glyph.fAdvanceY >> a
lignShift), | 669 SkScalarToFixed(y) - (glyph.fAdvanceY >> a
lignShift), |
| 670 fontScaler); | 670 fontScaler); |
| 671 } | 671 } |
| 672 pos += scalarsPerPosition; | 672 pos += scalarsPerPosition; |
| 673 } | 673 } |
| 674 } | 674 } |
| 675 | 675 |
| 676 this->finish(); | 676 this->finish(); |
| 677 } | 677 } |
| OLD | NEW |