Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(448)

Side by Side Diff: Source/web/WebPagePopupImpl.h

Issue 171343003: Use compositor for page popups. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Source/web/WebPagePopupImpl.cpp » ('j') | Source/web/WebPagePopupImpl.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 20 matching lines...) Expand all
31 #ifndef WebPagePopupImpl_h 31 #ifndef WebPagePopupImpl_h
32 #define WebPagePopupImpl_h 32 #define WebPagePopupImpl_h
33 33
34 #include "PageWidgetDelegate.h" 34 #include "PageWidgetDelegate.h"
35 #include "WebPagePopup.h" 35 #include "WebPagePopup.h"
36 #include "core/page/PagePopup.h" 36 #include "core/page/PagePopup.h"
37 #include "wtf/OwnPtr.h" 37 #include "wtf/OwnPtr.h"
38 #include "wtf/RefCounted.h" 38 #include "wtf/RefCounted.h"
39 39
40 namespace WebCore { 40 namespace WebCore {
41 class GraphicsLayer;
41 class Page; 42 class Page;
42 class PagePopupClient; 43 class PagePopupClient;
43 class PlatformKeyboardEvent; 44 class PlatformKeyboardEvent;
44 } 45 }
45 46
46 namespace blink { 47 namespace blink {
47 48
48 class PagePopupChromeClient; 49 class PagePopupChromeClient;
50 class WebLayerTreeView;
51 class WebLayer;
49 class WebViewImpl; 52 class WebViewImpl;
50 53
51 class WebPagePopupImpl FINAL : 54 class WebPagePopupImpl FINAL :
52 public WebPagePopup, 55 public WebPagePopup,
53 public PageWidgetEventHandler, 56 public PageWidgetEventHandler,
54 public WebCore::PagePopup, 57 public WebCore::PagePopup,
55 public RefCounted<WebPagePopupImpl> { 58 public RefCounted<WebPagePopupImpl> {
56 WTF_MAKE_NONCOPYABLE(WebPagePopupImpl); 59 WTF_MAKE_NONCOPYABLE(WebPagePopupImpl);
57 WTF_MAKE_FAST_ALLOCATED; 60 WTF_MAKE_FAST_ALLOCATED;
58 61
59 public: 62 public:
60 virtual ~WebPagePopupImpl(); 63 virtual ~WebPagePopupImpl();
61 bool initialize(WebViewImpl*, WebCore::PagePopupClient*, const WebCore::IntR ect& originBoundsInRootView); 64 bool initialize(WebViewImpl*, WebCore::PagePopupClient*, const WebCore::IntR ect& originBoundsInRootView);
62 bool handleKeyEvent(const WebCore::PlatformKeyboardEvent&); 65 bool handleKeyEvent(const WebCore::PlatformKeyboardEvent&);
63 void closePopup(); 66 void closePopup();
64 WebWidgetClient* widgetClient() const { return m_widgetClient; } 67 WebWidgetClient* widgetClient() const { return m_widgetClient; }
65 bool hasSamePopupClient(WebPagePopupImpl* other) { return other && m_popupCl ient == other->m_popupClient; } 68 bool hasSamePopupClient(WebPagePopupImpl* other) { return other && m_popupCl ient == other->m_popupClient; }
66 69
67 private: 70 private:
68 // WebWidget functions 71 // WebWidget functions
69 virtual WebSize size() OVERRIDE; 72 virtual WebSize size() OVERRIDE;
70 virtual void animate(double) OVERRIDE; 73 virtual void animate(double) OVERRIDE;
71 virtual void layout() OVERRIDE; 74 virtual void layout() OVERRIDE;
75 virtual void enterForceCompositingMode(bool enter) OVERRIDE;
76 virtual void didExitCompositingMode() OVERRIDE;
77 virtual void willCloseLayerTreeView() OVERRIDE;
72 virtual void paint(WebCanvas*, const WebRect&, PaintOptions = ReadbackFromCo mpositorIfAvailable) OVERRIDE; 78 virtual void paint(WebCanvas*, const WebRect&, PaintOptions = ReadbackFromCo mpositorIfAvailable) OVERRIDE;
73 virtual void resize(const WebSize&) OVERRIDE; 79 virtual void resize(const WebSize&) OVERRIDE;
74 virtual void close() OVERRIDE; 80 virtual void close() OVERRIDE;
75 virtual bool handleInputEvent(const WebInputEvent&) OVERRIDE; 81 virtual bool handleInputEvent(const WebInputEvent&) OVERRIDE;
76 virtual void setFocus(bool) OVERRIDE; 82 virtual void setFocus(bool) OVERRIDE;
77 virtual bool isPagePopup() const OVERRIDE { return true; } 83 virtual bool isPagePopup() const OVERRIDE { return true; }
78 84
79 // PageWidgetEventHandler functions 85 // PageWidgetEventHandler functions
80 virtual bool handleKeyEvent(const WebKeyboardEvent&) OVERRIDE; 86 virtual bool handleKeyEvent(const WebKeyboardEvent&) OVERRIDE;
81 virtual bool handleCharEvent(const WebKeyboardEvent&) OVERRIDE; 87 virtual bool handleCharEvent(const WebKeyboardEvent&) OVERRIDE;
82 virtual bool handleGestureEvent(const WebGestureEvent&) OVERRIDE; 88 virtual bool handleGestureEvent(const WebGestureEvent&) OVERRIDE;
83 89
84 explicit WebPagePopupImpl(WebWidgetClient*); 90 explicit WebPagePopupImpl(WebWidgetClient*);
85 bool initializePage(); 91 bool initializePage();
86 void destroyPage(); 92 void destroyPage();
93 void setRootGraphicsLayer(WebCore::GraphicsLayer*);
94 void setIsAcceleratedCompositingActive(bool enter);
87 95
88 WebWidgetClient* m_widgetClient; 96 WebWidgetClient* m_widgetClient;
89 WebRect m_windowRectInScreen; 97 WebRect m_windowRectInScreen;
90 WebViewImpl* m_webView; 98 WebViewImpl* m_webView;
91 OwnPtr<WebCore::Page> m_page; 99 OwnPtr<WebCore::Page> m_page;
92 OwnPtr<PagePopupChromeClient> m_chromeClient; 100 OwnPtr<PagePopupChromeClient> m_chromeClient;
93 WebCore::PagePopupClient* m_popupClient; 101 WebCore::PagePopupClient* m_popupClient;
94 bool m_closing; 102 bool m_closing;
95 103
104 WebLayerTreeView* m_layerTreeView;
105 WebLayer* m_rootLayer;
106 WebCore::GraphicsLayer* m_rootGraphicsLayer;
107 bool m_isAcceleratedCompositingActive;
108
96 friend class WebPagePopup; 109 friend class WebPagePopup;
97 friend class PagePopupChromeClient; 110 friend class PagePopupChromeClient;
98 }; 111 };
99 112
100 DEFINE_TYPE_CASTS(WebPagePopupImpl, WebWidget, widget, widget->isPagePopup(), wi dget.isPagePopup()); 113 DEFINE_TYPE_CASTS(WebPagePopupImpl, WebWidget, widget, widget->isPagePopup(), wi dget.isPagePopup());
101 // WebPagePopupImpl is the only implementation of WebCore::PagePopup, so no 114 // WebPagePopupImpl is the only implementation of WebCore::PagePopup, so no
102 // further checking required. 115 // further checking required.
103 DEFINE_TYPE_CASTS(WebPagePopupImpl, WebCore::PagePopup, popup, true, true); 116 DEFINE_TYPE_CASTS(WebPagePopupImpl, WebCore::PagePopup, popup, true, true);
104 117
105 } // namespace blink 118 } // namespace blink
106 #endif // WebPagePopupImpl_h 119 #endif // WebPagePopupImpl_h
OLDNEW
« no previous file with comments | « no previous file | Source/web/WebPagePopupImpl.cpp » ('j') | Source/web/WebPagePopupImpl.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698