diff options
| author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-20 13:01:08 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-20 13:01:08 +0200 |
| commit | 49233e234e5c787396cadb2cea33b31ae0cd65c1 (patch) | |
| tree | 5410cb9a8fd53168bb60d62c54b654d86f03c38d /Source/WebKit2/WebProcess/WebPage/mac | |
| parent | b211c645d8ab690f713515dfdc84d80b11c27d2c (diff) | |
| download | qtwebkit-49233e234e5c787396cadb2cea33b31ae0cd65c1.tar.gz | |
Imported WebKit commit 3a8c29f35d00659d2ce7a0ccdfa8304f14e82327 (http://svn.webkit.org/repository/webkit/trunk@120813)
New snapshot with Windows build fixes
Diffstat (limited to 'Source/WebKit2/WebProcess/WebPage/mac')
3 files changed, 34 insertions, 2 deletions
diff --git a/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h b/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h index 9d0b0779e..4a4e06709 100644 --- a/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h +++ b/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h @@ -85,6 +85,7 @@ private: virtual void updateGeometry(const WebCore::IntSize& viewSize) OVERRIDE; virtual void setDeviceScaleFactor(float) OVERRIDE; virtual void setLayerHostingMode(uint32_t) OVERRIDE; + virtual void setColorSpace(const ColorSpaceData&) OVERRIDE; void updateLayerHostingContext(); @@ -97,7 +98,7 @@ private: WebCore::LayerFlushScheduler m_layerFlushScheduler; OwnPtr<LayerHostingContext> m_layerHostingContext; - + RetainPtr<CALayer> m_rootLayer; RetainPtr<CALayer> m_pendingRootCompositingLayer; diff --git a/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm b/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm index 5ed96e13d..2254152ca 100644 --- a/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm +++ b/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm @@ -28,6 +28,7 @@ #if ENABLE(THREADED_SCROLLING) +#import "ColorSpaceData.h" #import "DrawingAreaProxyMessages.h" #import "EventDispatcher.h" #import "LayerHostingContext.h" @@ -40,6 +41,7 @@ #import <WebCore/Frame.h> #import <WebCore/FrameView.h> #import <WebCore/GraphicsContext.h> +#import <WebCore/GraphicsLayerCA.h> #import <WebCore/Page.h> #import <WebCore/RenderLayerCompositor.h> #import <WebCore/RenderView.h> @@ -84,7 +86,8 @@ TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea(WebPage* webPage, c m_rootLayer.get().geometryFlipped = YES; updateLayerHostingContext(); - + setColorSpace(parameters.colorSpace); + LayerTreeContext layerTreeContext; layerTreeContext.contextID = m_layerHostingContext->contextID(); m_webPage->send(Messages::DrawingAreaProxy::EnterAcceleratedCompositingMode(0, layerTreeContext)); @@ -364,10 +367,18 @@ void TiledCoreAnimationDrawingArea::setLayerHostingMode(uint32_t opaqueLayerHost m_webPage->send(Messages::DrawingAreaProxy::UpdateAcceleratedCompositingMode(0, layerTreeContext)); } +void TiledCoreAnimationDrawingArea::setColorSpace(const ColorSpaceData& colorSpace) +{ + m_layerHostingContext->setColorSpace(colorSpace.cgColorSpace.get()); +} + void TiledCoreAnimationDrawingArea::updateLayerHostingContext() { + RetainPtr<CGColorSpaceRef> colorSpace; + // Invalidate the old context. if (m_layerHostingContext) { + colorSpace = m_layerHostingContext->colorSpace(); m_layerHostingContext->invalidate(); m_layerHostingContext = nullptr; } @@ -385,6 +396,8 @@ void TiledCoreAnimationDrawingArea::updateLayerHostingContext() } m_layerHostingContext->setRootLayer(m_rootLayer.get()); + if (colorSpace) + m_layerHostingContext->setColorSpace(colorSpace.get()); } void TiledCoreAnimationDrawingArea::setRootCompositingLayer(CALayer *layer) @@ -415,6 +428,9 @@ void TiledCoreAnimationDrawingArea::createPageOverlayLayer() m_pageOverlayLayer->setName("page overlay content"); #endif + // We don't ever want the overlay layer to become tiled because that will look bad, and + // we also never expect the underlying CALayer to change. + static_cast<GraphicsLayerCA*>(m_pageOverlayLayer.get())->setAllowTiledLayer(false); m_pageOverlayLayer->setAcceleratesDrawing(true); m_pageOverlayLayer->setDrawsContent(true); m_pageOverlayLayer->setSize(m_webPage->size()); diff --git a/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm b/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm index 9e0c13775..22eede843 100644 --- a/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm +++ b/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm @@ -290,6 +290,21 @@ void WebPage::insertText(const String& text, uint64_t replacementRangeStart, uin newState = editorState(); } +void WebPage::insertDictatedText(const String& text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, const Vector<WebCore::DictationAlternative>& dictationAlternativeLocations, bool& handled, EditorState& newState) +{ + Frame* frame = m_page->focusController()->focusedOrMainFrame(); + + if (replacementRangeStart != NSNotFound) { + RefPtr<Range> replacementRange = convertToRange(frame, NSMakeRange(replacementRangeStart, replacementRangeEnd - replacementRangeStart)); + if (replacementRange) + frame->selection()->setSelection(VisibleSelection(replacementRange.get(), SEL_DEFAULT_AFFINITY)); + } + + ASSERT(!frame->editor()->hasComposition()); + handled = frame->editor()->insertDictatedText(text, dictationAlternativeLocations, m_keyboardEventBeingInterpreted); + newState = editorState(); +} + void WebPage::getMarkedRange(uint64_t& location, uint64_t& length) { location = NSNotFound; |
