OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkTypes.h" | 8 #include "SkTypes.h" |
9 #if defined(SK_BUILD_FOR_WIN32) | 9 #if defined(SK_BUILD_FOR_WIN32) |
10 | 10 |
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 if (colorGlyph->paletteIndex != 0xffff) { | 801 if (colorGlyph->paletteIndex != 0xffff) { |
802 color = SkColorSetARGB(SkFloatToIntRound(colorGlyph->runColor.a * 25
5), | 802 color = SkColorSetARGB(SkFloatToIntRound(colorGlyph->runColor.a * 25
5), |
803 SkFloatToIntRound(colorGlyph->runColor.r * 25
5), | 803 SkFloatToIntRound(colorGlyph->runColor.r * 25
5), |
804 SkFloatToIntRound(colorGlyph->runColor.g * 25
5), | 804 SkFloatToIntRound(colorGlyph->runColor.g * 25
5), |
805 SkFloatToIntRound(colorGlyph->runColor.b * 25
5)); | 805 SkFloatToIntRound(colorGlyph->runColor.b * 25
5)); |
806 } else { | 806 } else { |
807 // If all components of runColor are 0 or (equivalently) paletteInde
x is 0xFFFF then | 807 // If all components of runColor are 0 or (equivalently) paletteInde
x is 0xFFFF then |
808 // the 'current brush' is used. fRec.getLuminanceColor() is kinda so
rta what is wanted | 808 // the 'current brush' is used. fRec.getLuminanceColor() is kinda so
rta what is wanted |
809 // here, but not really, it will often be the wrong value because it
wan't designed for | 809 // here, but not really, it will often be the wrong value because it
wan't designed for |
810 // this. | 810 // this. |
811 // In practice, I've not encountered a color glyph that uses the cur
rent brush color. | 811 // TODO: implement this fully, bug.skia.org/5788 |
812 // If this assert ever fires, we should verify that the color is ren
dered properly. | |
813 SkASSERT(false); | |
814 color = fRec.getLuminanceColor(); | 812 color = fRec.getLuminanceColor(); |
815 } | 813 } |
816 paint.setColor(color); | 814 paint.setColor(color); |
817 | 815 |
818 SkPath path; | 816 SkPath path; |
819 SkTScopedComPtr<IDWriteGeometrySink> geometryToPath; | 817 SkTScopedComPtr<IDWriteGeometrySink> geometryToPath; |
820 HRVM(SkDWriteGeometrySink::Create(&path, &geometryToPath), | 818 HRVM(SkDWriteGeometrySink::Create(&path, &geometryToPath), |
821 "Could not create geometry to path converter."); | 819 "Could not create geometry to path converter."); |
822 { | 820 { |
823 SkAutoExclusive l(DWriteFactoryMutex); | 821 SkAutoExclusive l(DWriteFactoryMutex); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
909 FALSE, //sideways | 907 FALSE, //sideways |
910 FALSE, //rtl | 908 FALSE, //rtl |
911 geometryToPath.get()), | 909 geometryToPath.get()), |
912 "Could not create glyph outline."); | 910 "Could not create glyph outline."); |
913 } | 911 } |
914 | 912 |
915 path->transform(fSkXform); | 913 path->transform(fSkXform); |
916 } | 914 } |
917 | 915 |
918 #endif//defined(SK_BUILD_FOR_WIN32) | 916 #endif//defined(SK_BUILD_FOR_WIN32) |
OLD | NEW |