From 95bf3566a88b6b6f40f3fafb50f49e2e79075cd4 Mon Sep 17 00:00:00 2001 From: "weinig@apple.com" Date: Tue, 28 Dec 2010 01:39:28 +0000 Subject: [PATCH] WebKit2 snapshots should contain accelerated content https://bugs.webkit.org/show_bug.cgi?id=51660 Reviewed by Anders Carlsson. 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): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@74704 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- WebKit2/ChangeLog | 15 +++++++++++++++ WebKit2/WebProcess/WebPage/WebPage.cpp | 10 ++++++++++ 2 files changed, 25 insertions(+) diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog index 6886d293ebee..2dfb09f94341 100644 --- a/WebKit2/ChangeLog +++ b/WebKit2/ChangeLog @@ -1,3 +1,18 @@ +2010-12-27 Sam Weinig + + Reviewed by Anders Carlsson. + + WebKit2 snapshots should contain accelerated content + + 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 Attempt to fix the WebKit2 Windows build after changeset 74698 diff --git a/WebKit2/WebProcess/WebPage/WebPage.cpp b/WebKit2/WebProcess/WebPage/WebPage.cpp index 571321c1f9fb..96b701df6856 100644 --- a/WebKit2/WebProcess/WebPage/WebPage.cpp +++ b/WebKit2/WebProcess/WebPage/WebPage.cpp @@ -596,6 +596,9 @@ PassRefPtr WebPage::snapshotInViewCoordinates(const IntRect& rect, Ima frameView->updateLayoutAndStyleIfNeededRecursive(); + PaintBehavior oldBehavior = frameView->paintBehavior(); + frameView->setPaintBehavior(oldBehavior | PaintBehaviorFlattenCompositingLayers); + RefPtr snapshot = WebImage::create(rect.size(), options); OwnPtr graphicsContext = snapshot->backingStore()->createGraphicsContext(); @@ -604,6 +607,8 @@ PassRefPtr WebPage::snapshotInViewCoordinates(const IntRect& rect, Ima frameView->paint(graphicsContext.get(), rect); graphicsContext->restore(); + frameView->setPaintBehavior(oldBehavior); + return snapshot.release(); } @@ -615,6 +620,9 @@ PassRefPtr WebPage::snapshotInDocumentCoordinates(const IntRect& rect, frameView->updateLayoutAndStyleIfNeededRecursive(); + PaintBehavior oldBehavior = frameView->paintBehavior(); + frameView->setPaintBehavior(oldBehavior | PaintBehaviorFlattenCompositingLayers); + RefPtr snapshot = WebImage::create(rect.size(), options); OwnPtr graphicsContext = snapshot->backingStore()->createGraphicsContext(); @@ -623,6 +631,8 @@ PassRefPtr WebPage::snapshotInDocumentCoordinates(const IntRect& rect, frameView->paintContents(graphicsContext.get(), rect); graphicsContext->restore(); + frameView->setPaintBehavior(oldBehavior); + return snapshot.release(); } -- 2.36.0