void PageWidgetDelegate::animate(Page* page, double monotonicFrameBeginTime) { RefPtr<FrameView> view = mainFrameView(page); if (!view) return; page->autoscrollController().animate(monotonicFrameBeginTime); page->animator().serviceScriptedAnimations(monotonicFrameBeginTime); }
void PageWidgetDelegate::animate(Page* page, double monotonicFrameBeginTime) { #if ENABLE(REQUEST_ANIMATION_FRAME) FrameView* view = mainFrameView(page); if (!view) return; view->serviceScriptedAnimations(monotonicFrameBeginTime); #endif }
void PageWidgetDelegate::animate(Page* page, double monotonicFrameBeginTime) { #if ENABLE(REQUEST_ANIMATION_FRAME) FrameView* view = mainFrameView(page); if (!view) return; double timeShift = currentTime() - monotonicallyIncreasingTime(); view->serviceScriptedAnimations(convertSecondsToDOMTimeStamp(monotonicFrameBeginTime + timeShift)); #endif }
void PageWidgetDelegate::layout(Page* page) { FrameView* view = mainFrameView(page); if (!view) return; // In order for our child HWNDs (NativeWindowWidgets) to update properly, // they need to be told that we are updating the screen. The problem is that // the native widgets need to recalculate their clip region and not overlap // any of our non-native widgets. To force the resizing, call // setFrameRect(). This will be a quick operation for most frames, but the // NativeWindowWidgets will update a proper clipping region. view->setFrameRect(view->frameRect()); // setFrameRect may have the side-effect of causing existing page layout to // be invalidated, so layout needs to be called last. view->updateLayoutAndStyleIfNeededRecursive(); }
void PageWidgetDelegate::paint(Page* page, PageOverlayList* overlays, WebCanvas* canvas, const WebRect& rect, CanvasBackground background) { if (rect.isEmpty()) return; GraphicsContextBuilder builder(canvas); GraphicsContext& gc = builder.context(); gc.platformContext()->setDrawingToImageBuffer(background == Opaque ? false : true); gc.applyDeviceScaleFactor(page->deviceScaleFactor()); IntRect dirtyRect(rect); gc.save(); FrameView* view = mainFrameView(page); // FIXME: Can we remove the mainFrame()->document() check? if (view && page->mainFrame()->document()) { gc.clip(dirtyRect); view->paint(&gc, dirtyRect); if (overlays) overlays->paintWebFrame(gc); } else gc.fillRect(dirtyRect, Color::white, ColorSpaceDeviceRGB); gc.restore(); }
void PageWidgetDelegate::paint(Page* page, PageOverlayList* overlays, WebCanvas* canvas, const WebRect& rect, CanvasBackground background) { if (rect.isEmpty()) return; GraphicsContext gc(canvas); gc.setCertainlyOpaque(background == Opaque); gc.applyDeviceScaleFactor(page->deviceScaleFactor()); gc.setUseHighResMarkers(page->deviceScaleFactor() > 1.5f); IntRect dirtyRect(rect); gc.save(); // Needed to save the canvas, not the GraphicsContext. FrameView* view = mainFrameView(page); // FIXME: Can we remove the mainFrame()->document() check? if (view && page->mainFrame()->document()) { gc.clip(dirtyRect); view->paint(&gc, dirtyRect); if (overlays) overlays->paintWebFrame(gc); } else { gc.fillRect(dirtyRect, Color::white); } gc.restore(); }
void PageWidgetDelegate::layout(Page* page) { RefPtr<FrameView> view = mainFrameView(page); if (!view) return; // In order for our child HWNDs (NativeWindowWidgets) to update properly, // they need to be told that we are updating the screen. The problem is that // the native widgets need to recalculate their clip region and not overlap // any of our non-native widgets. To force the resizing, call // setFrameRect(). This will be a quick operation for most frames, but the // NativeWindowWidgets will update a proper clipping region. view->setFrameRect(view->frameRect()); // setFrameRect may have the side-effect of causing existing page layout to // be invalidated, so layout needs to be called last. view->updateLayoutAndStyleIfNeededRecursive(); // For now, as we know this is the point in code where the compositor has // actually asked for Blink to update the composited layer tree. So finally // do all the deferred work for updateCompositingLayers() here. if (RenderView* renderView = view->renderView()) renderView->compositor()->updateCompositingLayers(CompositingUpdateFinishAllDeferredWork); }
void WebPage::getCenterForZoomGesture(const IntPoint& centerInViewCoordinates, IntPoint& result) { result = mainFrameView()->rootViewToContents(centerInViewCoordinates); double scale = m_page->pageScaleFactor(); result.scale(1 / scale, 1 / scale); }