OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "SkScalerContext.h" | 10 #include "SkScalerContext.h" |
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 sk_bzero(mx, sizeof(*mx)); | 845 sk_bzero(mx, sizeof(*mx)); |
846 } | 846 } |
847 if (my) { | 847 if (my) { |
848 sk_bzero(my, sizeof(*my)); | 848 sk_bzero(my, sizeof(*my)); |
849 } | 849 } |
850 } | 850 } |
851 }; | 851 }; |
852 | 852 |
853 extern SkScalerContext* SkCreateColorScalerContext(const SkDescriptor* desc); | 853 extern SkScalerContext* SkCreateColorScalerContext(const SkDescriptor* desc); |
854 | 854 |
855 SkScalerContext* SkTypeface::createScalerContext(const SkDescriptor* desc) const
{ | 855 SkScalerContext* SkTypeface::createScalerContext(const SkDescriptor* desc, |
856 SkScalerContext* c = NULL; //SkCreateColorScalerContext(desc); | 856 bool allowFailure) const { |
857 if (NULL == c) { | 857 SkScalerContext* c = this->onCreateScalerContext(desc); |
858 c = this->onCreateScalerContext(desc); | 858 |
859 } | 859 if (!c && !allowFailure) { |
860 if (NULL == c) { | |
861 c = SkNEW_ARGS(SkScalerContext_Empty, | 860 c = SkNEW_ARGS(SkScalerContext_Empty, |
862 (const_cast<SkTypeface*>(this), desc)); | 861 (const_cast<SkTypeface*>(this), desc)); |
863 } | 862 } |
864 return c; | 863 return c; |
865 } | 864 } |
| 865 |
OLD | NEW |