| 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 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 fVertices = NULL; | 39 fVertices = NULL; |
| 40 fMaxVertices = 0; | 40 fMaxVertices = 0; |
| 41 } | 41 } |
| 42 | 42 |
| 43 GrDistanceFieldTextContext::~GrDistanceFieldTextContext() { | 43 GrDistanceFieldTextContext::~GrDistanceFieldTextContext() { |
| 44 this->flushGlyphs(); | 44 this->flushGlyphs(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 bool GrDistanceFieldTextContext::canDraw(const SkPaint& paint) { | 47 bool GrDistanceFieldTextContext::canDraw(const SkPaint& paint) { |
| 48 return !paint.getRasterizer() && !paint.getMaskFilter() && | 48 return paint.isDistanceFieldTextTEMP() && |
| 49 !paint.getRasterizer() && !paint.getMaskFilter() && |
| 49 paint.getStyle() == SkPaint::kFill_Style && | 50 paint.getStyle() == SkPaint::kFill_Style && |
| 50 fContext->getTextTarget()->caps()->shaderDerivativeSupport() && | 51 fContext->getTextTarget()->caps()->shaderDerivativeSupport() && |
| 51 !SkDraw::ShouldDrawTextAsPaths(paint, fContext->getMatrix()); | 52 !SkDraw::ShouldDrawTextAsPaths(paint, fContext->getMatrix()); |
| 52 } | 53 } |
| 53 | 54 |
| 54 static inline GrColor skcolor_to_grcolor_nopremultiply(SkColor c) { | 55 static inline GrColor skcolor_to_grcolor_nopremultiply(SkColor c) { |
| 55 unsigned r = SkColorGetR(c); | 56 unsigned r = SkColorGetR(c); |
| 56 unsigned g = SkColorGetG(c); | 57 unsigned g = SkColorGetG(c); |
| 57 unsigned b = SkColorGetB(c); | 58 unsigned b = SkColorGetB(c); |
| 58 return GrColorPackRGBA(r, g, b, 0xff); | 59 return GrColorPackRGBA(r, g, b, 0xff); |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 SkScalarToFixed(y) - (glyph.fAdvanceY >> a
lignShift) | 443 SkScalarToFixed(y) - (glyph.fAdvanceY >> a
lignShift) |
| 443 + SK_FixedHalf, //d1g.fHalfSampleY, | 444 + SK_FixedHalf, //d1g.fHalfSampleY, |
| 444 fontScaler); | 445 fontScaler); |
| 445 } | 446 } |
| 446 pos += scalarsPerPosition; | 447 pos += scalarsPerPosition; |
| 447 } | 448 } |
| 448 } | 449 } |
| 449 | 450 |
| 450 this->finish(); | 451 this->finish(); |
| 451 } | 452 } |
| OLD | NEW |