Remote Layer Tree: Double-buffering and minimization of repaints
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Oct 2013 00:51:07 +0000 (00:51 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Oct 2013 00:51:07 +0000 (00:51 +0000)
commit0f141b10ceaca6d7951f5bcaacbe12cb37abc4da
tree5424c7e6b3105f6e82cfba022117c796211f0e04
parentfcb2368d8e63dfc0748843f15dbfc4a7d7dc548c
Remote Layer Tree: Double-buffering and minimization of repaints
https://bugs.webkit.org/show_bug.cgi?id=123043

Reviewed by Simon Fraser.

No new tests, not yet testable.

* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(PlatformCALayerRemote::ensureBackingStore):
Don't worry about isOpaque with RemoteLayerBackingStore; this is a
optimization that is causing trouble; we can re-add it later.

(PlatformCALayerRemote::setBounds):
Make sure that we will repaint if our bounds change.

* WebProcess/WebPage/mac/RemoteLayerBackingStore.h:
(WebKit::RemoteLayerBackingStore::bitmap):
Keep a front and back buffer; return the front buffer when being asked for the bitmap.
Keep a Region of repaint areas.

* WebProcess/WebPage/mac/RemoteLayerBackingStore.mm:
(RemoteLayerBackingStore::RemoteLayerBackingStore):
(RemoteLayerBackingStore::encode):
(RemoteLayerBackingStore::decode):
Serialize only the front buffer, since the UI process only needs that.

(RemoteLayerBackingStore::setNeedsDisplay):
Store repaint rects instead of always setting the whole layer to be dirty.

(RemoteLayerBackingStore::display):
Paint into the back buffer (copying valid parts over from the front buffer),
then swap it to the front buffer. Use drawLayerContents so we get repaint counters, etc.

* WebCore.exp.in:
Export one version of drawLayerContents and Region::contains.

* WebCore.xcodeproj/project.pbxproj:
Expose WebLayer.h as a private header.

* platform/graphics/mac/WebLayer.h:
Clean up this header, and add a new drawLayerContents that can operate without a CALayer.

* platform/graphics/mac/WebLayer.mm:
(WebCore::drawLayerContents):
Split drawLayerContents into one method that acquires properties CALayer,
and one that just does the painting.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157658 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/graphics/mac/WebLayer.h
Source/WebCore/platform/graphics/mac/WebLayer.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerBackingStore.h
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerBackingStore.mm