Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1184)

Unified Diff: Source/web/PageWidgetDelegate.cpp

Issue 1162603005: Most tests are failing on all the android perfbots. The logs look like a crash. Example: (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698