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

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

Issue 132173005: Use compositor with select popups. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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/WebPopupMenuImpl.cpp » ('j') | Source/web/WebPopupMenuImpl.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 15 matching lines...) Expand all
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef WebPopupMenuImpl_h 31 #ifndef WebPopupMenuImpl_h
32 #define WebPopupMenuImpl_h 32 #define WebPopupMenuImpl_h
33 33
34 #include "WebPopupMenu.h" 34 #include "WebPopupMenu.h"
35 #include "platform/scroll/FramelessScrollViewClient.h" 35 #include "platform/scroll/FramelessScrollViewClient.h"
36 #include "public/platform/WebContentLayerClient.h"
36 #include "public/platform/WebPoint.h" 37 #include "public/platform/WebPoint.h"
37 #include "public/platform/WebSize.h" 38 #include "public/platform/WebSize.h"
38 #include "wtf/OwnPtr.h" 39 #include "wtf/OwnPtr.h"
39 #include "wtf/RefCounted.h" 40 #include "wtf/RefCounted.h"
40 41
41 namespace WebCore { 42 namespace WebCore {
42 class Frame; 43 class Frame;
43 class FramelessScrollView; 44 class FramelessScrollView;
44 class KeyboardEvent; 45 class KeyboardEvent;
45 class Page; 46 class Page;
46 class PlatformKeyboardEvent; 47 class PlatformKeyboardEvent;
47 class Range; 48 class Range;
48 class Widget; 49 class Widget;
49 } 50 }
50 51
51 namespace blink { 52 namespace blink {
53 class WebContentLayer;
52 class WebGestureEvent; 54 class WebGestureEvent;
53 class WebKeyboardEvent; 55 class WebKeyboardEvent;
56 class WebLayerTreeView;
54 class WebMouseEvent; 57 class WebMouseEvent;
55 class WebMouseWheelEvent; 58 class WebMouseWheelEvent;
56 class WebRange; 59 class WebRange;
57 struct WebRect; 60 struct WebRect;
58 class WebTouchEvent; 61 class WebTouchEvent;
59 62
60 class WebPopupMenuImpl : public WebPopupMenu, 63 class WebPopupMenuImpl : public WebPopupMenu
61 public WebCore::FramelessScrollViewClient, 64 , public WebCore::FramelessScrollViewClient
jamesr 2014/01/21 21:59:23 this formatting is very funky - I don't think we d
62 public RefCounted<WebPopupMenuImpl> { 65 , public WebContentLayerClient
66 , public RefCounted<WebPopupMenuImpl> {
63 WTF_MAKE_FAST_ALLOCATED; 67 WTF_MAKE_FAST_ALLOCATED;
64 public: 68 public:
65 // WebWidget functions: 69 // WebWidget functions:
66 virtual void close() OVERRIDE; 70 virtual void close() OVERRIDE;
67 virtual WebSize size() OVERRIDE { return m_size; } 71 virtual WebSize size() OVERRIDE { return m_size; }
68 virtual void willStartLiveResize() OVERRIDE; 72 virtual void willStartLiveResize() OVERRIDE;
69 virtual void resize(const WebSize&) OVERRIDE; 73 virtual void resize(const WebSize&) OVERRIDE;
70 virtual void willEndLiveResize() OVERRIDE; 74 virtual void willEndLiveResize() OVERRIDE;
71 virtual void animate(double frameBeginTime) OVERRIDE; 75 virtual void animate(double frameBeginTime) OVERRIDE;
72 virtual void layout() OVERRIDE; 76 virtual void layout() OVERRIDE;
77 virtual void enterForceCompositingMode(bool enable) OVERRIDE;
78 virtual void didExitCompositingMode() OVERRIDE;
73 virtual void paint(WebCanvas*, const WebRect&, PaintOptions = ReadbackFromCo mpositorIfAvailable) OVERRIDE; 79 virtual void paint(WebCanvas*, const WebRect&, PaintOptions = ReadbackFromCo mpositorIfAvailable) OVERRIDE;
74 virtual void themeChanged() OVERRIDE; 80 virtual void themeChanged() OVERRIDE;
75 virtual bool handleInputEvent(const WebInputEvent&) OVERRIDE; 81 virtual bool handleInputEvent(const WebInputEvent&) OVERRIDE;
76 virtual void mouseCaptureLost() OVERRIDE; 82 virtual void mouseCaptureLost() OVERRIDE;
77 virtual void setFocus(bool enable) OVERRIDE; 83 virtual void setFocus(bool enable) OVERRIDE;
78 virtual bool setComposition( 84 virtual bool setComposition(
79 const WebString& text, 85 const WebString& text,
80 const WebVector<WebCompositionUnderline>& underlines, 86 const WebVector<WebCompositionUnderline>& underlines,
81 int selectionStart, int selectionEnd) OVERRIDE; 87 int selectionStart, int selectionEnd) OVERRIDE;
82 virtual bool confirmComposition() OVERRIDE; 88 virtual bool confirmComposition() OVERRIDE;
83 virtual bool confirmComposition(ConfirmCompositionBehavior selectionBehavior ) OVERRIDE; 89 virtual bool confirmComposition(ConfirmCompositionBehavior selectionBehavior ) OVERRIDE;
84 virtual bool confirmComposition(const WebString& text) OVERRIDE; 90 virtual bool confirmComposition(const WebString& text) OVERRIDE;
85 virtual bool compositionRange(size_t* location, size_t* length) OVERRIDE; 91 virtual bool compositionRange(size_t* location, size_t* length) OVERRIDE;
86 virtual bool caretOrSelectionRange(size_t* location, size_t* length) OVERRID E; 92 virtual bool caretOrSelectionRange(size_t* location, size_t* length) OVERRID E;
87 virtual void setTextDirection(WebTextDirection) OVERRIDE; 93 virtual void setTextDirection(WebTextDirection) OVERRIDE;
88 virtual bool isAcceleratedCompositingActive() const OVERRIDE { return false; } 94 virtual bool isAcceleratedCompositingActive() const OVERRIDE { return false; }
89 virtual bool isPopupMenu() const OVERRIDE { return true; } 95 virtual bool isPopupMenu() const OVERRIDE { return true; }
96 virtual void willCloseLayerTreeView() OVERRIDE;
97
98 // WebContentLayerClient
99 virtual void paintContents(WebCanvas*, const WebRect& clip, bool canPaintLCD Test, WebFloatRect& opaque) OVERRIDE;
90 100
91 // WebPopupMenuImpl 101 // WebPopupMenuImpl
92 void initialize(WebCore::FramelessScrollView* widget, const WebRect& bounds) ; 102 void initialize(WebCore::FramelessScrollView* widget, const WebRect& bounds) ;
93 103
94 WebWidgetClient* client() { return m_client; } 104 WebWidgetClient* client() { return m_client; }
95 105
96 void handleMouseMove(const WebMouseEvent&); 106 void handleMouseMove(const WebMouseEvent&);
97 void handleMouseLeave(const WebMouseEvent&); 107 void handleMouseLeave(const WebMouseEvent&);
98 void handleMouseDown(const WebMouseEvent&); 108 void handleMouseDown(const WebMouseEvent&);
99 void handleMouseUp(const WebMouseEvent&); 109 void handleMouseUp(const WebMouseEvent&);
(...skipping 20 matching lines...) Expand all
120 virtual WebCore::IntPoint screenToRootView(const WebCore::IntPoint&) const O VERRIDE; 130 virtual WebCore::IntPoint screenToRootView(const WebCore::IntPoint&) const O VERRIDE;
121 virtual WebCore::IntRect rootViewToScreen(const WebCore::IntRect&) const OVE RRIDE; 131 virtual WebCore::IntRect rootViewToScreen(const WebCore::IntRect&) const OVE RRIDE;
122 virtual WebScreenInfo screenInfo() const OVERRIDE; 132 virtual WebScreenInfo screenInfo() const OVERRIDE;
123 133
124 // WebCore::FramelessScrollViewClient methods: 134 // WebCore::FramelessScrollViewClient methods:
125 virtual void popupClosed(WebCore::FramelessScrollView*) OVERRIDE; 135 virtual void popupClosed(WebCore::FramelessScrollView*) OVERRIDE;
126 136
127 WebWidgetClient* m_client; 137 WebWidgetClient* m_client;
128 WebSize m_size; 138 WebSize m_size;
129 139
140 WebLayerTreeView* m_layerTreeView;
141 OwnPtr<WebContentLayer> m_rootLayer;
142 bool m_isAcceleratedCompositingActive;
143
130 WebPoint m_lastMousePosition; 144 WebPoint m_lastMousePosition;
131 145
132 // This is a non-owning ref. The popup will notify us via popupClosed() 146 // This is a non-owning ref. The popup will notify us via popupClosed()
133 // before it is destroyed. 147 // before it is destroyed.
134 WebCore::FramelessScrollView* m_widget; 148 WebCore::FramelessScrollView* m_widget;
135 }; 149 };
136 150
137 DEFINE_TYPE_CASTS(WebPopupMenuImpl, WebWidget, widget, widget->isPopupMenu(), wi dget.isPopupMenu()); 151 DEFINE_TYPE_CASTS(WebPopupMenuImpl, WebWidget, widget, widget->isPopupMenu(), wi dget.isPopupMenu());
138 // WebPopupMenuImpl is the only implementation of FramelessScrollViewClient, so 152 // WebPopupMenuImpl is the only implementation of FramelessScrollViewClient, so
139 // no need for further checking. 153 // no need for further checking.
140 DEFINE_TYPE_CASTS(WebPopupMenuImpl, WebCore::FramelessScrollViewClient, client, true, true); 154 DEFINE_TYPE_CASTS(WebPopupMenuImpl, WebCore::FramelessScrollViewClient, client, true, true);
141 155
142 } // namespace blink 156 } // namespace blink
143 157
144 #endif 158 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/web/WebPopupMenuImpl.cpp » ('j') | Source/web/WebPopupMenuImpl.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698