| Index: Source/web/PageWidgetDelegate.cpp
|
| diff --git a/Source/web/PageWidgetDelegate.cpp b/Source/web/PageWidgetDelegate.cpp
|
| index 73b2f7de150ee05e7245ecc6570677edaf83da6d..1dcf0f1e91710bc73455ca74d6f7a131f26c2961 100644
|
| --- a/Source/web/PageWidgetDelegate.cpp
|
| +++ b/Source/web/PageWidgetDelegate.cpp
|
| @@ -42,8 +42,8 @@
|
| #include "platform/Logging.h"
|
| #include "platform/graphics/GraphicsContext.h"
|
| #include "platform/graphics/paint/ClipRecorder.h"
|
| +#include "platform/graphics/paint/DisplayItemListContextRecorder.h"
|
| #include "platform/graphics/paint/DrawingRecorder.h"
|
| -#include "platform/graphics/paint/SkPictureBuilder.h"
|
| #include "platform/transforms/AffineTransform.h"
|
| #include "public/web/WebInputEvent.h"
|
| #include "web/PageOverlayList.h"
|
| @@ -72,36 +72,34 @@ void PageWidgetDelegate::paint(Page& page, PageOverlayList* overlays, WebCanvas*
|
| if (rect.isEmpty())
|
| return;
|
|
|
| - IntRect intRect(rect);
|
| - SkPictureBuilder builder(intRect);
|
| - GraphicsContext* context = &builder.context();
|
| -
|
| - // FIXME: device scale factor settings are layering violations and should not
|
| - // be used within Blink paint code.
|
| - float scaleFactor = page.deviceScaleFactor();
|
| - context->setDeviceScaleFactor(scaleFactor);
|
| + OwnPtr<GraphicsContext> context = GraphicsContext::deprecatedCreateWithCanvas(canvas);
|
| + {
|
| + DisplayItemListContextRecorder contextRecorder(*context);
|
| + GraphicsContext& paintContext = contextRecorder.context();
|
|
|
| - AffineTransform scale;
|
| - scale.scale(scaleFactor);
|
| + // FIXME: device scale factor settings are layering violations and should not
|
| + // be used within Blink paint code.
|
| + float scaleFactor = page.deviceScaleFactor();
|
| + paintContext.setDeviceScaleFactor(scaleFactor);
|
|
|
| - {
|
| - TransformRecorder scaleRecorder(*context, root, scale);
|
| + AffineTransform scale;
|
| + scale.scale(scaleFactor);
|
| + TransformRecorder scaleRecorder(paintContext, root, scale);
|
|
|
| IntRect dirtyRect(rect);
|
| FrameView* view = root.view();
|
| if (view) {
|
| - ClipRecorder clipRecorder(*context, root, DisplayItem::PageWidgetDelegateClip, LayoutRect(dirtyRect));
|
| + ClipRecorder clipRecorder(paintContext, root, DisplayItem::PageWidgetDelegateClip, LayoutRect(dirtyRect));
|
|
|
| - view->paint(context, dirtyRect);
|
| + view->paint(&paintContext, dirtyRect);
|
| if (overlays)
|
| - overlays->paintWebFrame(*context);
|
| + overlays->paintWebFrame(paintContext);
|
| } else {
|
| - DrawingRecorder drawingRecorder(*context, root, DisplayItem::PageWidgetDelegateBackgroundFallback, dirtyRect);
|
| + DrawingRecorder drawingRecorder(paintContext, root, DisplayItem::PageWidgetDelegateBackgroundFallback, dirtyRect);
|
| if (!drawingRecorder.canUseCachedDrawing())
|
| - context->fillRect(dirtyRect, Color::white);
|
| + paintContext.fillRect(dirtyRect, Color::white);
|
| }
|
| }
|
| - builder.endRecording()->playback(canvas);
|
| }
|
|
|
| bool PageWidgetDelegate::handleInputEvent(PageWidgetEventHandler& handler, const WebInputEvent& event, LocalFrame* root)
|
|
|