+2010-12-27 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ WebKit2 snapshots should contain accelerated content
+ <rdar://problem/8807393>
+ https://bugs.webkit.org/show_bug.cgi?id=51660
+
+ When creating a snapshot, flatten the layer tree for painting so that
+ accelerated content is included in the snapshot.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::snapshotInViewCoordinates):
+ (WebKit::WebPage::snapshotInDocumentCoordinates):
+
2010-12-27 Daniel Bates <dbates@rim.com>
Attempt to fix the WebKit2 Windows build after changeset 74698
frameView->updateLayoutAndStyleIfNeededRecursive();
+ PaintBehavior oldBehavior = frameView->paintBehavior();
+ frameView->setPaintBehavior(oldBehavior | PaintBehaviorFlattenCompositingLayers);
+
RefPtr<WebImage> snapshot = WebImage::create(rect.size(), options);
OwnPtr<WebCore::GraphicsContext> graphicsContext = snapshot->backingStore()->createGraphicsContext();
frameView->paint(graphicsContext.get(), rect);
graphicsContext->restore();
+ frameView->setPaintBehavior(oldBehavior);
+
return snapshot.release();
}
frameView->updateLayoutAndStyleIfNeededRecursive();
+ PaintBehavior oldBehavior = frameView->paintBehavior();
+ frameView->setPaintBehavior(oldBehavior | PaintBehaviorFlattenCompositingLayers);
+
RefPtr<WebImage> snapshot = WebImage::create(rect.size(), options);
OwnPtr<WebCore::GraphicsContext> graphicsContext = snapshot->backingStore()->createGraphicsContext();
frameView->paintContents(graphicsContext.get(), rect);
graphicsContext->restore();
+ frameView->setPaintBehavior(oldBehavior);
+
return snapshot.release();
}