Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/ScrollableAreaPainter.cpp |
| diff --git a/third_party/WebKit/Source/core/paint/ScrollableAreaPainter.cpp b/third_party/WebKit/Source/core/paint/ScrollableAreaPainter.cpp |
| index 94dea2f946012bb7ed79767469cd526dadcfb809..f2d7302e64a1f19f3939a487836f16b63f72ba81 100644 |
| --- a/third_party/WebKit/Source/core/paint/ScrollableAreaPainter.cpp |
| +++ b/third_party/WebKit/Source/core/paint/ScrollableAreaPainter.cpp |
| @@ -13,6 +13,7 @@ |
| #include "core/paint/PaintLayerScrollableArea.h" |
| #include "core/paint/ScrollbarPainter.h" |
| #include "core/paint/TransformRecorder.h" |
| +#include "platform/HostWindow.h" |
| #include "platform/graphics/GraphicsContext.h" |
| #include "platform/graphics/GraphicsContextStateSaver.h" |
| #include "platform/graphics/paint/ClipRecorder.h" |
| @@ -68,8 +69,13 @@ void ScrollableAreaPainter::paintResizer(GraphicsContext& context, |
| void ScrollableAreaPainter::drawPlatformResizerImage( |
| GraphicsContext& context, |
| IntRect resizerCornerRect) { |
| + // |blink::deviceScaleFactor| returns different values between MAC (2 or 1) |
| + // and other platforms (always 1). For this reason we cannot hardcode the |
| + // value of 1 in the call for |windowToViewportScalar|. Since zoom-for-dsf is |
| + // disabled on MAC, |windowToViewportScalar| will be a no-op on it. |
| float deviceScaleFactor = |
| - blink::deviceScaleFactor(getScrollableArea().box().frame()); |
| + getScrollableArea().getHostWindow()->windowToViewportScalar( |
| + blink::deviceScaleFactor(getScrollableArea().box().frame())); |
| RefPtr<Image> resizeCornerImage; |
| IntSize cornerResizerSize; |
| @@ -78,7 +84,8 @@ void ScrollableAreaPainter::drawPlatformResizerImage( |
| (Image::loadPlatformResource("textAreaResizeCorner@2x"))); |
| resizeCornerImage = resizeCornerImageHiRes; |
| cornerResizerSize = resizeCornerImage->size(); |
| - cornerResizerSize.scale(0.5f); |
| + if (blink::deviceScaleFactor(getScrollableArea().box().frame()) >= 2) |
|
oshima
2017/02/17 16:59:59
nit: cache this value first, like
float oldBlinkD
|
| + cornerResizerSize.scale(0.5f); |
| } else { |
| DEFINE_STATIC_REF(Image, resizeCornerImageLoRes, |
| (Image::loadPlatformResource("textAreaResizeCorner"))); |