Changeset 87831 in webkit
- Timestamp:
- Jun 1, 2011 11:39:19 AM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 1 added
- 12 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r87806 r87831 1 2011-06-01 Adam Roben <aroben@apple.com> 2 3 Render accelerated content into a web process-owned child HWND 4 5 This allows us to use WKCACFView's far more efficient kWKCACFViewDrawingDestinationWindow 6 mode, which gives us asynchronous rendering on a background thread and doesn't require us to 7 read bits off the GPU back into system memory. 8 9 A new class, WKCACFViewWindow, represents the child HWND. The child HWND is placed at the 10 bottom of the z-order so it won't obscure any other child HWNDs (i.e., windowed plugins). 11 The child HWND is made transparent to mouse events so that WKView will continue to receive 12 mouse events even though it is obscured by the child HWND. 13 14 There is now a bunch of dead code in DrawingAreaImpl to handle our old rendering model. I'll 15 remove that in a future patch. 16 17 Fixes <http://webkit.org/b/58054> <rdar://problem/9249839> REGRESSION (WebKit2): Accelerated 18 CSS animations have a lower framerate than in WebKit1 19 20 Reviewed by Anders Carlsson. 21 22 * Shared/LayerTreeContext.h: Added HWND member on Windows. 23 24 * Shared/win/CoalescedWindowGeometriesUpdater.cpp: 25 (WebKit::CoalescedWindowGeometriesUpdater::updateGeometries): 26 * Shared/win/CoalescedWindowGeometriesUpdater.h: 27 Added new BringToTopOrNot argument. Allows the caller to specify that all windows being 28 updated should also be brought to the top of the z-order. 29 30 * Shared/win/LayerTreeContextWin.cpp: 31 (WebKit::LayerTreeContext::LayerTreeContext): 32 (WebKit::LayerTreeContext::~LayerTreeContext): 33 (WebKit::LayerTreeContext::encode): 34 (WebKit::LayerTreeContext::decode): 35 (WebKit::LayerTreeContext::isEmpty): 36 (WebKit::operator==): 37 Implemented based on new window member. 38 39 * UIProcess/win/WebView.cpp: 40 (WebKit::WebView::WebView): Initialize new member. 41 (WebKit::WebView::onSizeEvent): Resize the layer host window to cover our entire view, if we 42 have one. 43 (WebKit::WebView::enterAcceleratedCompositingMode): Store, position, and show the layer host 44 window. 45 (WebKit::WebView::exitAcceleratedCompositingMode): Destroy the layer host window. 46 (WebKit::WebView::updateChildWindowGeometries): Updated for change to 47 CoalescedWindowGeometriesUpdater. 48 49 * UIProcess/win/WebView.h: Added m_layerHostWindow member. 50 51 * WebProcess/WebPage/LayerTreeHost.h: Added scheduleChildWindowGeometryUpdate. 52 53 * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp: 54 (WebKit::LayerTreeHostCAWin::supportsAcceleratedCompositing): Simplified by using 55 WKCACFViewWindow. 56 57 (WebKit::LayerTreeHostCAWin::LayerTreeHostCAWin): Removed initialization of a removed 58 member. 59 (WebKit::LayerTreeHostCAWin::platformInitialize): Changed to use WKCACFViewWindow, 60 kWKCACFViewDrawingDestinationWindow, and to initialize the LayerTreeContext. 61 (WebKit::LayerTreeHostCAWin::invalidate): Leak our window and tell it to clean up after 62 itself. The UI process will take care of destroying the window when it finishes switching 63 out of accelerated compositing mode. Removed a WKCACFViewUpdate call that is now handled by 64 WKCACFViewWindow. 65 (WebKit::LayerTreeHostCAWin::scheduleChildWindowGeometryUpdate): Added. Calls through to 66 m_geometriesUpdater. 67 (WebKit::LayerTreeHostCAWin::sizeDidChange): Updated to use WKCACFViewWindow. 68 (WebKit::LayerTreeHostCAWin::contextDidChange): Update child window geometries now to keep 69 them (almost) in sync with the accelerated content. <http://webkit.org/b/61867> covers the 70 slight asynchrony that still exists. 71 (WebKit::LayerTreeHostCAWin::setRootCompositingLayer): Don't flush any changes when we don't 72 have a root layer. This prevents a flash of white when switching out of compositing mode. 73 74 * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h: Added m_window and m_geometriesUpdater. 75 Removed code related to the old, synchronous display model. 76 77 * WebProcess/WebPage/ca/win/WKCACFViewWindow.cpp: Added. 78 (WebKit::WKCACFViewWindow::WKCACFViewWindow): Initialize members and create our window. 79 (WebKit::WKCACFViewWindow::~WKCACFViewWindow): Destroy our window if needed. 80 (WebKit::WKCACFViewWindow::onCustomDestroy): Just call ::DestroyWindow. 81 (WebKit::WKCACFViewWindow::onDestroy): Tell our view not to render into our window anymore. 82 (WebKit::WKCACFViewWindow::onEraseBackground): Tell Windows not to erase us. 83 (WebKit::WKCACFViewWindow::onNCDestroy): Clear out m_window since it's now pointing to a 84 destroy window, and destroy ourselves if requested. 85 (WebKit::WKCACFViewWindow::onPaint): Tell the view to draw, then clear our invalid region. 86 (WebKit::WKCACFViewWindow::onPrintClient): Tell our view to draw into the given HDC. 87 (WebKit::WKCACFViewWindow::registerClass): Register our class (duh). 88 (WebKit::WKCACFViewWindow::staticWndProc): Get the WKCACFViewWindow pointer, or store the 89 pointer if needed, then call through to wndProc. 90 (WebKit::WKCACFViewWindow::wndProc): Call out to the appropriate handler function. 91 92 * WebProcess/WebPage/ca/win/WKCACFViewWindow.h: Added. 93 (WebKit::WKCACFViewWindow::setDeletesSelfWhenWindowDestroyed): Simple setter. 94 (WebKit::WKCACFViewWindow::window): Simple getter. 95 96 * WebProcess/WebPage/win/DrawingAreaImplWin.cpp: 97 (WebKit::DrawingAreaImpl::scheduleChildWindowGeometryUpdate): Let the LayerTreeHost handle 98 the geometry update, if we have one. 99 100 * win/WebKit2.vcproj: Added WKCACFViewWindow files. 101 1 102 2011-06-01 Adam Roben <aroben@apple.com> 2 103 -
trunk/Source/WebKit2/Shared/LayerTreeContext.h
r86612 r87831 46 46 #if PLATFORM(MAC) 47 47 uint32_t contextID; 48 #elif PLATFORM(WIN) 49 HWND window; 48 50 #endif 49 51 }; -
trunk/Source/WebKit2/Shared/win/CoalescedWindowGeometriesUpdater.cpp
r87805 r87831 56 56 } 57 57 58 void CoalescedWindowGeometriesUpdater::updateGeometries( )58 void CoalescedWindowGeometriesUpdater::updateGeometries(BringToTopOrNot bringToTopOrNot) 59 59 { 60 60 HashMap<HWND, WindowGeometry> geometries; … … 69 69 continue; 70 70 71 UINT flags = SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER;71 UINT flags = SWP_NOACTIVATE; 72 72 if (geometry.visible) 73 73 flags |= SWP_SHOWWINDOW; … … 75 75 flags |= SWP_HIDEWINDOW; 76 76 77 deferWindowPos = ::DeferWindowPos(deferWindowPos, geometry.window, 0, geometry.frame.x(), geometry.frame.y(), geometry.frame.width(), geometry.frame.height(), flags); 77 HWND hwndInsertAfter; 78 if (bringToTopOrNot == BringToTop) 79 hwndInsertAfter = HWND_TOP; 80 else { 81 hwndInsertAfter = 0; 82 flags |= SWP_NOOWNERZORDER | SWP_NOZORDER; 83 } 84 85 deferWindowPos = ::DeferWindowPos(deferWindowPos, geometry.window, hwndInsertAfter, geometry.frame.x(), geometry.frame.y(), geometry.frame.width(), geometry.frame.height(), flags); 78 86 79 87 setWindowRegion(geometry.window, adoptPtr(::CreateRectRgn(geometry.clipRect.x(), geometry.clipRect.y(), geometry.clipRect.maxX(), geometry.clipRect.maxY()))); -
trunk/Source/WebKit2/Shared/win/CoalescedWindowGeometriesUpdater.h
r87805 r87831 34 34 struct WindowGeometry; 35 35 36 enum BringToTopOrNot { BringToTop, DoNotBringToTop }; 37 36 38 class CoalescedWindowGeometriesUpdater { 37 39 WTF_MAKE_NONCOPYABLE(CoalescedWindowGeometriesUpdater); … … 41 43 42 44 void addPendingUpdate(const WindowGeometry&); 43 void updateGeometries( );45 void updateGeometries(BringToTopOrNot); 44 46 45 47 private: -
trunk/Source/WebKit2/Shared/win/LayerTreeContextWin.cpp
r79335 r87831 27 27 #include "LayerTreeContext.h" 28 28 29 #include <WebCore/NotImplemented.h>29 #include "ArgumentCoders.h" 30 30 31 31 namespace WebKit { 32 32 33 33 LayerTreeContext::LayerTreeContext() 34 : window(0) 34 35 { 35 notImplemented();36 36 } 37 37 38 38 LayerTreeContext::~LayerTreeContext() 39 39 { 40 notImplemented();41 40 } 42 41 43 void LayerTreeContext::encode(CoreIPC::ArgumentEncoder* ) const42 void LayerTreeContext::encode(CoreIPC::ArgumentEncoder* encoder) const 44 43 { 45 notImplemented();44 encoder->encodeUInt64(reinterpret_cast<uint64_t>(window)); 46 45 } 47 46 48 bool LayerTreeContext::decode(CoreIPC::ArgumentDecoder* , LayerTreeContext&)47 bool LayerTreeContext::decode(CoreIPC::ArgumentDecoder* decoder, LayerTreeContext& context) 49 48 { 50 notImplemented(); 49 uint64_t window; 50 if (!decoder->decode(window)) 51 return false; 52 53 context.window = reinterpret_cast<HWND>(window); 51 54 return true; 52 55 } … … 54 57 bool LayerTreeContext::isEmpty() const 55 58 { 56 notImplemented(); 57 return true; 59 return !window; 58 60 } 59 61 60 bool operator==(const LayerTreeContext& , const LayerTreeContext&)62 bool operator==(const LayerTreeContext& a, const LayerTreeContext& b) 61 63 { 62 notImplemented(); 63 return true; 64 return a.window == b.window; 64 65 } 65 66 -
trunk/Source/WebKit2/UIProcess/win/WebView.cpp
r87805 r87831 36 36 #include "RunLoop.h" 37 37 #include "WKAPICast.h" 38 #include "WKCACFViewWindow.h" 38 39 #include "WebContext.h" 39 40 #include "WebContextMenuProxyWin.h" … … 277 278 , m_overPanY(0) 278 279 , m_gestureReachedScrollingLimit(false) 280 #if USE(ACCELERATED_COMPOSITING) 281 , m_layerHostWindow(0) 282 #endif 279 283 { 280 284 registerWebViewWindowClass(); … … 729 733 m_nextResizeScrollOffset = IntSize(); 730 734 } 735 736 #if USE(ACCELERATED_COMPOSITING) 737 if (m_layerHostWindow) 738 ::MoveWindow(m_layerHostWindow, 0, 0, width, height, FALSE); 739 #endif 731 740 732 741 handled = true; … … 1510 1519 #if USE(ACCELERATED_COMPOSITING) 1511 1520 1512 void WebView::enterAcceleratedCompositingMode(const LayerTreeContext&) 1513 { 1514 // FIXME: Implement. 1515 ASSERT_NOT_REACHED(); 1521 void WebView::enterAcceleratedCompositingMode(const LayerTreeContext& context) 1522 { 1523 ASSERT(!context.isEmpty()); 1524 1525 m_layerHostWindow = context.window; 1526 1527 IntSize size = viewSize(); 1528 // Ensure the layer host window is behind all other child windows (since otherwise it would obscure them). 1529 ::SetWindowPos(m_layerHostWindow, HWND_BOTTOM, 0, 0, size.width(), size.height(), SWP_SHOWWINDOW | SWP_NOACTIVATE); 1516 1530 } 1517 1531 1518 1532 void WebView::exitAcceleratedCompositingMode() 1519 1533 { 1520 // FIXME: Implement. 1521 ASSERT_NOT_REACHED(); 1534 ASSERT(m_layerHostWindow); 1535 1536 // Tell the WKCACFViewWindow to destroy itself. We can't call ::DestroyWindow directly because 1537 // the window is owned by another thread. 1538 ::PostMessageW(m_layerHostWindow, WKCACFViewWindow::customDestroyMessage, 0, 0); 1539 m_layerHostWindow = 0; 1522 1540 } 1523 1541 … … 1536 1554 void WebView::updateChildWindowGeometries() 1537 1555 { 1538 m_geometriesUpdater.updateGeometries( );1556 m_geometriesUpdater.updateGeometries(DoNotBringToTop); 1539 1557 } 1540 1558 -
trunk/Source/WebKit2/UIProcess/win/WebView.h
r87805 r87831 281 281 OwnPtr<WebCore::FullScreenController> m_fullScreenController; 282 282 #endif 283 284 #if USE(ACCELERATED_COMPOSITING) 285 HWND m_layerHostWindow; 286 #endif 283 287 }; 284 288 -
trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
r87755 r87831 42 42 class WebPage; 43 43 44 #if PLATFORM(WIN) 45 struct WindowGeometry; 46 #endif 47 44 48 class LayerTreeHost : public RefCounted<LayerTreeHost> { 45 49 public: … … 75 79 virtual void display(UpdateInfo&) { ASSERT_NOT_REACHED(); } 76 80 81 #if PLATFORM(WIN) 82 virtual void scheduleChildWindowGeometryUpdate(const WindowGeometry&) = 0; 83 #endif 84 77 85 protected: 78 86 explicit LayerTreeHost(WebPage*); -
trunk/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp
r87804 r87831 32 32 #include "ShareableBitmap.h" 33 33 #include "UpdateInfo.h" 34 #include "WKCACFViewWindow.h" 34 35 #include "WebPage.h" 35 #include <WebCore/DefWndProcWindowClass.h>36 36 #include <WebCore/GraphicsLayerCA.h> 37 37 #include <WebCore/LayerChangesFlusher.h> … … 53 53 namespace WebKit { 54 54 55 static HWND dummyWindow;56 static size_t validLayerTreeHostCount;57 58 // This window is never shown. It is only needed so that D3D can determine the display mode, etc.59 static HWND createDummyWindow()60 {61 return ::CreateWindowW(defWndProcWindowClassName(), 0, WS_POPUP, 0, 0, 10, 10, 0, 0, instanceHandle(), 0);62 }63 64 55 bool LayerTreeHostCAWin::supportsAcceleratedCompositing() 65 56 { … … 70 61 initialized = true; 71 62 72 ASSERT(!dummyWindow); 73 dummyWindow = createDummyWindow(); 74 RetainPtr<WKCACFViewRef> view(AdoptCF, WKCACFViewCreate(kWKCACFViewDrawingDestinationImage)); 63 RetainPtr<WKCACFViewRef> view(AdoptCF, WKCACFViewCreate(kWKCACFViewDrawingDestinationWindow)); 64 WKCACFViewWindow dummyWindow(view.get(), 0, 0); 75 65 CGRect fakeBounds = CGRectMake(0, 0, 10, 10); 76 WKCACFViewUpdate(view.get(), dummyWindow , &fakeBounds);66 WKCACFViewUpdate(view.get(), dummyWindow.window(), &fakeBounds); 77 67 78 68 supportsAcceleratedCompositing = WKCACFViewCanDraw(view.get()); 79 69 80 70 WKCACFViewUpdate(view.get(), 0, 0); 81 ::DestroyWindow(dummyWindow);82 dummyWindow = 0;83 71 84 72 return supportsAcceleratedCompositing; … … 95 83 : LayerTreeHostCA(webPage) 96 84 , m_isFlushingLayerChanges(false) 97 , m_nextDisplayTime(0)98 85 { 99 86 } … … 103 90 } 104 91 105 void LayerTreeHostCAWin::platformInitialize(LayerTreeContext&) 106 { 107 ++validLayerTreeHostCount; 108 if (!dummyWindow) 109 dummyWindow = createDummyWindow(); 110 111 m_view.adoptCF(WKCACFViewCreate(kWKCACFViewDrawingDestinationImage)); 92 void LayerTreeHostCAWin::platformInitialize(LayerTreeContext& context) 93 { 94 m_view.adoptCF(WKCACFViewCreate(kWKCACFViewDrawingDestinationWindow)); 112 95 WKCACFViewSetContextUserData(m_view.get(), static_cast<AbstractCACFLayerTreeHost*>(this)); 113 96 WKCACFViewSetLayer(m_view.get(), rootLayer()->platformLayer()); 114 97 WKCACFViewSetContextDidChangeCallback(m_view.get(), contextDidChangeCallback, this); 115 98 99 // Passing WS_DISABLED makes the window invisible to mouse events, which lets WKView's normal 100 // event handling mechanism work even when this window is obscuring the entire WKView HWND. 101 // Note that m_webPage->nativeWindow() is owned by the UI process, so this creates a cross- 102 // process window hierarchy (and thus implicitly attaches the input queues of the UI and web 103 // processes' main threads). 104 m_window = adoptPtr(new WKCACFViewWindow(m_view.get(), m_webPage->nativeWindow(), WS_DISABLED)); 105 116 106 CGRect bounds = m_webPage->bounds(); 117 WKCACFViewUpdate(m_view.get(), dummyWindow, &bounds); 107 WKCACFViewUpdate(m_view.get(), m_window->window(), &bounds); 108 109 context.window = m_window->window(); 118 110 } 119 111 … … 122 114 LayerChangesFlusher::shared().cancelPendingFlush(this); 123 115 124 WKCACFViewUpdate(m_view.get(), 0, 0);125 116 WKCACFViewSetContextUserData(m_view.get(), 0); 126 117 WKCACFViewSetLayer(m_view.get(), 0); 127 118 WKCACFViewSetContextDidChangeCallback(m_view.get(), 0, 0); 128 119 120 // The UI process will destroy m_window's HWND when it gets the message to switch out of 121 // accelerated compositing mode. We don't want to destroy the HWND before then or we will get a 122 // flash of white before the UI process has a chance to display the non-composited content. 123 // Since the HWND needs to outlive us, we leak m_window here and tell it to clean itself up 124 // when its HWND is destroyed. 125 WKCACFViewWindow* window = m_window.leakPtr(); 126 window->setDeletesSelfWhenWindowDestroyed(true); 127 129 128 LayerTreeHostCA::invalidate(); 130 131 if (--validLayerTreeHostCount)132 return;133 ::DestroyWindow(dummyWindow);134 dummyWindow = 0;135 129 } 136 130 … … 156 150 } 157 151 158 bool LayerTreeHostCAWin::participatesInDisplay() 159 { 160 return true; 161 } 162 163 bool LayerTreeHostCAWin::needsDisplay() 164 { 165 return timeUntilNextDisplay() <= 0; 166 } 167 168 double LayerTreeHostCAWin::timeUntilNextDisplay() 169 { 170 return m_nextDisplayTime - currentTime(); 171 } 172 173 static IntSize size(WKCACFImageRef image) 174 { 175 return IntSize(WKCACFImageGetWidth(image), WKCACFImageGetHeight(image)); 176 } 177 178 static PassRefPtr<ShareableBitmap> toShareableBitmap(WKCACFImageRef image) 179 { 180 size_t fileMappingSize; 181 HANDLE mapping = WKCACFImageCopyFileMapping(image, &fileMappingSize); 182 if (!mapping) 183 return 0; 184 185 RefPtr<SharedMemory> sharedMemory = SharedMemory::adopt(mapping, fileMappingSize, SharedMemory::ReadWrite); 186 if (!sharedMemory) { 187 ::CloseHandle(mapping); 188 return 0; 189 } 190 191 // WKCACFImage never has an alpha channel. 192 return ShareableBitmap::create(size(image), 0, sharedMemory.release()); 193 } 194 195 void LayerTreeHostCAWin::display(UpdateInfo& updateInfo) 196 { 197 CGPoint imageOrigin; 198 CFTimeInterval nextDrawTime; 199 RetainPtr<WKCACFImageRef> image(AdoptCF, WKCACFViewCopyDrawnImage(m_view.get(), &imageOrigin, &nextDrawTime)); 200 m_nextDisplayTime = nextDrawTime - CACurrentMediaTime() + currentTime(); 201 if (!image) 202 return; 203 RefPtr<ShareableBitmap> bitmap = toShareableBitmap(image.get()); 204 if (!bitmap) 205 return; 206 if (!bitmap->createHandle(updateInfo.bitmapHandle)) 207 return; 208 updateInfo.updateRectBounds = IntRect(IntPoint(imageOrigin.x, m_webPage->size().height() - imageOrigin.y - bitmap->size().height()), bitmap->size()); 209 updateInfo.updateRects.append(updateInfo.updateRectBounds); 152 void LayerTreeHostCAWin::scheduleChildWindowGeometryUpdate(const WindowGeometry& geometry) 153 { 154 m_geometriesUpdater.addPendingUpdate(geometry); 210 155 } 211 156 … … 214 159 LayerTreeHostCA::sizeDidChange(newSize); 215 160 CGRect bounds = CGRectMake(0, 0, newSize.width(), newSize.height()); 216 WKCACFViewUpdate(m_view.get(), dummyWindow, &bounds);161 WKCACFViewUpdate(m_view.get(), m_window->window(), &bounds); 217 162 WKCACFViewFlushContext(m_view.get()); 218 163 } … … 250 195 m_pendingAnimatedLayers.clear(); 251 196 252 m_nextDisplayTime = 0; 253 static_cast<DrawingAreaImpl*>(m_webPage->drawingArea())->setLayerHostNeedsDisplay(); 197 // Update child window geometries now so that they stay mostly in sync with the accelerated content. 198 // FIXME: We should really be doing this when the changes we just flushed appear on screen. <http://webkit.org/b/61867> 199 // We also bring the child windows (i.e., plugins) to the top of the z-order to ensure they are above m_window. 200 // FIXME: We could do this just once per window when it is first shown. Maybe that would be more efficient? 201 m_geometriesUpdater.updateGeometries(BringToTop); 254 202 } 255 203 … … 296 244 297 245 void LayerTreeHostCAWin::setRootCompositingLayer(GraphicsLayer* graphicsLayer) 298 { 246 { 247 // Don't flush any changes when we don't have a root layer. This will prevent flashes of white 248 // when switching out of compositing mode. 249 setLayerFlushSchedulingEnabled(graphicsLayer); 250 299 251 // Resubmit all existing animations. CACF does not remember running animations 300 252 // When the layer tree is removed and then added back to the hierarchy -
trunk/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h
r87755 r87831 31 31 #if HAVE(WKQCA) 32 32 33 #include "CoalescedWindowGeometriesUpdater.h" 33 34 #include "LayerTreeHostCA.h" 34 35 #include <WebCore/AbstractCACFLayerTreeHost.h> … … 39 40 40 41 namespace WebKit { 42 43 class WKCACFViewWindow; 41 44 42 45 class LayerTreeHostCAWin : public LayerTreeHostCA, private WebCore::AbstractCACFLayerTreeHost { … … 59 62 virtual void scheduleLayerFlush(); 60 63 virtual void setLayerFlushSchedulingEnabled(bool); 61 virtual bool participatesInDisplay(); 62 virtual bool needsDisplay(); 63 virtual double timeUntilNextDisplay(); 64 virtual void display(UpdateInfo&); 64 virtual void scheduleChildWindowGeometryUpdate(const WindowGeometry&); 65 65 66 66 // LayerTreeHostCA … … 74 74 virtual void flushPendingLayerChangesNow(); 75 75 76 OwnPtr<WKCACFViewWindow> m_window; 76 77 RetainPtr<WKCACFViewRef> m_view; 77 78 HashSet<RefPtr<WebCore::PlatformCALayer> > m_pendingAnimatedLayers; 78 79 bool m_isFlushingLayerChanges; 79 double m_nextDisplayTime;80 CoalescedWindowGeometriesUpdater m_geometriesUpdater; 80 81 }; 81 82 -
trunk/Source/WebKit2/WebProcess/WebPage/ca/win/WKCACFViewWindow.h
r87806 r87831 24 24 */ 25 25 26 #ifndef CoalescedWindowGeometriesUpdater_h27 #define CoalescedWindowGeometriesUpdater_h26 #ifndef WKCACFViewWindow_h 27 #define WKCACFViewWindow_h 28 28 29 #include <wtf/HashMap.h> 29 #include "HeaderDetection.h" 30 31 #if HAVE(WKQCA) 32 30 33 #include <wtf/Noncopyable.h> 34 #include <wtf/RetainPtr.h> 35 36 typedef struct _WKCACFView* WKCACFViewRef; 31 37 32 38 namespace WebKit { 33 39 34 struct WindowGeometry; 40 // FIXME: Move this class down to WebCore. (Maybe it can even replace some of WKCACFViewLayerTreeHost.) 41 class WKCACFViewWindow { 42 WTF_MAKE_NONCOPYABLE(WKCACFViewWindow); 43 public: 44 // WKCACFViewWindow will destroy its HWND when this message is received. 45 static const UINT customDestroyMessage = WM_USER + 1; 35 46 36 class CoalescedWindowGeometriesUpdater { 37 WTF_MAKE_NONCOPYABLE(CoalescedWindowGeometriesUpdater); 38 public: 39 CoalescedWindowGeometriesUpdater(); 40 ~CoalescedWindowGeometriesUpdater(); 47 WKCACFViewWindow(WKCACFViewRef, HWND parentWindow, DWORD additionalStyles); 48 ~WKCACFViewWindow(); 41 49 42 void addPendingUpdate(const WindowGeometry&); 43 void updateGeometries(); 50 void setDeletesSelfWhenWindowDestroyed(bool deletes) { m_deletesSelfWhenWindowDestroyed = deletes; } 51 52 HWND window() const { return m_window; } 44 53 45 54 private: 46 HashMap<HWND, WindowGeometry> m_geometries; 55 LRESULT onCustomDestroy(WPARAM, LPARAM); 56 LRESULT onDestroy(WPARAM, LPARAM); 57 LRESULT onEraseBackground(WPARAM, LPARAM); 58 LRESULT onNCDestroy(WPARAM, LPARAM); 59 LRESULT onPaint(WPARAM, LPARAM); 60 LRESULT onPrintClient(WPARAM, LPARAM); 61 static void registerClass(); 62 static LRESULT CALLBACK staticWndProc(HWND, UINT, WPARAM, LPARAM); 63 LRESULT wndProc(UINT, WPARAM, LPARAM); 64 65 HWND m_window; 66 RetainPtr<WKCACFViewRef> m_view; 67 bool m_deletesSelfWhenWindowDestroyed; 47 68 }; 48 69 49 70 } // namespace WebKit 50 71 51 #endif // CoalescedWindowGeometriesUpdater_h 72 #endif // HAVE(WKQCA) 73 74 #endif // WKCACFViewWindow_h -
trunk/Source/WebKit2/WebProcess/WebPage/win/DrawingAreaImplWin.cpp
r87806 r87831 35 35 void DrawingAreaImpl::scheduleChildWindowGeometryUpdate(const WindowGeometry& geometry) 36 36 { 37 #if USE(ACCELERATED_COMPOSITING) 38 if (m_layerTreeHost) { 39 m_layerTreeHost->scheduleChildWindowGeometryUpdate(geometry); 40 return; 41 } 42 #endif 43 37 44 // FIXME: This should be a Messages::DrawingAreaProxy, and DrawingAreaProxy should pass the 38 45 // data off to the WebPageProxy. -
trunk/Source/WebKit2/win/WebKit2.vcproj
r87806 r87831 2048 2048 > 2049 2049 </File> 2050 <File 2051 RelativePath="..\WebProcess\WebPage\ca\win\WKCACFViewWindow.cpp" 2052 > 2053 </File> 2054 <File 2055 RelativePath="..\WebProcess\WebPage\ca\win\WKCACFViewWindow.h" 2056 > 2057 </File> 2050 2058 </Filter> 2051 2059 </Filter>
Note: See TracChangeset
for help on using the changeset viewer.