OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 | 1031 |
1032 // FIXME: This ownership should be reversed. We should pass BidiRunList | 1032 // FIXME: This ownership should be reversed. We should pass BidiRunList |
1033 // to BidiResolver in createBidiRunsForLine. | 1033 // to BidiResolver in createBidiRunsForLine. |
1034 BidiRunList<BidiCharacterRun>& bidiRuns = bidiResolver.runs(); | 1034 BidiRunList<BidiCharacterRun>& bidiRuns = bidiResolver.runs(); |
1035 bidiResolver.createBidiRunsForLine(TextRunIterator(&run, run.length())); | 1035 bidiResolver.createBidiRunsForLine(TextRunIterator(&run, run.length())); |
1036 if (!bidiRuns.runCount()) | 1036 if (!bidiRuns.runCount()) |
1037 return; | 1037 return; |
1038 | 1038 |
1039 FloatPoint currPoint = point; | 1039 FloatPoint currPoint = point; |
1040 BidiCharacterRun* bidiRun = bidiRuns.firstRun(); | 1040 BidiCharacterRun* bidiRun = bidiRuns.firstRun(); |
1041 float width = 0; | |
1042 while (bidiRun) { | 1041 while (bidiRun) { |
1043 TextRun subrun = run.subRun(bidiRun->start(), bidiRun->stop() - bidiRun-
>start()); | 1042 TextRun subrun = run.subRun(bidiRun->start(), bidiRun->stop() - bidiRun-
>start()); |
1044 bool isRTL = bidiRun->level() % 2; | 1043 bool isRTL = bidiRun->level() % 2; |
1045 subrun.setDirection(isRTL ? RTL : LTR); | 1044 subrun.setDirection(isRTL ? RTL : LTR); |
1046 subrun.setDirectionalOverride(bidiRun->dirOverride(false)); | 1045 subrun.setDirectionalOverride(bidiRun->dirOverride(false)); |
1047 | 1046 |
1048 TextRunPaintInfo subrunInfo(subrun); | 1047 TextRunPaintInfo subrunInfo(subrun); |
1049 subrunInfo.bounds = runInfo.bounds; | 1048 subrunInfo.bounds = runInfo.bounds; |
1050 width = font.drawText(this, subrunInfo, currPoint, customFontNotReadyAct
ion); | 1049 float runWidth = font.drawUncachedText(this, subrunInfo, currPoint, cust
omFontNotReadyAction); |
1051 | |
1052 | 1050 |
1053 bidiRun = bidiRun->next(); | 1051 bidiRun = bidiRun->next(); |
1054 if (bidiRun) | 1052 currPoint.move(runWidth, 0); |
1055 currPoint.move(width, 0); | |
1056 } | 1053 } |
1057 | 1054 |
1058 bidiRuns.deleteRuns(); | 1055 bidiRuns.deleteRuns(); |
1059 } | 1056 } |
1060 | 1057 |
1061 void GraphicsContext::drawHighlightForText(const Font& font, const TextRun& run,
const FloatPoint& point, int h, const Color& backgroundColor, int from, int to) | 1058 void GraphicsContext::drawHighlightForText(const Font& font, const TextRun& run,
const FloatPoint& point, int h, const Color& backgroundColor, int from, int to) |
1062 { | 1059 { |
1063 if (contextDisabled()) | 1060 if (contextDisabled()) |
1064 return; | 1061 return; |
1065 | 1062 |
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2016 // FIXME: This is to not break tests (it results in the filter bitmap fl
ag | 2013 // FIXME: This is to not break tests (it results in the filter bitmap fl
ag |
2017 // being set to true). We need to decide if we respect InterpolationNone | 2014 // being set to true). We need to decide if we respect InterpolationNone |
2018 // being returned from computeInterpolationQuality. | 2015 // being returned from computeInterpolationQuality. |
2019 resampling = InterpolationLow; | 2016 resampling = InterpolationLow; |
2020 } | 2017 } |
2021 resampling = limitInterpolationQuality(this, resampling); | 2018 resampling = limitInterpolationQuality(this, resampling); |
2022 paint->setFilterLevel(static_cast<SkPaint::FilterLevel>(resampling)); | 2019 paint->setFilterLevel(static_cast<SkPaint::FilterLevel>(resampling)); |
2023 } | 2020 } |
2024 | 2021 |
2025 } // namespace blink | 2022 } // namespace blink |
OLD | NEW |