OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) | 4 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) |
5 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 5 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
7 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> | 7 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> |
8 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 8 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
9 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. | 9 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. |
10 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 10 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 return; | 841 return; |
842 const FontMetrics& fontMetrics = fontData->getFontMetrics(); | 842 const FontMetrics& fontMetrics = fontData->getFontMetrics(); |
843 | 843 |
844 // FIXME: Need to turn off font smoothing. | 844 // FIXME: Need to turn off font smoothing. |
845 | 845 |
846 const ComputedStyle* computedStyle = 0; | 846 const ComputedStyle* computedStyle = 0; |
847 TextDirection direction = | 847 TextDirection direction = |
848 toTextDirection(state().getDirection(), canvas(), &computedStyle); | 848 toTextDirection(state().getDirection(), canvas(), &computedStyle); |
849 bool isRTL = direction == TextDirection::kRtl; | 849 bool isRTL = direction == TextDirection::kRtl; |
850 bool override = | 850 bool override = |
851 computedStyle ? isOverride(computedStyle->unicodeBidi()) : false; | 851 computedStyle ? isOverride(computedStyle->getUnicodeBidi()) : false; |
852 | 852 |
853 TextRun textRun(text, 0, 0, TextRun::AllowTrailingExpansion, direction, | 853 TextRun textRun(text, 0, 0, TextRun::AllowTrailingExpansion, direction, |
854 override); | 854 override); |
855 textRun.setNormalizeSpace(true); | 855 textRun.setNormalizeSpace(true); |
856 // Draw the item text at the correct point. | 856 // Draw the item text at the correct point. |
857 FloatPoint location(x, y + getFontBaseline(fontMetrics)); | 857 FloatPoint location(x, y + getFontBaseline(fontMetrics)); |
858 double fontWidth = font.width(textRun); | 858 double fontWidth = font.width(textRun); |
859 | 859 |
860 bool useMaxWidth = (maxWidth && *maxWidth < fontWidth); | 860 bool useMaxWidth = (maxWidth && *maxWidth < fontWidth); |
861 double width = useMaxWidth ? *maxWidth : fontWidth; | 861 double width = useMaxWidth ? *maxWidth : fontWidth; |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1159 } | 1159 } |
1160 return true; | 1160 return true; |
1161 } | 1161 } |
1162 | 1162 |
1163 void CanvasRenderingContext2D::resetUsageTracking() { | 1163 void CanvasRenderingContext2D::resetUsageTracking() { |
1164 UsageCounters newCounters; | 1164 UsageCounters newCounters; |
1165 m_usageCounters = newCounters; | 1165 m_usageCounters = newCounters; |
1166 } | 1166 } |
1167 | 1167 |
1168 } // namespace blink | 1168 } // namespace blink |
OLD | NEW |