diff options
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); |