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; // FIXME: device scale factor settings are layering violations and should
{ // not be used within Blink paint code.
GraphicsContext& paint_context = builder.Context(); float scale_factor = page.DeviceScaleFactorDeprecated();
canvas->save();
// FIXME: device scale factor settings are layering violations and should canvas->scale(scale_factor, scale_factor);
// not be used within Blink paint code.
float scale_factor = page.DeviceScaleFactorDeprecated(); IntRect dirty_rect(rect);
paint_context.SetDeviceScaleFactor(scale_factor); LocalFrameView* view = root.View();
if (view) {
AffineTransform scale; DCHECK(view->GetLayoutView()->GetDocument().Lifecycle().GetState() ==
scale.Scale(scale_factor); DocumentLifecycle::kPaintClean);
TransformRecorder scale_recorder(paint_context, builder, scale); canvas->clipRect(dirty_rect);
IntRect dirty_rect(rect); PaintRecordBuilder builder;
LocalFrameView* view = root.View(); builder.Context().SetDeviceScaleFactor(scale_factor);
if (view) { view->PaintWithLifecycleUpdate(builder.Context(), global_paint_flags,
DCHECK(view->GetLayoutView()->GetDocument().Lifecycle().GetState() == CullRect(dirty_rect));
DocumentLifecycle::kPaintClean); builder.EndRecording(*canvas);
ClipRecorder clip_recorder(paint_context, builder, } else {
DisplayItem::kPageWidgetDelegateClip, PaintFlags flags;
dirty_rect); flags.setColor(SK_ColorWHITE);
view->PaintWithLifecycleUpdate(paint_context, global_paint_flags, canvas->drawRect(dirty_rect, flags);
CullRect(dirty_rect));
} else {
DrawingRecorder recorder(
paint_context, builder,
DisplayItem::kPageWidgetDelegateBackgroundFallback);
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