diff options
Diffstat (limited to 'chromium/third_party/WebKit/Source/web')
4 files changed, 24 insertions, 204 deletions
diff --git a/chromium/third_party/WebKit/Source/web/WebPagePopupImpl.cpp b/chromium/third_party/WebKit/Source/web/WebPagePopupImpl.cpp index cadbc144e41..b129dc6e10e 100644 --- a/chromium/third_party/WebKit/Source/web/WebPagePopupImpl.cpp +++ b/chromium/third_party/WebKit/Source/web/WebPagePopupImpl.cpp @@ -138,16 +138,6 @@ private: m_popup->widgetClient()->hasTouchEventHandlers(needsTouchEvents); } - virtual GraphicsLayerFactory* graphicsLayerFactory() const OVERRIDE - { - return m_popup->m_webView->graphicsLayerFactory(); - } - - virtual void attachRootGraphicsLayer(Frame*, GraphicsLayer* graphicsLayer) OVERRIDE - { - m_popup->setRootGraphicsLayer(graphicsLayer); - } - WebPagePopupImpl* m_popup; }; @@ -167,10 +157,6 @@ bool PagePopupFeaturesClient::isEnabled(Document*, ContextFeatures::FeatureType WebPagePopupImpl::WebPagePopupImpl(WebWidgetClient* client) : m_widgetClient(client) , m_closing(false) - , m_layerTreeView(0) - , m_rootLayer(0) - , m_rootGraphicsLayer(0) - , m_isAcceleratedCompositingActive(false) { ASSERT(client); } @@ -238,49 +224,6 @@ void WebPagePopupImpl::destroyPage() m_page.clear(); } -void WebPagePopupImpl::setRootGraphicsLayer(GraphicsLayer* layer) -{ - m_rootGraphicsLayer = layer; - m_rootLayer = layer ? layer->platformLayer() : 0; - - setIsAcceleratedCompositingActive(layer); - if (m_layerTreeView) { - if (m_rootLayer) { - m_layerTreeView->setRootLayer(*m_rootLayer); - } else { - m_layerTreeView->clearRootLayer(); - } - } -} - -void WebPagePopupImpl::setIsAcceleratedCompositingActive(bool enter) -{ - if (m_isAcceleratedCompositingActive == enter) - return; - - if (!enter) { - m_isAcceleratedCompositingActive = false; - m_widgetClient->didDeactivateCompositor(); - } else if (m_layerTreeView) { - m_isAcceleratedCompositingActive = true; - m_widgetClient->didActivateCompositor(0); - } else { - TRACE_EVENT0("webkit", "WebPagePopupImpl::setIsAcceleratedCompositingActive(true)"); - - m_widgetClient->initializeLayerTreeView(); - m_layerTreeView = m_widgetClient->layerTreeView(); - if (m_layerTreeView) { - m_layerTreeView->setVisible(true); - m_widgetClient->didActivateCompositor(0); - m_isAcceleratedCompositingActive = true; - m_layerTreeView->setDeviceScaleFactor(m_widgetClient->deviceScaleFactor()); - } else { - m_isAcceleratedCompositingActive = false; - m_widgetClient->didDeactivateCompositor(); - } - } -} - WebSize WebPagePopupImpl::size() { return m_popupClient->contentSize(); @@ -291,36 +234,6 @@ void WebPagePopupImpl::animate(double) PageWidgetDelegate::animate(m_page.get(), monotonicallyIncreasingTime()); } -void WebPagePopupImpl::enterForceCompositingMode(bool enter) -{ - if (m_page->settings().forceCompositingMode() == enter) - return; - - TRACE_EVENT1("webkit", "WebPagePopupImpl::enterForceCompositingMode", "enter", enter); - m_page->settings().setForceCompositingMode(enter); - if (enter) { - if (!m_page) - return; - Frame* mainFrame = m_page->mainFrame(); - if (!mainFrame) - return; - mainFrame->view()->updateCompositingLayersAfterStyleChange(); - } -} - -void WebPagePopupImpl::didExitCompositingMode() -{ - setIsAcceleratedCompositingActive(false); - m_widgetClient->didInvalidateRect(IntRect(0, 0, size().width, size().height)); - m_page->mainFrame()->document()->setNeedsStyleRecalc(SubtreeStyleChange); -} - -void WebPagePopupImpl::willCloseLayerTreeView() -{ - setIsAcceleratedCompositingActive(false); - m_layerTreeView = 0; -} - void WebPagePopupImpl::layout() { PageWidgetDelegate::layout(m_page.get()); diff --git a/chromium/third_party/WebKit/Source/web/WebPagePopupImpl.h b/chromium/third_party/WebKit/Source/web/WebPagePopupImpl.h index 050f3aeb373..660c47f75ff 100644 --- a/chromium/third_party/WebKit/Source/web/WebPagePopupImpl.h +++ b/chromium/third_party/WebKit/Source/web/WebPagePopupImpl.h @@ -38,7 +38,6 @@ #include "wtf/RefCounted.h" namespace WebCore { -class GraphicsLayer; class Page; class PagePopupClient; class PlatformKeyboardEvent; @@ -47,8 +46,6 @@ class PlatformKeyboardEvent; namespace blink { class PagePopupChromeClient; -class WebLayerTreeView; -class WebLayer; class WebViewImpl; class WebPagePopupImpl : public WebPagePopup, @@ -71,9 +68,6 @@ private: virtual WebSize size() OVERRIDE; virtual void animate(double) OVERRIDE; virtual void layout() OVERRIDE; - virtual void enterForceCompositingMode(bool enter) OVERRIDE; - virtual void didExitCompositingMode() OVERRIDE; - virtual void willCloseLayerTreeView() OVERRIDE; virtual void paint(WebCanvas*, const WebRect&, PaintOptions = ReadbackFromCompositorIfAvailable) OVERRIDE; virtual void resize(const WebSize&) OVERRIDE; virtual void close() OVERRIDE; @@ -89,8 +83,6 @@ private: explicit WebPagePopupImpl(WebWidgetClient*); bool initializePage(); void destroyPage(); - void setRootGraphicsLayer(WebCore::GraphicsLayer*); - void setIsAcceleratedCompositingActive(bool enter); WebWidgetClient* m_widgetClient; WebRect m_windowRectInScreen; @@ -100,11 +92,6 @@ private: WebCore::PagePopupClient* m_popupClient; bool m_closing; - WebLayerTreeView* m_layerTreeView; - WebLayer* m_rootLayer; - WebCore::GraphicsLayer* m_rootGraphicsLayer; - bool m_isAcceleratedCompositingActive; - friend class WebPagePopup; friend class PagePopupChromeClient; }; diff --git a/chromium/third_party/WebKit/Source/web/WebPopupMenuImpl.cpp b/chromium/third_party/WebKit/Source/web/WebPopupMenuImpl.cpp index e8adfd7c0df..05c1d05281a 100644 --- a/chromium/third_party/WebKit/Source/web/WebPopupMenuImpl.cpp +++ b/chromium/third_party/WebKit/Source/web/WebPopupMenuImpl.cpp @@ -49,10 +49,6 @@ #include "platform/graphics/GraphicsContext.h" #include "platform/graphics/skia/SkiaUtils.h" #include "platform/scroll/FramelessScrollView.h" -#include "public/platform/Platform.h" -#include "public/platform/WebCompositorSupport.h" -#include "public/platform/WebContentLayer.h" -#include "public/platform/WebLayerTreeView.h" #include "public/platform/WebRect.h" #include <skia/ext/platform_canvas.h> @@ -72,10 +68,6 @@ WebPopupMenu* WebPopupMenu::create(WebWidgetClient* client) WebPopupMenuImpl::WebPopupMenuImpl(WebWidgetClient* client) : m_client(client) - , m_layerTreeView(0) - , m_isAcceleratedCompositingActive(false) - // Set to impossible point so we always get the first mouse position. - , m_lastMousePosition(WebPoint(-1, -1)) , m_widget(0) { // Set to impossible point so we always get the first mouse position. @@ -88,12 +80,6 @@ WebPopupMenuImpl::~WebPopupMenuImpl() m_widget->setClient(0); } -void WebPopupMenuImpl::willCloseLayerTreeView() -{ - enterForceCompositingMode(false); - m_layerTreeView = 0; -} - void WebPopupMenuImpl::initialize(FramelessScrollView* widget, const WebRect& bounds) { m_widget = widget; @@ -188,9 +174,6 @@ void WebPopupMenuImpl::resize(const WebSize& newSize) WebRect damagedRect(0, 0, m_size.width, m_size.height); m_client->didInvalidateRect(damagedRect); } - - if (m_rootLayer) - m_rootLayer->layer()->setBounds(newSize); } void WebPopupMenuImpl::willEndLiveResize() @@ -205,54 +188,6 @@ void WebPopupMenuImpl::layout() { } -void WebPopupMenuImpl::enterForceCompositingMode(bool enter) -{ - if (m_isAcceleratedCompositingActive == enter) - return; - - if (!enter) { - m_isAcceleratedCompositingActive = false; - m_client->didDeactivateCompositor(); - } else if (m_layerTreeView) { - m_isAcceleratedCompositingActive = true; - m_client->didActivateCompositor(0); - } else { - TRACE_EVENT0("webkit", "WebPopupMenuImpl::enterForceCompositingMode(true)"); - - m_client->initializeLayerTreeView(); - m_layerTreeView = m_client->layerTreeView(); - if (m_layerTreeView) { - m_layerTreeView->setVisible(true); - m_client->didActivateCompositor(0); - m_isAcceleratedCompositingActive = true; - m_layerTreeView->setDeviceScaleFactor(m_client->deviceScaleFactor()); - m_rootLayer = adoptPtr(Platform::current()->compositorSupport()->createContentLayer(this)); - m_rootLayer->layer()->setBounds(m_size); - m_layerTreeView->setRootLayer(*m_rootLayer->layer()); - } else { - m_isAcceleratedCompositingActive = false; - m_client->didDeactivateCompositor(); - } - } -} - -void WebPopupMenuImpl::didExitCompositingMode() -{ - enterForceCompositingMode(false); - m_client->didInvalidateRect(IntRect(0, 0, m_size.width, m_size.height)); -} - -void WebPopupMenuImpl::paintContents(WebCanvas* canvas, const WebRect& rect, bool, WebFloatRect&) -{ - if (!m_widget) - return; - - if (!rect.isEmpty()) { - GraphicsContext context(canvas); - m_widget->paint(&context, rect); - } -} - void WebPopupMenuImpl::paint(WebCanvas* canvas, const WebRect& rect, PaintOptions) { if (!m_widget) @@ -408,8 +343,6 @@ void WebPopupMenuImpl::invalidateContentsAndRootView(const IntRect& paintRect) return; if (m_client) m_client->didInvalidateRect(paintRect); - if (m_rootLayer) - m_rootLayer->layer()->invalidateRect(FloatRect(paintRect)); } void WebPopupMenuImpl::invalidateContentsForSlowScroll(const IntRect& updateRect) @@ -428,8 +361,6 @@ void WebPopupMenuImpl::scroll(const IntSize& scrollDelta, const IntRect& scrollR int dy = scrollDelta.height(); m_client->didScrollRect(dx, dy, clipRect); } - if (m_rootLayer) - m_rootLayer->layer()->invalidateRect(FloatRect(clipRect)); } IntPoint WebPopupMenuImpl::screenToRootView(const IntPoint& point) const diff --git a/chromium/third_party/WebKit/Source/web/WebPopupMenuImpl.h b/chromium/third_party/WebKit/Source/web/WebPopupMenuImpl.h index 0384675c75e..e5777bea8ce 100644 --- a/chromium/third_party/WebKit/Source/web/WebPopupMenuImpl.h +++ b/chromium/third_party/WebKit/Source/web/WebPopupMenuImpl.h @@ -33,7 +33,6 @@ #include "WebPopupMenu.h" #include "platform/scroll/FramelessScrollViewClient.h" -#include "public/platform/WebContentLayerClient.h" #include "public/platform/WebPoint.h" #include "public/platform/WebSize.h" #include "wtf/OwnPtr.h" @@ -50,50 +49,44 @@ class Widget; } namespace blink { -class WebContentLayer; class WebGestureEvent; class WebKeyboardEvent; -class WebLayerTreeView; class WebMouseEvent; class WebMouseWheelEvent; class WebRange; struct WebRect; class WebTouchEvent; -class WebPopupMenuImpl : public WebPopupMenu, public WebCore::FramelessScrollViewClient, public WebContentLayerClient, public RefCounted<WebPopupMenuImpl> { +class WebPopupMenuImpl : public WebPopupMenu, + public WebCore::FramelessScrollViewClient, + public RefCounted<WebPopupMenuImpl> { WTF_MAKE_FAST_ALLOCATED; public: // WebWidget functions: - virtual void close() OVERRIDE FINAL; - virtual WebSize size() OVERRIDE FINAL { return m_size; } - virtual void willStartLiveResize() OVERRIDE FINAL; - virtual void resize(const WebSize&) OVERRIDE FINAL; - virtual void willEndLiveResize() OVERRIDE FINAL; - virtual void animate(double frameBeginTime) OVERRIDE FINAL; - virtual void layout() OVERRIDE FINAL; - virtual void enterForceCompositingMode(bool enable) OVERRIDE FINAL; - virtual void didExitCompositingMode() OVERRIDE FINAL; - virtual void paint(WebCanvas*, const WebRect&, PaintOptions = ReadbackFromCompositorIfAvailable) OVERRIDE FINAL; - virtual void themeChanged() OVERRIDE FINAL; - virtual bool handleInputEvent(const WebInputEvent&) OVERRIDE FINAL; - virtual void mouseCaptureLost() OVERRIDE FINAL; - virtual void setFocus(bool enable) OVERRIDE FINAL; + virtual void close() OVERRIDE; + virtual WebSize size() OVERRIDE { return m_size; } + virtual void willStartLiveResize() OVERRIDE; + virtual void resize(const WebSize&) OVERRIDE; + virtual void willEndLiveResize() OVERRIDE; + virtual void animate(double frameBeginTime) OVERRIDE; + virtual void layout() OVERRIDE; + virtual void paint(WebCanvas*, const WebRect&, PaintOptions = ReadbackFromCompositorIfAvailable) OVERRIDE; + virtual void themeChanged() OVERRIDE; + virtual bool handleInputEvent(const WebInputEvent&) OVERRIDE; + virtual void mouseCaptureLost() OVERRIDE; + virtual void setFocus(bool enable) OVERRIDE; virtual bool setComposition( const WebString& text, const WebVector<WebCompositionUnderline>& underlines, - int selectionStart, int selectionEnd) OVERRIDE FINAL; - virtual bool confirmComposition() OVERRIDE FINAL; - virtual bool confirmComposition(ConfirmCompositionBehavior selectionBehavior) OVERRIDE FINAL; - virtual bool confirmComposition(const WebString& text) OVERRIDE FINAL; - virtual bool compositionRange(size_t* location, size_t* length) OVERRIDE FINAL; - virtual bool caretOrSelectionRange(size_t* location, size_t* length) OVERRIDE FINAL; - virtual void setTextDirection(WebTextDirection) OVERRIDE FINAL; - virtual bool isAcceleratedCompositingActive() const OVERRIDE FINAL { return false; } - virtual bool isPopupMenu() const OVERRIDE FINAL { return true; } - virtual void willCloseLayerTreeView() OVERRIDE FINAL; - - // WebContentLayerClient - virtual void paintContents(WebCanvas*, const WebRect& clip, bool canPaintLCDTest, WebFloatRect& opaque) OVERRIDE FINAL; + int selectionStart, int selectionEnd) OVERRIDE; + virtual bool confirmComposition() OVERRIDE; + virtual bool confirmComposition(ConfirmCompositionBehavior selectionBehavior) OVERRIDE; + virtual bool confirmComposition(const WebString& text) OVERRIDE; + virtual bool compositionRange(size_t* location, size_t* length) OVERRIDE; + virtual bool caretOrSelectionRange(size_t* location, size_t* length) OVERRIDE; + virtual void setTextDirection(WebTextDirection) OVERRIDE; + virtual bool isAcceleratedCompositingActive() const OVERRIDE { return false; } + virtual bool isPopupMenu() const OVERRIDE { return true; } // WebPopupMenuImpl void initialize(WebCore::FramelessScrollView* widget, const WebRect& bounds); @@ -134,10 +127,6 @@ public: WebWidgetClient* m_client; WebSize m_size; - WebLayerTreeView* m_layerTreeView; - OwnPtr<WebContentLayer> m_rootLayer; - bool m_isAcceleratedCompositingActive; - WebPoint m_lastMousePosition; // This is a non-owning ref. The popup will notify us via popupClosed() |