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,
if (rect.IsEmpty())
return;
PaintRecordBuilder builder;
{
GraphicsContext& paint_context = builder.Context();
// FIXME: device scale factor settings are layering violations and should
// not be used within Blink paint code.
float scale_factor = page.DeviceScaleFactorDeprecated();
paint_context.SetDeviceScaleFactor(scale_factor);
AffineTransform scale;
scale.Scale(scale_factor);
TransformRecorder scale_recorder(paint_context, builder, scale);
canvas->save();
canvas->scale(scale_factor, scale_factor);
IntRect dirty_rect(rect);
LocalFrameView* view = root.View();
if (view) {
DCHECK(view->GetLayoutView()->GetDocument().Lifecycle().GetState() ==
DocumentLifecycle::kPaintClean);
ClipRecorder clip_recorder(paint_context, builder,
DisplayItem::kPageWidgetDelegateClip,
dirty_rect);
view->PaintWithLifecycleUpdate(paint_context, global_paint_flags,
canvas->clipRect(dirty_rect);
PaintRecordBuilder builder;
builder.Context().SetDeviceScaleFactor(scale_factor);
view->PaintWithLifecycleUpdate(builder.Context(), global_paint_flags,
CullRect(dirty_rect));
builder.EndRecording(*canvas);
} else {
DrawingRecorder recorder(
paint_context, builder,
DisplayItem::kPageWidgetDelegateBackgroundFallback);
paint_context.FillRect(dirty_rect, Color::kWhite);
}
PaintFlags flags;
flags.setColor(SK_ColorWHITE);
canvas->drawRect(dirty_rect, flags);
}
builder.EndRecording(*canvas);
canvas->restore();
}
void PageWidgetDelegate::Paint(Page& page,
......
......@@ -80,7 +80,6 @@ static WTF::String SpecialDrawingTypeAsDebugString(DisplayItem::Type type) {
DEBUG_STRING_CASE(LinkHighlight);
DEBUG_STRING_CASE(ImageAreaFocusRing);
DEBUG_STRING_CASE(PageOverlay);
DEBUG_STRING_CASE(PageWidgetDelegateBackgroundFallback);
DEBUG_STRING_CASE(PopupContainerBorder);
DEBUG_STRING_CASE(PopupListBoxBackground);
DEBUG_STRING_CASE(PopupListBoxRow);
......@@ -152,7 +151,6 @@ static WTF::String ClipTypeAsDebugString(DisplayItem::Type type) {
DEBUG_STRING_CASE(ClipPopupListBoxFrame);
DEBUG_STRING_CASE(ClipScrollbarsToBoxBounds);
DEBUG_STRING_CASE(ClipSelectionImage);
DEBUG_STRING_CASE(PageWidgetDelegateClip);
DEFAULT_CASE;
}
}
......
......@@ -83,7 +83,6 @@ class PLATFORM_EXPORT DisplayItem {
kLinkHighlight,
kImageAreaFocusRing,
kPageOverlay,
kPageWidgetDelegateBackgroundFallback,
kPopupContainerBorder,
kPopupListBoxBackground,
kPopupListBoxRow,
......@@ -140,8 +139,7 @@ class PLATFORM_EXPORT DisplayItem {
kClipPopupListBoxFrame,
kClipScrollbarsToBoxBounds,
kClipSelectionImage,
kPageWidgetDelegateClip,
kClipLast = kPageWidgetDelegateClip,
kClipLast = kClipSelectionImage,
kEndClipFirst,
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