Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Side by Side Diff: sky/engine/platform/graphics/GraphicsContext.cpp

Issue 859203002: Merge Blink code to cache SkTextBlob (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: hashmap Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 900 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 FloatPoint currPoint = point; 911 FloatPoint currPoint = point;
912 BidiCharacterRun* bidiRun = bidiRuns.firstRun(); 912 BidiCharacterRun* bidiRun = bidiRuns.firstRun();
913 while (bidiRun) { 913 while (bidiRun) {
914 TextRun subrun = run.subRun(bidiRun->start(), bidiRun->stop() - bidiRun- >start()); 914 TextRun subrun = run.subRun(bidiRun->start(), bidiRun->stop() - bidiRun- >start());
915 bool isRTL = bidiRun->level() % 2; 915 bool isRTL = bidiRun->level() % 2;
916 subrun.setDirection(isRTL ? RTL : LTR); 916 subrun.setDirection(isRTL ? RTL : LTR);
917 subrun.setDirectionalOverride(bidiRun->dirOverride()); 917 subrun.setDirectionalOverride(bidiRun->dirOverride());
918 918
919 TextRunPaintInfo subrunInfo(subrun); 919 TextRunPaintInfo subrunInfo(subrun);
920 subrunInfo.bounds = runInfo.bounds; 920 subrunInfo.bounds = runInfo.bounds;
921 font.drawText(this, subrunInfo, currPoint, customFontNotReadyAction); 921 float runWidth = font.drawUncachedText(this, subrunInfo, currPoint, cust omFontNotReadyAction);
922 922
923 bidiRun = bidiRun->next(); 923 bidiRun = bidiRun->next();
924 // FIXME: Have Font::drawText return the width of what it drew so that w e don't have to re-measure here. 924 currPoint.move(runWidth, 0);
925 if (bidiRun)
926 currPoint.move(font.width(subrun), 0);
927 } 925 }
928 926
929 bidiRuns.deleteRuns(); 927 bidiRuns.deleteRuns();
930 } 928 }
931 929
932 void GraphicsContext::drawHighlightForText(const Font& font, const TextRun& run, const FloatPoint& point, int h, const Color& backgroundColor, int from, int to) 930 void GraphicsContext::drawHighlightForText(const Font& font, const TextRun& run, const FloatPoint& point, int h, const Color& backgroundColor, int from, int to)
933 { 931 {
934 if (contextDisabled()) 932 if (contextDisabled())
935 return; 933 return;
936 934
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after
1835 // FIXME: This is to not break tests (it results in the filter bitmap fl ag 1833 // FIXME: This is to not break tests (it results in the filter bitmap fl ag
1836 // being set to true). We need to decide if we respect InterpolationNone 1834 // being set to true). We need to decide if we respect InterpolationNone
1837 // being returned from computeInterpolationQuality. 1835 // being returned from computeInterpolationQuality.
1838 resampling = InterpolationLow; 1836 resampling = InterpolationLow;
1839 } 1837 }
1840 resampling = limitInterpolationQuality(this, resampling); 1838 resampling = limitInterpolationQuality(this, resampling);
1841 paint->setFilterLevel(static_cast<SkPaint::FilterLevel>(resampling)); 1839 paint->setFilterLevel(static_cast<SkPaint::FilterLevel>(resampling));
1842 } 1840 }
1843 1841
1844 } // namespace blink 1842 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/platform/fonts/harfbuzz/HarfBuzzShaper.cpp ('k') | sky/engine/platform/text/TextRun.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698