Changeset 158279 in webkit
- Timestamp:
- Oct 30, 2013, 10:40:06 AM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r158277 r158279 1 2013-10-30 Antti Koivisto <antti@apple.com> 2 3 Add debug settings for simple line layout 4 https://bugs.webkit.org/show_bug.cgi?id=123514 5 6 Reviewed by Andreas Kling. 7 8 * WebCore.exp.in: 9 * page/Settings.in: 10 11 Add simpleLineLayoutEnabled and simpleLineLayoutDebugBordersEnabled. 12 13 * rendering/SimpleLineLayout.cpp: 14 (WebCore::SimpleLineLayout::canUseFor): 15 * rendering/SimpleLineLayoutFunctions.cpp: 16 (WebCore::SimpleLineLayout::paintDebugBorders): 17 (WebCore::SimpleLineLayout::paintFlow): 18 1 19 2013-10-30 peavo@outlook.com <peavo@outlook.com> 2 20 -
trunk/Source/WebCore/WebCore.exp.in
r158230 r158279 1193 1193 __ZN7WebCore8Settings25setUserStyleSheetLocationERKNS_3URLE 1194 1194 __ZN7WebCore8Settings26defaultMinDOMTimerIntervalEv 1195 __ZN7WebCore8Settings26setSimpleLineLayoutEnabledEb 1195 1196 __ZN7WebCore8Settings27setJavaEnabledForLocalFilesEb 1196 1197 __ZN7WebCore8Settings27setLoadsImagesAutomaticallyEb … … 1207 1208 __ZN7WebCore8Settings37setScrollingPerformanceLoggingEnabledEb 1208 1209 __ZN7WebCore8Settings38setLowPowerVideoAudioBufferSizeEnabledEb 1210 __ZN7WebCore8Settings38setSimpleLineLayoutDebugBordersEnabledEb 1209 1211 __ZN7WebCore8Settings41setAcceleratedCompositedAnimationsEnabledEb 1210 1212 __ZN7WebCore8Settings42setHiddenPageCSSAnimationSuspensionEnabledEb -
trunk/Source/WebCore/page/Settings.in
r158129 r158279 208 208 209 209 minimumZoomFontSize type=float, initial=15, conditional=IOS_TEXT_AUTOSIZING 210 211 simpleLineLayoutEnabled initial=true, setNeedsStyleRecalcInAllFrames=1 212 simpleLineLayoutDebugBordersEnabled initial=false, setNeedsStyleRecalcInAllFrames=1 -
trunk/Source/WebCore/rendering/SimpleLineLayout.cpp
r158268 r158279 28 28 29 29 #include "FontCache.h" 30 #include "Frame.h" 30 31 #include "GraphicsContext.h" 31 32 #include "HitTestLocation.h" … … 39 40 #include "RenderText.h" 40 41 #include "RenderView.h" 42 #include "Settings.h" 41 43 #include "SimpleLineLayoutResolver.h" 42 44 #include "Text.h" … … 60 62 return false; 61 63 #endif 64 if (!flow.frame().settings().simpleLineLayoutEnabled()) 65 return false; 62 66 if (!flow.firstChild()) 63 67 return false; -
trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp
r158268 r158279 28 28 29 29 #include "FontCache.h" 30 #include "Frame.h" 30 31 #include "GraphicsContext.h" 31 32 #include "HitTestLocation.h" … … 38 39 #include "RenderStyle.h" 39 40 #include "RenderText.h" 41 #include "Settings.h" 40 42 #include "SimpleLineLayoutResolver.h" 41 43 #include "Text.h" … … 46 48 namespace SimpleLineLayout { 47 49 50 static void paintDebugBorders(GraphicsContext& context, const LayoutRect& borderRect, const LayoutPoint& paintOffset) 51 { 52 GraphicsContextStateSaver stateSaver(context); 53 context.setStrokeColor(Color(0, 255, 0), ColorSpaceDeviceRGB); 54 context.setFillColor(Color::transparent, ColorSpaceDeviceRGB); 55 IntRect rect(pixelSnappedIntRect(borderRect)); 56 rect.moveBy(flooredIntPoint(paintOffset)); 57 context.drawRect(rect); 58 } 59 48 60 void paintFlow(const RenderBlockFlow& flow, const Layout& layout, PaintInfo& paintInfo, const LayoutPoint& paintOffset) 49 61 { … … 52 64 RenderText& textRenderer = toRenderText(*flow.firstChild()); 53 65 ASSERT(!textRenderer.firstTextBox()); 66 67 bool debugBordersEnabled = flow.frame().settings().simpleLineLayoutDebugBordersEnabled(); 54 68 55 69 RenderStyle& style = flow.style(); … … 67 81 auto run = *it; 68 82 context.drawText(font, TextRun(run.text()), run.baseline() + paintOffset); 83 if (debugBordersEnabled) 84 paintDebugBorders(context, run.rect(), paintOffset); 69 85 } 70 86 } -
trunk/Source/WebKit2/ChangeLog
r158274 r158279 1 2013-10-30 Antti Koivisto <antti@apple.com> 2 3 Add debug settings for simple line layout 4 https://bugs.webkit.org/show_bug.cgi?id=123514 5 6 Reviewed by Andreas Kling. 7 8 Expose debug settings. 9 10 * Shared/WebPreferencesStore.h: 11 * UIProcess/API/C/WKPreferences.cpp: 12 (WKPreferencesSetSimpleLineLayoutEnabled): 13 (WKPreferencesGetSimpleLineLayoutEnabled): 14 (WKPreferencesSetSimpleLineLayoutDebugBordersEnabled): 15 (WKPreferencesGetSimpleLineLayoutDebugBordersEnabled): 16 * UIProcess/API/C/WKPreferencesPrivate.h: 17 * WebProcess/WebPage/WebPage.cpp: 18 (WebKit::WebPage::updatePreferences): 19 1 20 2013-10-30 Anders Carlsson <andersca@apple.com> 2 21 -
trunk/Source/WebKit2/Shared/WebPreferencesStore.h
r157843 r158279 166 166 macro(LowPowerVideoAudioBufferSizeEnabled, lowPowerVideoAudioBufferSizeEnabled, Bool, bool, false) \ 167 167 macro(ThreadedScrollingEnabled, threadedScrollingEnabled, Bool, bool, true) \ 168 macro(SimpleLineLayoutEnabled, simpleLineLayoutEnabled, Bool, bool, true) \ 169 macro(SimpleLineLayoutDebugBordersEnabled, simpleLineLayoutDebugBordersEnabled, Bool, bool, false) \ 168 170 \ 169 171 -
trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
r157843 r158279 1176 1176 return toImpl(preferencesRef)->threadedScrollingEnabled(); 1177 1177 } 1178 1179 void WKPreferencesSetSimpleLineLayoutEnabled(WKPreferencesRef preferencesRef, bool flag) 1180 { 1181 toImpl(preferencesRef)->setSimpleLineLayoutEnabled(flag); 1182 } 1183 1184 bool WKPreferencesGetSimpleLineLayoutEnabled(WKPreferencesRef preferencesRef) 1185 { 1186 return toImpl(preferencesRef)->simpleLineLayoutEnabled(); 1187 } 1188 1189 void WKPreferencesSetSimpleLineLayoutDebugBordersEnabled(WKPreferencesRef preferencesRef, bool flag) 1190 { 1191 toImpl(preferencesRef)->setSimpleLineLayoutDebugBordersEnabled(flag); 1192 } 1193 1194 bool WKPreferencesGetSimpleLineLayoutDebugBordersEnabled(WKPreferencesRef preferencesRef) 1195 { 1196 return toImpl(preferencesRef)->simpleLineLayoutDebugBordersEnabled(); 1197 } -
trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h
r157843 r158279 297 297 WK_EXPORT double WKPreferencesGetIncrementalRenderingSuppressionTimeout(WKPreferencesRef preferencesRef); 298 298 299 // Defaults to true. 300 WK_EXPORT void WKPreferencesSetSimpleLineLayoutEnabled(WKPreferencesRef, bool); 301 WK_EXPORT bool WKPreferencesGetSimpleLineLayoutEnabled(WKPreferencesRef); 302 303 // Defaults to false. 304 WK_EXPORT void WKPreferencesSetSimpleLineLayoutDebugBordersEnabled(WKPreferencesRef, bool); 305 WK_EXPORT bool WKPreferencesGetSimpleLineLayoutDebugBordersEnabled(WKPreferencesRef); 306 299 307 WK_EXPORT void WKPreferencesResetTestRunnerOverrides(WKPreferencesRef preferencesRef); 300 308 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r158210 r158279 2454 2454 2455 2455 settings.setLowPowerVideoAudioBufferSizeEnabled(store.getBoolValueForKey(WebPreferencesKey::lowPowerVideoAudioBufferSizeEnabledKey())); 2456 settings.setSimpleLineLayoutEnabled(store.getBoolValueForKey(WebPreferencesKey::simpleLineLayoutEnabledKey())); 2457 settings.setSimpleLineLayoutDebugBordersEnabled(store.getBoolValueForKey(WebPreferencesKey::simpleLineLayoutDebugBordersEnabledKey())); 2456 2458 2457 2459 platformPreferencesDidChange(store);
Note:
See TracChangeset
for help on using the changeset viewer.