Set antialias none for paintSelection
authorHyeonji Kim <hyeonji.kim@samsung.com>
Wed, 17 Apr 2013 04:51:36 +0000 (13:51 +0900)
committerHyeonji Kim <hyeonji.kim@samsung.com>
Wed, 17 Apr 2013 09:02:27 +0000 (18:02 +0900)
[Title] Set antialias none for paintSelection
[Issue#] P130411-5033
[Problem] there's a line between the preceding text block and the next text block which are selected
[Cause] there's antialias during zoom in/out
[Solution] set antialias none for paintSelection

Change-Id: Ie2b88ce0fc5e0924c6bd68ba717a8d2907d05b9b

Source/WTF/wtf/Platform.h
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/RenderBlock.cpp

index 7bcdc33..64d7288 100644 (file)
 #define ENABLE_TIZEN_DONT_DISPATCH_FAKEMOUSEMOVEEVENT_WHEN_SCROLLING_ON_TOUCH_DEVICES 1 /* Jaehun Lim (ljaehun.lim@samsung.com) : Don't dispatch fake mouse move events on touch devices for fixing hover problem */
 #define ENABLE_TIZEN_LOAD_HTML_STRING_AS_UTF8 1 /* KwangYong Choi (ky0.choi@samsung.com) : Use UTF-8 instead of UTF-16 when the page is loaded by WebPage::loadHTMLString() */
 #define ENABLE_TIZEN_DRAW_SCALED_PATTERN 1 /* Kyungjin Kim(gen.kim@samsung.com) : Scale image prior to draw it's pattern to enhance performance */
+#define ENABLE_TIZEN_PAINT_SELECTION_ANTIALIAS_NONE 1 /* Hyeonji Kim(hyeonji.kim@samsung.com) : Remove the line between the preceding text block and the next text block which are selected */
 
 /* Download Patches */
 #define ENABLE_TIZEN_DOWNLOAD 1 /* Keunsoon Lee(keunsoon.lee@samsung.com) : */
index 9dfbde5..6edcd1b 100644 (file)
@@ -890,7 +890,14 @@ void InlineTextBox::paintSelection(GraphicsContext* context, const FloatPoint& b
 
     context->clip(clipRect);
 
+#if ENABLE(TIZEN_PAINT_SELECTION_ANTIALIAS_NONE)
+    bool antialias = context->shouldAntialias();
+    context->setShouldAntialias(false);
     context->drawHighlightForText(font, textRun, localOrigin, selHeight, c, style->colorSpace(), sPos, ePos);
+    context->setShouldAntialias(antialias);
+#else
+    context->drawHighlightForText(font, textRun, localOrigin, selHeight, c, style->colorSpace(), sPos, ePos);
+#endif
 }
 
 #if ENABLE(TIZEN_WEBKIT2_SUPPORT_JAPANESE_IME)
index 01f2767..e27e6b6 100755 (executable)
@@ -3239,6 +3239,7 @@ GapRects RenderBlock::selectionGapRectsForRepaint(RenderBoxModelObject* repaintC
 
 void RenderBlock::paintSelection(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
 {
+#if !ENABLE(TIZEN_PAINT_SELECTION_ANTIALIAS_NONE)
     if (shouldPaintSelectionGaps() && paintInfo.phase == PaintPhaseForeground) {
         LayoutUnit lastTop = 0;
         LayoutUnit lastLeft = logicalLeftSelectionOffset(this, lastTop);
@@ -3260,6 +3261,7 @@ void RenderBlock::paintSelection(PaintInfo& paintInfo, const LayoutPoint& paintO
             }
         }
     }
+#endif
 }
 
 static void clipOutPositionedObjects(const PaintInfo* paintInfo, const LayoutPoint& offset, RenderBlock::PositionedObjectsListHashSet* positionedObjects)