diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-12 09:27:39 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-12 09:27:39 +0200 |
commit | 3749d61e1f7a59f5ec5067e560af1eb610c82015 (patch) | |
tree | 73dc228333948738bbe02976cacca8cd382bc978 /Source/WebKit/chromium/src/WebLayerTreeView.cpp | |
parent | b32b4dcd9a51ab8de6afc53d9e17f8707e1f7a5e (diff) | |
download | qtwebkit-3749d61e1f7a59f5ec5067e560af1eb610c82015.tar.gz |
Imported WebKit commit a77350243e054f3460d1137301d8b3faee3d2052 (http://svn.webkit.org/repository/webkit/trunk@125365)
New snapshot with build fixes for latest API changes in Qt and all WK1 Win MSVC fixes upstream
Diffstat (limited to 'Source/WebKit/chromium/src/WebLayerTreeView.cpp')
-rw-r--r-- | Source/WebKit/chromium/src/WebLayerTreeView.cpp | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/Source/WebKit/chromium/src/WebLayerTreeView.cpp b/Source/WebKit/chromium/src/WebLayerTreeView.cpp index b87df0f1b..edd43df20 100644 --- a/Source/WebKit/chromium/src/WebLayerTreeView.cpp +++ b/Source/WebKit/chromium/src/WebLayerTreeView.cpp @@ -24,19 +24,19 @@ */ #include "config.h" -#include "platform/WebLayerTreeView.h" +#include <public/WebLayerTreeView.h> -#include "GraphicsContext3DPrivate.h" #include "LayerChromium.h" #include "WebLayerTreeViewImpl.h" +#include "cc/CCFontAtlas.h" #include "cc/CCGraphicsContext.h" #include "cc/CCLayerTreeHost.h" #include "cc/CCRenderingStats.h" -#include "platform/WebLayer.h" -#include "platform/WebPoint.h" -#include "platform/WebRect.h" -#include "platform/WebSize.h" +#include <public/WebLayer.h> +#include <public/WebPoint.h> +#include <public/WebRect.h> #include <public/WebRenderingStats.h> +#include <public/WebSize.h> using namespace WebCore; @@ -45,10 +45,10 @@ namespace WebKit { WebLayerTreeView::Settings::operator CCLayerTreeSettings() const { CCLayerTreeSettings settings; - settings.forceSoftwareCompositing = forceSoftwareCompositing; settings.showFPSCounter = showFPSCounter; settings.showPlatformLayerTree = showPlatformLayerTree; settings.showPaintRects = showPaintRects; + settings.renderVSyncEnabled = renderVSyncEnabled; settings.refreshRate = refreshRate; settings.defaultTileSize = defaultTileSize; settings.maxUntiledLayerSize = maxUntiledLayerSize; @@ -93,14 +93,22 @@ int WebLayerTreeView::compositorIdentifier() return m_private->layerTreeHost()->compositorIdentifier(); } -void WebLayerTreeView::setViewportSize(const WebSize& viewportSize) +void WebLayerTreeView::setViewportSize(const WebSize& layoutViewportSize, const WebSize& deviceViewportSize) { - m_private->layerTreeHost()->setViewportSize(viewportSize); + if (!deviceViewportSize.isEmpty()) + m_private->layerTreeHost()->setViewportSize(layoutViewportSize, deviceViewportSize); + else + m_private->layerTreeHost()->setViewportSize(layoutViewportSize, layoutViewportSize); +} + +WebSize WebLayerTreeView::layoutViewportSize() const +{ + return WebSize(m_private->layerTreeHost()->layoutViewportSize()); } -WebSize WebLayerTreeView::viewportSize() const +WebSize WebLayerTreeView::deviceViewportSize() const { - return WebSize(m_private->layerTreeHost()->viewportSize()); + return WebSize(m_private->layerTreeHost()->deviceViewportSize()); } void WebLayerTreeView::setDeviceScaleFactor(const float deviceScaleFactor) @@ -188,6 +196,15 @@ void WebLayerTreeView::renderingStats(WebRenderingStats& stats) const stats.totalRasterizeTimeInSeconds = ccStats.totalRasterizeTimeInSeconds; } +void WebLayerTreeView::setFontAtlas(SkBitmap bitmap, WebRect asciiToWebRectTable[128], int fontHeight) +{ + IntRect asciiToRectTable[128]; + for (int i = 0; i < 128; ++i) + asciiToRectTable[i] = asciiToWebRectTable[i]; + OwnPtr<CCFontAtlas> fontAtlas = CCFontAtlas::create(bitmap, asciiToRectTable, fontHeight); + m_private->layerTreeHost()->setFontAtlas(fontAtlas.release()); +} + void WebLayerTreeView::loseCompositorContext(int numTimes) { m_private->layerTreeHost()->loseContext(numTimes); |