OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrTextUtils.h" | 8 #include "GrTextUtils.h" |
9 | 9 |
10 #include "GrAtlasTextBlob.h" | 10 #include "GrAtlasTextBlob.h" |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 matrix[SkMatrix::kMTransY] = loc.fY; | 540 matrix[SkMatrix::kMTransY] = loc.fY; |
541 GrBlurUtils::drawPathWithMaskFilter(context, dc, clip, *path, pa
int, | 541 GrBlurUtils::drawPathWithMaskFilter(context, dc, clip, *path, pa
int, |
542 viewMatrix, &matrix, clipBou
nds, false); | 542 viewMatrix, &matrix, clipBou
nds, false); |
543 } | 543 } |
544 } | 544 } |
545 pos += scalarsPerPosition; | 545 pos += scalarsPerPosition; |
546 } | 546 } |
547 } | 547 } |
548 | 548 |
549 bool GrTextUtils::ShouldDisableLCD(const SkPaint& paint) { | 549 bool GrTextUtils::ShouldDisableLCD(const SkPaint& paint) { |
550 return !SkXfermode::AsMode(paint.getXfermode(), nullptr) || | 550 return paint.getMaskFilter() || |
551 paint.getMaskFilter() || | |
552 paint.getRasterizer() || | 551 paint.getRasterizer() || |
553 paint.getPathEffect() || | 552 paint.getPathEffect() || |
554 paint.isFakeBoldText() || | 553 paint.isFakeBoldText() || |
555 paint.getStyle() != SkPaint::kFill_Style; | 554 paint.getStyle() != SkPaint::kFill_Style; |
556 } | 555 } |
557 | 556 |
558 uint32_t GrTextUtils::FilterTextFlags(const SkSurfaceProps& surfaceProps, const
SkPaint& paint) { | 557 uint32_t GrTextUtils::FilterTextFlags(const SkSurfaceProps& surfaceProps, const
SkPaint& paint) { |
559 uint32_t flags = paint.getFlags(); | 558 uint32_t flags = paint.getFlags(); |
560 | 559 |
561 if (!paint.isLCDRenderText() || !paint.isAntiAlias()) { | 560 if (!paint.isLCDRenderText() || !paint.isAntiAlias()) { |
562 return flags; | 561 return flags; |
563 } | 562 } |
564 | 563 |
565 if (kUnknown_SkPixelGeometry == surfaceProps.pixelGeometry() || ShouldDisabl
eLCD(paint)) { | 564 if (kUnknown_SkPixelGeometry == surfaceProps.pixelGeometry() || ShouldDisabl
eLCD(paint)) { |
566 flags &= ~SkPaint::kLCDRenderText_Flag; | 565 flags &= ~SkPaint::kLCDRenderText_Flag; |
567 flags |= SkPaint::kGenA8FromLCD_Flag; | 566 flags |= SkPaint::kGenA8FromLCD_Flag; |
568 } | 567 } |
569 | 568 |
570 return flags; | 569 return flags; |
571 } | 570 } |
OLD | NEW |