[chromium] Support CCHeadsUpDisplay in threaded compositing mode
authorshawnsingh@chromium.org <shawnsingh@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Apr 2012 18:06:50 +0000 (18:06 +0000)
committershawnsingh@chromium.org <shawnsingh@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Apr 2012 18:06:50 +0000 (18:06 +0000)
commite58b81e123305d274130e22e4730e5205ca81e68
treef7513d19f8ea25ed356bfe98e0b74a4e06951b63
parentacbc74402bf7d2aa37244eb8ceeb7a10b8b86521
[chromium] Support CCHeadsUpDisplay in threaded compositing mode
https://bugs.webkit.org/show_bug.cgi?id=67499

Reviewed by James Robinson.

No new tests because this code is debugging code itself.

The last item that was needed to make the CCHeadsUpDisplay work in
threaded compositing mode was to remove the font rendering code
used on the impl-side thread. To solve this, this patch adds a
CCFontAtlas that is initialized on the main thread (where the font
rendering takes place). Then, when the HUD draws text on the impl
thread, it uses the font atlas directly.

* WebCore.gypi:
* platform/graphics/chromium/LayerRendererChromium.cpp:
(WebCore::LayerRendererChromium::create):
(WebCore::LayerRendererChromium::initialize):
* platform/graphics/chromium/LayerRendererChromium.h:
(WebCore):
(LayerRendererChromium):
* platform/graphics/chromium/cc/CCFontAtlas.cpp: Added.
(WebCore):
(WebCore::CCFontAtlas::CCFontAtlas):
(WebCore::wrapPositionIfNeeded):
(WebCore::CCFontAtlas::generateAtlasForFont):
(WebCore::CCFontAtlas::initialize):
(WebCore::CCFontAtlas::drawText):
(WebCore::CCFontAtlas::drawOneLineOfTextInternal):
(WebCore::CCFontAtlas::drawDebugAtlas):
* platform/graphics/chromium/cc/CCFontAtlas.h: Added.
(WebCore):
(CCFontAtlas):
(WebCore::CCFontAtlas::create):
* platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp:
(WebCore::CCHeadsUpDisplay::CCHeadsUpDisplay):
(WebCore):
(WebCore::CCHeadsUpDisplay::showPlatformLayerTree):
(WebCore::CCHeadsUpDisplay::drawHudContents):
(WebCore::CCHeadsUpDisplay::drawFPSCounter):
(WebCore::CCHeadsUpDisplay::drawFPSCounterText):
(WebCore::CCHeadsUpDisplay::drawPlatformLayerTree):
* platform/graphics/chromium/cc/CCHeadsUpDisplay.h:
(WebCore::CCHeadsUpDisplay::create):
(CCHeadsUpDisplay):
* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::initialize):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(WebCore):
(WebCore::CCLayerTreeHost::headsUpDisplayFontAtlas):
(CCLayerTreeHost):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::initializeLayerRenderer):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
(WebCore):
(CCLayerTreeHostImpl):
* platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
(WebCore::CCSingleThreadProxy::initializeLayerRenderer):
(WebCore::CCSingleThreadProxy::recreateContext):
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::initializeLayerRendererOnImplThread):
(WebCore::CCThreadProxy::recreateContextOnImplThread):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114147 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gypi
Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
Source/WebCore/platform/graphics/chromium/cc/CCFontAtlas.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/chromium/cc/CCFontAtlas.h [new file with mode: 0644]
Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp
Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp
Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp