Skip to content
  • shawnsingh@chromium.org's avatar
    [chromium] Support CCHeadsUpDisplay in threaded compositing mode · e58b81e1
    shawnsingh@chromium.org authored
    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
    e58b81e1