Commit 0c328363 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

[SPv175] Fix tap disambiguation popup (and perhaps other popups) painting

Previously the scale and clip operations were outputted with
TransformRecorder and ClipRecorder which were no-op on SPv175.
Change them to direct canvas operations.

Bug: 815075
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I0f31640563aa09f37e68028413a7dacbb74f506a
Reviewed-on: https://chromium-review.googlesource.com/957595Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542641}
parent b1148692
...@@ -78,38 +78,31 @@ static void PaintInternal(Page& page, ...@@ -78,38 +78,31 @@ static void PaintInternal(Page& page,
if (rect.IsEmpty()) if (rect.IsEmpty())
return; return;
PaintRecordBuilder builder;
{
GraphicsContext& paint_context = builder.Context();
// FIXME: device scale factor settings are layering violations and should // FIXME: device scale factor settings are layering violations and should
// not be used within Blink paint code. // not be used within Blink paint code.
float scale_factor = page.DeviceScaleFactorDeprecated(); float scale_factor = page.DeviceScaleFactorDeprecated();
paint_context.SetDeviceScaleFactor(scale_factor); canvas->save();
canvas->scale(scale_factor, scale_factor);
AffineTransform scale;
scale.Scale(scale_factor);
TransformRecorder scale_recorder(paint_context, builder, scale);
IntRect dirty_rect(rect); IntRect dirty_rect(rect);
LocalFrameView* view = root.View(); LocalFrameView* view = root.View();
if (view) { if (view) {
DCHECK(view->GetLayoutView()->GetDocument().Lifecycle().GetState() == DCHECK(view->GetLayoutView()->GetDocument().Lifecycle().GetState() ==
DocumentLifecycle::kPaintClean); DocumentLifecycle::kPaintClean);
ClipRecorder clip_recorder(paint_context, builder, canvas->clipRect(dirty_rect);
DisplayItem::kPageWidgetDelegateClip,
dirty_rect); PaintRecordBuilder builder;
view->PaintWithLifecycleUpdate(paint_context, global_paint_flags, builder.Context().SetDeviceScaleFactor(scale_factor);
view->PaintWithLifecycleUpdate(builder.Context(), global_paint_flags,
CullRect(dirty_rect)); CullRect(dirty_rect));
builder.EndRecording(*canvas);
} else { } else {
DrawingRecorder recorder( PaintFlags flags;
paint_context, builder, flags.setColor(SK_ColorWHITE);
DisplayItem::kPageWidgetDelegateBackgroundFallback); canvas->drawRect(dirty_rect, flags);
paint_context.FillRect(dirty_rect, Color::kWhite);
}
} }
builder.EndRecording(*canvas); canvas->restore();
} }
void PageWidgetDelegate::Paint(Page& page, void PageWidgetDelegate::Paint(Page& page,
......
...@@ -80,7 +80,6 @@ static WTF::String SpecialDrawingTypeAsDebugString(DisplayItem::Type type) { ...@@ -80,7 +80,6 @@ static WTF::String SpecialDrawingTypeAsDebugString(DisplayItem::Type type) {
DEBUG_STRING_CASE(LinkHighlight); DEBUG_STRING_CASE(LinkHighlight);
DEBUG_STRING_CASE(ImageAreaFocusRing); DEBUG_STRING_CASE(ImageAreaFocusRing);
DEBUG_STRING_CASE(PageOverlay); DEBUG_STRING_CASE(PageOverlay);
DEBUG_STRING_CASE(PageWidgetDelegateBackgroundFallback);
DEBUG_STRING_CASE(PopupContainerBorder); DEBUG_STRING_CASE(PopupContainerBorder);
DEBUG_STRING_CASE(PopupListBoxBackground); DEBUG_STRING_CASE(PopupListBoxBackground);
DEBUG_STRING_CASE(PopupListBoxRow); DEBUG_STRING_CASE(PopupListBoxRow);
...@@ -152,7 +151,6 @@ static WTF::String ClipTypeAsDebugString(DisplayItem::Type type) { ...@@ -152,7 +151,6 @@ static WTF::String ClipTypeAsDebugString(DisplayItem::Type type) {
DEBUG_STRING_CASE(ClipPopupListBoxFrame); DEBUG_STRING_CASE(ClipPopupListBoxFrame);
DEBUG_STRING_CASE(ClipScrollbarsToBoxBounds); DEBUG_STRING_CASE(ClipScrollbarsToBoxBounds);
DEBUG_STRING_CASE(ClipSelectionImage); DEBUG_STRING_CASE(ClipSelectionImage);
DEBUG_STRING_CASE(PageWidgetDelegateClip);
DEFAULT_CASE; DEFAULT_CASE;
} }
} }
......
...@@ -83,7 +83,6 @@ class PLATFORM_EXPORT DisplayItem { ...@@ -83,7 +83,6 @@ class PLATFORM_EXPORT DisplayItem {
kLinkHighlight, kLinkHighlight,
kImageAreaFocusRing, kImageAreaFocusRing,
kPageOverlay, kPageOverlay,
kPageWidgetDelegateBackgroundFallback,
kPopupContainerBorder, kPopupContainerBorder,
kPopupListBoxBackground, kPopupListBoxBackground,
kPopupListBoxRow, kPopupListBoxRow,
...@@ -140,8 +139,7 @@ class PLATFORM_EXPORT DisplayItem { ...@@ -140,8 +139,7 @@ class PLATFORM_EXPORT DisplayItem {
kClipPopupListBoxFrame, kClipPopupListBoxFrame,
kClipScrollbarsToBoxBounds, kClipScrollbarsToBoxBounds,
kClipSelectionImage, kClipSelectionImage,
kPageWidgetDelegateClip, kClipLast = kClipSelectionImage,
kClipLast = kPageWidgetDelegateClip,
kEndClipFirst, kEndClipFirst,
kEndClipLast = kEndClipFirst + kClipLast - kClipFirst, kEndClipLast = kEndClipFirst + kClipLast - kClipFirst,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment