Title: [193934] trunk/Source/WebCore
- Revision
- 193934
- Author
- za...@apple.com
- Date
- 2015-12-10 17:19:03 -0800 (Thu, 10 Dec 2015)
Log Message
Simple line layout: Use TextPainter to draw simple line text.
https://bugs.webkit.org/show_bug.cgi?id=152150
Reviewed by Simon Fraser.
No change in functionality.
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
* rendering/TextPainter.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (193933 => 193934)
--- trunk/Source/WebCore/ChangeLog 2015-12-11 00:31:51 UTC (rev 193933)
+++ trunk/Source/WebCore/ChangeLog 2015-12-11 01:19:03 UTC (rev 193934)
@@ -1,3 +1,16 @@
+2015-12-10 Zalan Bujtas <za...@apple.com>
+
+ Simple line layout: Use TextPainter to draw simple line text.
+ https://bugs.webkit.org/show_bug.cgi?id=152150
+
+ Reviewed by Simon Fraser.
+
+ No change in functionality.
+
+ * rendering/SimpleLineLayoutFunctions.cpp:
+ (WebCore::SimpleLineLayout::paintFlow):
+ * rendering/TextPainter.h:
+
2015-12-10 Myles C. Maxfield <mmaxfi...@apple.com>
[Font Features] r193894 introduces leaks
Modified: trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp (193933 => 193934)
--- trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp 2015-12-11 00:31:51 UTC (rev 193933)
+++ trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp 2015-12-11 01:19:03 UTC (rev 193934)
@@ -42,6 +42,7 @@
#include "SimpleLineLayoutResolver.h"
#include "Text.h"
#include "TextPaintStyle.h"
+#include "TextPainter.h"
#if ENABLE(TREE_DEBUGGING)
#include <stdio.h>
@@ -73,12 +74,10 @@
bool debugBordersEnabled = flow.frame().settings().simpleLineLayoutDebugBordersEnabled();
- GraphicsContext& context = paintInfo.context();
- const FontCascade& font = style.fontCascade();
- TextPaintStyle textPaintStyle = computeTextPaintStyle(flow.frame(), style, paintInfo);
- GraphicsContextStateSaver stateSaver(context, textPaintStyle.strokeWidth > 0);
+ TextPainter textPainter(paintInfo.context());
+ textPainter.setFont(style.fontCascade());
+ textPainter.setTextPaintStyle(computeTextPaintStyle(flow.frame(), style, paintInfo));
- updateGraphicsContext(context, textPaintStyle);
LayoutRect paintRect = paintInfo.rect;
paintRect.moveBy(-paintOffset);
@@ -99,9 +98,9 @@
// x position indicates the line offset from the rootbox. It's always 0 in case of simple line layout.
textRun.setXPos(0);
FloatPoint textOrigin = FloatPoint(rect.x() + paintOffset.x(), roundToDevicePixel(run.baselinePosition() + paintOffset.y(), deviceScaleFactor));
- context.drawText(font, textRun, textOrigin);
+ textPainter.paintText(textRun, textRun.length(), rect, textOrigin);
if (debugBordersEnabled)
- paintDebugBorders(context, LayoutRect(run.rect()), paintOffset);
+ paintDebugBorders(paintInfo.context(), LayoutRect(run.rect()), paintOffset);
}
}
Modified: trunk/Source/WebCore/rendering/TextPainter.h (193933 => 193934)
--- trunk/Source/WebCore/rendering/TextPainter.h 2015-12-11 00:31:51 UTC (rev 193933)
+++ trunk/Source/WebCore/rendering/TextPainter.h 2015-12-11 01:19:03 UTC (rev 193934)
@@ -54,7 +54,7 @@
void addTextShadow(const ShadowData* textShadow, const ShadowData* selectionShadow);
void paintText(const TextRun&, int length, const FloatRect& boxRect, const FloatPoint& textOrigin,
- int selectionStart, int selectionEnd, bool paintSelectedTextOnly, bool paintSelectedTextSeparately);
+ int selectionStart = 0, int selectionEnd = 0, bool paintSelectedTextOnly = false, bool paintSelectedTextSeparately = false);
private:
void drawTextOrEmphasisMarks(const FontCascade&, const TextRun&, const AtomicString& emphasisMark, int emphasisMarkOffset,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes