Changeset 58199 in webkit
- Timestamp:
- Apr 23, 2010 5:02:16 PM (14 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 1 deleted
- 5 edited
- 1 copied
- 5 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r58189 r58199 3 3 Reviewed by Anders Carlsson. 4 4 5 https://bugs.webkit.org/show_bug.cgi?id=38065 6 Merge mac and win DrawingAreaProxyUpdateChunk implementations. 7 8 * UIProcess/API/mac/WKView.mm: 9 (-[WKView drawRect:]): 10 * UIProcess/DrawingAreaProxy.cpp: Copied from UIProcess/mac/DrawingAreaProxy.mm. 11 * UIProcess/DrawingAreaProxy.h: Copied from UIProcess/mac/DrawingAreaProxy.h. 12 * UIProcess/DrawingAreaProxyUpdateChunk.cpp: Copied from UIProcess/mac/DrawingAreaProxyUpdateChunk.mm. 13 (WebKit::DrawingAreaProxyUpdateChunk::DrawingAreaProxyUpdateChunk): 14 (WebKit::DrawingAreaProxyUpdateChunk::paint): 15 (WebKit::DrawingAreaProxyUpdateChunk::setSize): 16 (WebKit::DrawingAreaProxyUpdateChunk::didSetSize): 17 (WebKit::DrawingAreaProxyUpdateChunk::update): 18 (WebKit::DrawingAreaProxyUpdateChunk::didReceiveMessage): 19 * UIProcess/DrawingAreaProxyUpdateChunk.h: Copied from UIProcess/mac/DrawingAreaProxyUpdateChunk.h. 20 * UIProcess/mac/DrawingAreaProxy.h: Removed. 21 * UIProcess/mac/DrawingAreaProxy.mm: Removed. 22 * UIProcess/mac/DrawingAreaProxyUpdateChunk.h: Removed. 23 * UIProcess/mac/DrawingAreaProxyUpdateChunk.mm: Removed. 24 * UIProcess/mac/DrawingAreaProxyUpdateChunkMac.mm: Copied from UIProcess/mac/DrawingAreaProxyUpdateChunk.mm. 25 (WebKit::DrawingAreaProxyUpdateChunk::page): 26 (WebKit::DrawingAreaProxyUpdateChunk::invalidateBackingStore): 27 (WebKit::DrawingAreaProxyUpdateChunk::platformPaint): 28 (WebKit::DrawingAreaProxyUpdateChunk::drawUpdateChunkIntoBackingStore): 29 * UIProcess/win/DrawingAreaProxy.cpp: Removed. 30 * UIProcess/win/DrawingAreaProxy.h: Removed. 31 * UIProcess/win/DrawingAreaProxyUpdateChunkWin.cpp: Copied from UIProcess/win/DrawingAreaProxy.cpp. 32 (WebKit::DrawingAreaProxyUpdateChunk::page): 33 (WebKit::DrawingAreaProxyUpdateChunk::ensureBackingStore): 34 (WebKit::DrawingAreaProxyUpdateChunk::invalidateBackingStore): 35 (WebKit::DrawingAreaProxyUpdateChunk::platformPaint): 36 (WebKit::DrawingAreaProxyUpdateChunk::drawUpdateChunkIntoBackingStore): 37 * UIProcess/win/WebView.cpp: 38 (WebKit::WebView::WebView): 39 (WebKit::WebView::onPaintEvent): 40 * WebKit2.xcodeproj/project.pbxproj: 41 * win/WebKit2.vcproj: 42 43 2010-04-23 Sam Weinig <sam@webkit.org> 44 45 Reviewed by Anders Carlsson. 46 5 47 Fix for https://bugs.webkit.org/show_bug.cgi?id=38059 6 Merge mac and win DrawingAreaUpdateChunk implementation .48 Merge mac and win DrawingAreaUpdateChunk implementations. 7 49 8 50 * UIProcess/win/DrawingAreaProxy.cpp: -
trunk/WebKit2/UIProcess/API/mac/WKView.mm
r57310 r58199 28 28 // C API 29 29 #import "WKAPICast.h" 30 #import "WKPage.h"31 30 32 31 // Implementation … … 42 41 #import "WebProcessProxy.h" 43 42 #import <QuartzCore/QuartzCore.h> 44 #import <WebCore/Int Size.h>43 #import <WebCore/IntRect.h> 45 44 #import <wtf/RefPtr.h> 46 45 … … 250 249 if (_data->_page->isValid() && _data->_page->drawingArea()) { 251 250 CGContextRef context = static_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]); 252 _data->_page->drawingArea()-> drawRectIntoContext(NSRectToCGRect(rect), context);251 _data->_page->drawingArea()->paint(IntRect(rect), context); 253 252 } 254 253 } -
trunk/WebKit2/UIProcess/DrawingAreaProxy.cpp
r58184 r58199 24 24 */ 25 25 26 #i mport"DrawingAreaProxy.h"26 #include "DrawingAreaProxy.h" 27 27 28 28 namespace WebKit { -
trunk/WebKit2/UIProcess/DrawingAreaProxy.h
r58184 r58199 37 37 namespace WebCore { 38 38 class IntSize; 39 class IntRect; 39 40 } 40 41 … … 49 50 virtual ~DrawingAreaProxy(); 50 51 51 virtual void drawRectIntoContext(CGRect, CGContextRef) = 0;52 virtual void paint(const WebCore::IntRect&, CGContextRef) = 0; 52 53 virtual void setSize(const WebCore::IntSize&) = 0; 53 54 -
trunk/WebKit2/UIProcess/DrawingAreaProxyUpdateChunk.cpp
r58184 r58199 24 24 */ 25 25 26 #i mport"DrawingAreaProxyUpdateChunk.h"26 #include "DrawingAreaProxyUpdateChunk.h" 27 27 28 #import "MessageID.h" 29 30 #import "DrawingAreaMessageKinds.h" 31 #import "DrawingAreaProxyMessageKinds.h" 32 #import "WKView.h" 33 #import "UpdateChunk.h" 34 #import "WKAPICast.h" 35 #import "WebCoreTypeArgumentMarshalling.h" 36 #import "WebPageProxy.h" 37 #import "WebProcessProxy.h" 28 #include "DrawingAreaMessageKinds.h" 29 #include "DrawingAreaProxyMessageKinds.h" 30 #include "MessageID.h" 31 #include "UpdateChunk.h" 32 #include "WebCoreTypeArgumentMarshalling.h" 33 #include "WebPageProxy.h" 34 #include "WebProcessProxy.h" 38 35 39 36 using namespace WebCore; … … 41 38 namespace WebKit { 42 39 43 DrawingAreaProxyUpdateChunk::DrawingAreaProxyUpdateChunk( WKView* webView)40 DrawingAreaProxyUpdateChunk::DrawingAreaProxyUpdateChunk(PlatformWebView* webView) 44 41 : DrawingAreaProxy(DrawingAreaUpdateChunkType) 45 , m_isInitialized(false)46 42 , m_isWaitingForDidSetFrameNotification(false) 47 43 , m_webView(webView) … … 53 49 } 54 50 55 void DrawingAreaProxyUpdateChunk:: drawRectIntoContext(CGRect rect, CGContextRefcontext)51 void DrawingAreaProxyUpdateChunk::paint(const IntRect& rect, PlatformDrawingContext context) 56 52 { 57 if (!m_isInitialized) {58 setSize(IntSize([m_webView frame].size));59 m_isInitialized = true;60 }61 62 53 if (m_isWaitingForDidSetFrameNotification) { 63 WebPageProxy* page = t oWK([m_webView pageRef]);54 WebPageProxy* page = this->page(); 64 55 if (!page->isValid()) 65 56 return; … … 70 61 } 71 62 72 if (!m_bitmapContext) 73 return; 74 75 RetainPtr<CGImageRef> image(AdoptCF, CGBitmapContextCreateImage(m_bitmapContext.get())); 76 CGContextDrawImage(context, CGRectMake(0, 0, CGImageGetWidth(image.get()), CGImageGetHeight(image.get())), image.get()); 77 } 78 79 void DrawingAreaProxyUpdateChunk::drawUpdateChunkIntoBackingStore(UpdateChunk* updateChunk) 80 { 81 ensureBackingStore(); 82 83 RetainPtr<CGImageRef> image(updateChunk->createImage()); 84 const IntRect& updateChunkRect = updateChunk->rect(); 85 86 CGContextDrawImage(m_bitmapContext.get(), CGRectMake(updateChunkRect.x(), m_viewSize.height() - updateChunkRect.bottom(), 87 updateChunkRect.width(), updateChunkRect.height()), image.get()); 88 [m_webView setNeedsDisplayInRect:NSRectFromCGRect(updateChunkRect)]; 89 } 90 91 void DrawingAreaProxyUpdateChunk::ensureBackingStore() 92 { 93 if (m_bitmapContext) 94 return; 95 96 RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB()); 97 m_bitmapContext.adoptCF(CGBitmapContextCreate(0, m_viewSize.width(), m_viewSize.height(), 8, m_viewSize.width() * 4, colorSpace.get(), kCGImageAlphaPremultipliedLast)); 98 99 // Flip the bitmap context coordinate system. 100 CGContextTranslateCTM(m_bitmapContext.get(), 0, m_viewSize.height()); 101 CGContextScaleCTM(m_bitmapContext.get(), 1, -1); 63 platformPaint(rect, context); 102 64 } 103 65 104 66 void DrawingAreaProxyUpdateChunk::setSize(const IntSize& viewSize) 105 67 { 106 m_isInitialized = true; 68 WebPageProxy* page = this->page(); 69 if (!page->isValid()) 70 return; 107 71 108 WebPageProxy* page = toWK([m_webView pageRef]); 109 if (!page->isValid()) 72 if (viewSize.isEmpty()) 110 73 return; 111 74 112 75 m_viewSize = viewSize; 113 76 m_lastSetViewSize = viewSize; 114 77 115 78 if (m_isWaitingForDidSetFrameNotification) 116 79 return; 117 80 m_isWaitingForDidSetFrameNotification = true; 118 81 119 82 page->process()->responsivenessTimer()->start(); 120 83 page->process()->connection()->send(DrawingAreaMessage::SetSize, page->pageID(), CoreIPC::In(viewSize)); … … 131 94 setSize(m_lastSetViewSize); 132 95 133 // Invalidate the backing store. 134 m_bitmapContext = 0; 96 invalidateBackingStore(); 135 97 drawUpdateChunkIntoBackingStore(updateChunk); 136 98 137 WebPageProxy* page = t oWK([m_webView pageRef]);99 WebPageProxy* page = this->page(); 138 100 page->process()->responsivenessTimer()->stop(); 139 101 } … … 142 104 { 143 105 drawUpdateChunkIntoBackingStore(updateChunk); 144 145 WebPageProxy* page = t oWK([m_webView pageRef]);106 107 WebPageProxy* page = this->page(); 146 108 page->process()->connection()->send(DrawingAreaMessage::DidUpdate, page->pageID(), CoreIPC::In()); 147 109 } … … 154 116 if (!arguments.decode(updateChunk)) 155 117 return; 118 156 119 update(&updateChunk); 157 120 break; -
trunk/WebKit2/UIProcess/DrawingAreaProxyUpdateChunk.h
r58184 r58199 29 29 #include "DrawingAreaProxy.h" 30 30 #include <WebCore/IntSize.h> 31 32 #if PLATFORM(MAC) 31 33 #include <wtf/RetainPtr.h> 32 33 34 #ifdef __OBJC__ 34 35 @class WKView; … … 36 37 class WKView; 37 38 #endif 39 #endif 38 40 39 41 namespace WebKit { 40 42 41 43 class UpdateChunk; 44 class WebPageProxy; 45 46 #if PLATFORM(MAC) 47 typedef WKView PlatformWebView; 48 typedef CGContextRef PlatformDrawingContext; 49 #elif PLATFORM(WIN) 50 class WebView; 51 typedef WebView PlatformWebView; 52 typedef HDC PlatformDrawingContext; 53 #endif 42 54 43 55 class DrawingAreaProxyUpdateChunk : public DrawingAreaProxy { 44 56 public: 45 DrawingAreaProxyUpdateChunk( WKView*);57 DrawingAreaProxyUpdateChunk(PlatformWebView*); 46 58 virtual ~DrawingAreaProxyUpdateChunk(); 47 59 48 virtual void drawRectIntoContext(CGRect, CGContextRef);60 virtual void paint(const WebCore::IntRect&, PlatformDrawingContext); 49 61 virtual void setSize(const WebCore::IntSize&); 50 62 … … 58 70 59 71 private: 72 WebPageProxy* page(); 73 74 void ensureBackingStore(); 75 void invalidateBackingStore(); 76 void platformPaint(const WebCore::IntRect&, PlatformDrawingContext); 60 77 void drawUpdateChunkIntoBackingStore(UpdateChunk*); 61 void ensureBackingStore(); 62 63 void didSetSize(UpdateChunk* updateChunk); 78 void didSetSize(UpdateChunk*); 64 79 void update(UpdateChunk*); 65 80 66 bool m_isInitialized;67 81 bool m_isWaitingForDidSetFrameNotification; 68 69 82 WebCore::IntSize m_viewSize; // Size of the BackingStore as well. 70 83 WebCore::IntSize m_lastSetViewSize; 71 84 85 #if PLATFORM(MAC) 86 // BackingStore 72 87 RetainPtr<CGContextRef> m_bitmapContext; 88 #elif PLATFORM(WIN) 89 // BackingStore 90 OwnPtr<HDC> m_backingStoreDC; 91 OwnPtr<HBITMAP> m_backingStoreBitmap; 92 #endif 73 93 74 WKView* m_webView;94 PlatformWebView* m_webView; 75 95 }; 76 96 -
trunk/WebKit2/UIProcess/mac/DrawingAreaProxyUpdateChunkMac.mm
r58184 r58199 24 24 */ 25 25 26 #i mport"DrawingAreaProxyUpdateChunk.h"26 #include "DrawingAreaProxyUpdateChunk.h" 27 27 28 #import "MessageID.h" 29 30 #import "DrawingAreaMessageKinds.h" 31 #import "DrawingAreaProxyMessageKinds.h" 32 #import "WKView.h" 33 #import "UpdateChunk.h" 34 #import "WKAPICast.h" 35 #import "WebCoreTypeArgumentMarshalling.h" 36 #import "WebPageProxy.h" 37 #import "WebProcessProxy.h" 28 #include "DrawingAreaMessageKinds.h" 29 #include "DrawingAreaProxyMessageKinds.h" 30 #include "UpdateChunk.h" 31 #include "WKAPICast.h" 32 #include "WKView.h" 33 #include "WebPageProxy.h" 38 34 39 35 using namespace WebCore; … … 41 37 namespace WebKit { 42 38 43 DrawingAreaProxyUpdateChunk::DrawingAreaProxyUpdateChunk(WKView* webView) 44 : DrawingAreaProxy(DrawingAreaUpdateChunkType) 45 , m_isInitialized(false) 46 , m_isWaitingForDidSetFrameNotification(false) 47 , m_webView(webView) 39 WebPageProxy* DrawingAreaProxyUpdateChunk::page() 48 40 { 49 } 50 51 DrawingAreaProxyUpdateChunk::~DrawingAreaProxyUpdateChunk() 52 { 53 } 54 55 void DrawingAreaProxyUpdateChunk::drawRectIntoContext(CGRect rect, CGContextRef context) 56 { 57 if (!m_isInitialized) { 58 setSize(IntSize([m_webView frame].size)); 59 m_isInitialized = true; 60 } 61 62 if (m_isWaitingForDidSetFrameNotification) { 63 WebPageProxy* page = toWK([m_webView pageRef]); 64 if (!page->isValid()) 65 return; 66 67 std::auto_ptr<CoreIPC::ArgumentDecoder> arguments = page->process()->connection()->waitFor(DrawingAreaProxyMessage::DidSetSize, page->pageID(), 0.04); 68 if (arguments.get()) 69 didReceiveMessage(page->process()->connection(), CoreIPC::MessageID(DrawingAreaProxyMessage::DidSetSize), *arguments.get()); 70 } 71 72 if (!m_bitmapContext) 73 return; 74 75 RetainPtr<CGImageRef> image(AdoptCF, CGBitmapContextCreateImage(m_bitmapContext.get())); 76 CGContextDrawImage(context, CGRectMake(0, 0, CGImageGetWidth(image.get()), CGImageGetHeight(image.get())), image.get()); 77 } 78 79 void DrawingAreaProxyUpdateChunk::drawUpdateChunkIntoBackingStore(UpdateChunk* updateChunk) 80 { 81 ensureBackingStore(); 82 83 RetainPtr<CGImageRef> image(updateChunk->createImage()); 84 const IntRect& updateChunkRect = updateChunk->rect(); 85 86 CGContextDrawImage(m_bitmapContext.get(), CGRectMake(updateChunkRect.x(), m_viewSize.height() - updateChunkRect.bottom(), 87 updateChunkRect.width(), updateChunkRect.height()), image.get()); 88 [m_webView setNeedsDisplayInRect:NSRectFromCGRect(updateChunkRect)]; 41 return toWK([m_webView pageRef]); 89 42 } 90 43 … … 102 55 } 103 56 104 void DrawingAreaProxyUpdateChunk:: setSize(const IntSize& viewSize)57 void DrawingAreaProxyUpdateChunk::invalidateBackingStore() 105 58 { 106 m_isInitialized = true; 59 m_bitmapContext = 0; 60 } 107 61 108 WebPageProxy* page = toWK([m_webView pageRef]); 109 if (!page->isValid()) 62 void DrawingAreaProxyUpdateChunk::platformPaint(const IntRect& rect, CGContextRef context) 63 { 64 if (!m_bitmapContext) 110 65 return; 111 66 112 m_viewSize = viewSize; 113 m_lastSetViewSize = viewSize; 114 115 if (m_isWaitingForDidSetFrameNotification) 116 return; 117 m_isWaitingForDidSetFrameNotification = true; 118 119 page->process()->responsivenessTimer()->start(); 120 page->process()->connection()->send(DrawingAreaMessage::SetSize, page->pageID(), CoreIPC::In(viewSize)); 67 RetainPtr<CGImageRef> image(AdoptCF, CGBitmapContextCreateImage(m_bitmapContext.get())); 68 CGContextDrawImage(context, CGRectMake(0, 0, CGImageGetWidth(image.get()), CGImageGetHeight(image.get())), image.get()); 121 69 } 122 70 123 void DrawingAreaProxyUpdateChunk::d idSetSize(UpdateChunk* updateChunk)71 void DrawingAreaProxyUpdateChunk::drawUpdateChunkIntoBackingStore(UpdateChunk* updateChunk) 124 72 { 125 ASSERT(m_isWaitingForDidSetFrameNotification); 126 m_isWaitingForDidSetFrameNotification = false; 73 ensureBackingStore(); 127 74 128 IntSize viewSize = updateChunk->rect().size(); 75 RetainPtr<CGImageRef> image(updateChunk->createImage()); 76 const IntRect& updateChunkRect = updateChunk->rect(); 129 77 130 if (viewSize != m_lastSetViewSize) 131 setSize(m_lastSetViewSize); 132 133 // Invalidate the backing store. 134 m_bitmapContext = 0; 135 drawUpdateChunkIntoBackingStore(updateChunk); 136 137 WebPageProxy* page = toWK([m_webView pageRef]); 138 page->process()->responsivenessTimer()->stop(); 139 } 140 141 void DrawingAreaProxyUpdateChunk::update(UpdateChunk* updateChunk) 142 { 143 drawUpdateChunkIntoBackingStore(updateChunk); 144 145 WebPageProxy* page = toWK([m_webView pageRef]); 146 page->process()->connection()->send(DrawingAreaMessage::DidUpdate, page->pageID(), CoreIPC::In()); 147 } 148 149 void DrawingAreaProxyUpdateChunk::didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder& arguments) 150 { 151 switch (messageID.get<DrawingAreaProxyMessage::Kind>()) { 152 case DrawingAreaProxyMessage::Update: { 153 UpdateChunk updateChunk; 154 if (!arguments.decode(updateChunk)) 155 return; 156 update(&updateChunk); 157 break; 158 } 159 case DrawingAreaProxyMessage::DidSetSize: { 160 UpdateChunk updateChunk; 161 if (!arguments.decode(CoreIPC::Out(updateChunk))) 162 return; 163 164 didSetSize(&updateChunk); 165 break; 166 } 167 default: 168 ASSERT_NOT_REACHED(); 169 } 78 CGContextDrawImage(m_bitmapContext.get(), CGRectMake(updateChunkRect.x(), m_viewSize.height() - updateChunkRect.bottom(), 79 updateChunkRect.width(), updateChunkRect.height()), image.get()); 80 [m_webView setNeedsDisplayInRect:NSRectFromCGRect(updateChunkRect)]; 170 81 } 171 82 -
trunk/WebKit2/UIProcess/win/DrawingAreaProxyUpdateChunkWin.cpp
r58189 r58199 24 24 */ 25 25 26 #include "DrawingAreaProxy .h"26 #include "DrawingAreaProxyUpdateChunk.h" 27 27 28 #include "Connection.h"29 #include "DrawingAreaMessageKinds.h"30 #include "DrawingAreaProxyMessageKinds.h"31 #include "MessageID.h"32 28 #include "UpdateChunk.h" 33 29 #include "WebProcessProxy.h" 34 30 #include "WebView.h" 35 31 #include <WebCore/BitmapInfo.h> 36 #include <WebCore/IntRect.h>37 32 38 33 using namespace WebCore; … … 40 35 namespace WebKit { 41 36 42 DrawingAreaProxy::DrawingAreaProxy(WebView* webView) 43 : m_isWaitingForDidSetFrameNotification(false) 44 , m_webView(webView) 37 WebPageProxy* DrawingAreaProxyUpdateChunk::page() 45 38 { 39 return m_webView->page(); 46 40 } 47 41 48 DrawingAreaProxy::~DrawingAreaProxy() 49 { 50 } 51 52 void DrawingAreaProxy::ensureBackingStore() 42 void DrawingAreaProxyUpdateChunk::ensureBackingStore() 53 43 { 54 44 if (m_backingStoreBitmap) … … 70 60 } 71 61 72 void DrawingAreaProxy ::paint(HDC hdc, RECT dirtyRect)62 void DrawingAreaProxyUpdateChunk::invalidateBackingStore() 73 63 { 74 if (m_isWaitingForDidSetFrameNotification) { 75 WebPageProxy* page = m_webView->page(); 76 if (!page->isValid()) 77 return; 78 79 std::auto_ptr<CoreIPC::ArgumentDecoder> arguments = page->process()->connection()->waitFor(DrawingAreaProxyMessage::DidSetSize, page->pageID(), 0.04); 80 if (arguments.get()) 81 didReceiveMessage(page->process()->connection(), CoreIPC::MessageID(DrawingAreaProxyMessage::DidSetSize), *arguments.get()); 82 } 64 m_backingStoreBitmap.clear(); 65 } 83 66 67 void DrawingAreaProxyUpdateChunk::platformPaint(const IntRect& rect, HDC hdc) 68 { 84 69 if (!m_backingStoreBitmap) 85 70 return; 86 71 87 72 // BitBlt from the backing-store to the passed in hdc. 88 IntRect rect(dirtyRect);89 73 ::BitBlt(hdc, rect.x(), rect.y(), rect.width(), rect.height(), m_backingStoreDC.get(), rect.x(), rect.y(), SRCCOPY); 90 74 } 91 75 92 void DrawingAreaProxy ::drawUpdateChunkIntoBackingStore(UpdateChunk* updateChunk)76 void DrawingAreaProxyUpdateChunk::drawUpdateChunkIntoBackingStore(UpdateChunk* updateChunk) 93 77 { 94 78 ensureBackingStore(); … … 119 103 } 120 104 121 void DrawingAreaProxy::setSize(const IntSize& viewSize)122 {123 WebPageProxy* page = m_webView->page();124 if (!page->isValid())125 return;126 127 if (viewSize.isEmpty())128 return;129 130 m_viewSize = viewSize;131 m_lastSetViewSize = viewSize;132 133 if (m_isWaitingForDidSetFrameNotification)134 return;135 m_isWaitingForDidSetFrameNotification = true;136 137 page->process()->responsivenessTimer()->start();138 page->process()->connection()->send(DrawingAreaMessage::SetSize, page->pageID(), CoreIPC::In(viewSize));139 }140 141 void DrawingAreaProxy::didSetSize(UpdateChunk* updateChunk)142 {143 ASSERT(m_isWaitingForDidSetFrameNotification);144 m_isWaitingForDidSetFrameNotification = false;145 146 IntSize viewSize = updateChunk->frame().size();147 if (viewSize != m_lastSetViewSize)148 setSize(m_lastSetViewSize);149 150 // Invalidate the backing store.151 m_backingStoreBitmap.clear();152 drawUpdateChunkIntoBackingStore(updateChunk);153 154 WebPageProxy* page = m_webView->page();155 page->process()->responsivenessTimer()->stop();156 }157 158 void DrawingAreaProxy::update(UpdateChunk* updateChunk)159 {160 drawUpdateChunkIntoBackingStore(updateChunk);161 162 WebPageProxy* page = m_webView->page();163 page->process()->connection()->send(DrawingAreaMessage::DidUpdate, page->pageID(), CoreIPC::In());164 }165 166 void DrawingAreaProxy::didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder& arguments)167 {168 switch (messageID.get<DrawingAreaProxyMessage::Kind>()) {169 case DrawingAreaProxyMessage::Update: {170 UpdateChunk updateChunk;171 if (!arguments.decode(updateChunk))172 return;173 174 update(&updateChunk);175 break;176 }177 case DrawingAreaProxyMessage::DidSetSize: {178 UpdateChunk updateChunk;179 if (!arguments.decode(CoreIPC::Out(updateChunk)))180 return;181 182 didSetSize(&updateChunk);183 break;184 }185 default:186 ASSERT_NOT_REACHED();187 }188 }189 190 105 } // namespace WebKit -
trunk/WebKit2/UIProcess/win/WebView.cpp
r57737 r58199 26 26 #include "WebView.h" 27 27 28 #include "DrawingAreaProxy .h"28 #include "DrawingAreaProxyUpdateChunk.h" 29 29 #include "RunLoop.h" 30 30 #include "WebEventFactory.h" … … 170 170 m_page = pageNamespace->createWebPage(); 171 171 m_page->setPageClient(this); 172 m_page->initializeWebPage(IntRect(rect).size(), new DrawingAreaProxy (this));172 m_page->initializeWebPage(IntRect(rect).size(), new DrawingAreaProxyUpdateChunk(this)); 173 173 174 174 m_window = ::CreateWindowEx(0, kWebKit2WebViewWindowClassName, 0, WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, … … 306 306 HDC hdc = ::BeginPaint(m_window, &paintStruct); 307 307 308 m_page->drawingArea()->paint( hdc, paintStruct.rcPaint);308 m_page->drawingArea()->paint(IntRect(paintStruct.rcPaint), hdc); 309 309 310 310 ::EndPaint(m_window, &paintStruct); -
trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj
r58189 r58199 100 100 BC20ED66116F971100094A50 /* WKURLCF.h in Headers */ = {isa = PBXBuildFile; fileRef = BC20ED64116F971100094A50 /* WKURLCF.h */; settings = {ATTRIBUTES = (Public, ); }; }; 101 101 BC20ED67116F971100094A50 /* WKURLCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC20ED65116F971100094A50 /* WKURLCF.cpp */; }; 102 BC2651F611825EF800243E12 /* DrawingAreaProxyUpdateChunkMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC2651F511825EF800243E12 /* DrawingAreaProxyUpdateChunkMac.mm */; }; 103 BC2652161182608100243E12 /* DrawingAreaProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2652121182608100243E12 /* DrawingAreaProxy.cpp */; }; 104 BC2652171182608100243E12 /* DrawingAreaProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2652131182608100243E12 /* DrawingAreaProxy.h */; }; 105 BC2652181182608100243E12 /* DrawingAreaProxyUpdateChunk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2652141182608100243E12 /* DrawingAreaProxyUpdateChunk.cpp */; }; 106 BC2652191182608100243E12 /* DrawingAreaProxyUpdateChunk.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2652151182608100243E12 /* DrawingAreaProxyUpdateChunk.h */; }; 102 107 BC2E6E871141971500A63B1E /* RunLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2E6E771141970C00A63B1E /* RunLoop.cpp */; }; 103 108 BC2E6E881141971500A63B1E /* RunLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2E6E781141970C00A63B1E /* RunLoop.h */; }; … … 127 132 BC9E969A11457EDE00870E71 /* DrawingAreaProxyMessageKinds.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9E969911457EDE00870E71 /* DrawingAreaProxyMessageKinds.h */; }; 128 133 BC9E969C11457F3F00870E71 /* DrawingAreaMessageKinds.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9E969B11457F3F00870E71 /* DrawingAreaMessageKinds.h */; }; 129 BC9E97021145A95600870E71 /* DrawingAreaProxyUpdateChunk.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9E97001145A95600870E71 /* DrawingAreaProxyUpdateChunk.h */; };130 BC9E97031145A95600870E71 /* DrawingAreaProxyUpdateChunk.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC9E97011145A95600870E71 /* DrawingAreaProxyUpdateChunk.mm */; };131 134 BCB63478116BF10600603215 /* WebKit2.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB63477116BF10600603215 /* WebKit2.h */; settings = {ATTRIBUTES = (Public, ); }; }; 132 135 BCB9E2431120DACA00A137E0 /* WebContext.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB9E2411120DACA00A137E0 /* WebContext.h */; }; … … 146 149 BCC57162115ADB42001CCAF9 /* NotImplemented.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC57161115ADB42001CCAF9 /* NotImplemented.h */; }; 147 150 BCC938E11180DE440085E5FE /* WKContextPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC938E01180DE440085E5FE /* WKContextPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 148 BCCF085F113F3B8600C650C5 /* DrawingAreaProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = BCCF085D113F3B8600C650C5 /* DrawingAreaProxy.h */; };149 BCCF0860113F3B8600C650C5 /* DrawingAreaProxy.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCCF085E113F3B8600C650C5 /* DrawingAreaProxy.mm */; };150 151 BCD0042D110C1E27003B8A67 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCD0042C110C1E27003B8A67 /* CoreServices.framework */; }; 151 152 BCD0139B110FA420003B8A67 /* WKFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD01397110FA420003B8A67 /* WKFrame.h */; settings = {ATTRIBUTES = (Public, ); }; }; … … 298 299 BC20ED64116F971100094A50 /* WKURLCF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKURLCF.h; sourceTree = "<group>"; }; 299 300 BC20ED65116F971100094A50 /* WKURLCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKURLCF.cpp; sourceTree = "<group>"; }; 301 BC2651F511825EF800243E12 /* DrawingAreaProxyUpdateChunkMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DrawingAreaProxyUpdateChunkMac.mm; sourceTree = "<group>"; }; 302 BC2652121182608100243E12 /* DrawingAreaProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DrawingAreaProxy.cpp; sourceTree = "<group>"; }; 303 BC2652131182608100243E12 /* DrawingAreaProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingAreaProxy.h; sourceTree = "<group>"; }; 304 BC2652141182608100243E12 /* DrawingAreaProxyUpdateChunk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DrawingAreaProxyUpdateChunk.cpp; sourceTree = "<group>"; }; 305 BC2652151182608100243E12 /* DrawingAreaProxyUpdateChunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingAreaProxyUpdateChunk.h; sourceTree = "<group>"; }; 300 306 BC2E6E771141970C00A63B1E /* RunLoop.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RunLoop.cpp; sourceTree = "<group>"; }; 301 307 BC2E6E781141970C00A63B1E /* RunLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RunLoop.h; sourceTree = "<group>"; }; … … 325 331 BC9E969911457EDE00870E71 /* DrawingAreaProxyMessageKinds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingAreaProxyMessageKinds.h; sourceTree = "<group>"; }; 326 332 BC9E969B11457F3F00870E71 /* DrawingAreaMessageKinds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingAreaMessageKinds.h; sourceTree = "<group>"; }; 327 BC9E97001145A95600870E71 /* DrawingAreaProxyUpdateChunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DrawingAreaProxyUpdateChunk.h; path = mac/DrawingAreaProxyUpdateChunk.h; sourceTree = "<group>"; };328 BC9E97011145A95600870E71 /* DrawingAreaProxyUpdateChunk.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DrawingAreaProxyUpdateChunk.mm; path = mac/DrawingAreaProxyUpdateChunk.mm; sourceTree = "<group>"; };329 333 BCB63477116BF10600603215 /* WebKit2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKit2.h; sourceTree = "<group>"; }; 330 334 BCB86F4B116AAACD00CE20B7 /* WebKit2.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = WebKit2.xcconfig; sourceTree = "<group>"; }; … … 345 349 BCC57161115ADB42001CCAF9 /* NotImplemented.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotImplemented.h; sourceTree = "<group>"; }; 346 350 BCC938E01180DE440085E5FE /* WKContextPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContextPrivate.h; sourceTree = "<group>"; }; 347 BCCF085D113F3B8600C650C5 /* DrawingAreaProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DrawingAreaProxy.h; path = mac/DrawingAreaProxy.h; sourceTree = "<group>"; };348 BCCF085E113F3B8600C650C5 /* DrawingAreaProxy.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DrawingAreaProxy.mm; path = mac/DrawingAreaProxy.mm; sourceTree = "<group>"; };349 351 BCD0042C110C1E27003B8A67 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = "<absolute>"; }; 350 352 BCD01397110FA420003B8A67 /* WKFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKFrame.h; sourceTree = "<group>"; }; … … 593 595 BC111B18112F5FB400337BAB /* Launcher */, 594 596 BCCF085C113F3B7500C650C5 /* mac */, 597 BC2652121182608100243E12 /* DrawingAreaProxy.cpp */, 598 BC2652131182608100243E12 /* DrawingAreaProxy.h */, 599 BC2652141182608100243E12 /* DrawingAreaProxyUpdateChunk.cpp */, 600 BC2652151182608100243E12 /* DrawingAreaProxyUpdateChunk.h */, 595 601 BC6EDAA5111271C600E7678B /* PageClient.h */, 596 602 BC597074116591D000551FCA /* ProcessModel.h */, … … 818 824 isa = PBXGroup; 819 825 children = ( 820 BCCF085D113F3B8600C650C5 /* DrawingAreaProxy.h */, 821 BCCF085E113F3B8600C650C5 /* DrawingAreaProxy.mm */, 822 BC9E97001145A95600870E71 /* DrawingAreaProxyUpdateChunk.h */, 823 BC9E97011145A95600870E71 /* DrawingAreaProxyUpdateChunk.mm */, 824 ); 825 name = mac; 826 BC2651F511825EF800243E12 /* DrawingAreaProxyUpdateChunkMac.mm */, 827 ); 828 path = mac; 826 829 sourceTree = "<group>"; 827 830 }; … … 880 883 BCEE98CD1133174C006BCC24 /* WKPageNamespace.h in Headers */, 881 884 BC1A7C581136E19C00FB7167 /* WebProcessLauncher.h in Headers */, 882 BCCF085F113F3B8600C650C5 /* DrawingAreaProxy.h in Headers */,883 885 BC2E6E881141971500A63B1E /* RunLoop.h in Headers */, 884 886 BC2E6E8C1141971500A63B1E /* WorkItem.h in Headers */, … … 887 889 BC9E969A11457EDE00870E71 /* DrawingAreaProxyMessageKinds.h in Headers */, 888 890 BC9E969C11457F3F00870E71 /* DrawingAreaMessageKinds.h in Headers */, 889 BC9E97021145A95600870E71 /* DrawingAreaProxyUpdateChunk.h in Headers */,890 891 BC1DD7B2114DC396005ADAF3 /* WebCoreTypeArgumentMarshalling.h in Headers */, 891 892 BCC56F791159957D001CCAF9 /* MachPort.h in Headers */, … … 910 911 BCC938E11180DE440085E5FE /* WKContextPrivate.h in Headers */, 911 912 BC5F7BB51182376C0052C02C /* DrawingAreaUpdateChunk.h in Headers */, 913 BC2652171182608100243E12 /* DrawingAreaProxy.h in Headers */, 914 BC2652191182608100243E12 /* DrawingAreaProxyUpdateChunk.h in Headers */, 912 915 ); 913 916 runOnlyForDeploymentPostprocessing = 0; … … 1043 1046 BC963D6B113DD19200574BE2 /* WebPage.cpp in Sources */, 1044 1047 BC963D6E113DD1A500574BE2 /* WebPageMac.mm in Sources */, 1045 BCCF0860113F3B8600C650C5 /* DrawingAreaProxy.mm in Sources */,1046 1048 BC2E6E871141971500A63B1E /* RunLoop.cpp in Sources */, 1047 1049 BC2E6E8D1141971500A63B1E /* WorkQueue.cpp in Sources */, 1048 1050 BC9E95D411449B0300870E71 /* UpdateChunk.cpp in Sources */, 1049 BC9E97031145A95600870E71 /* DrawingAreaProxyUpdateChunk.mm in Sources */,1050 1051 BC0092F7115837A300E0AE2A /* RunLoopMac.mm in Sources */, 1051 1052 BC0092F8115837A300E0AE2A /* WorkQueueMac.cpp in Sources */, … … 1063 1064 BC5F7BB41182376C0052C02C /* DrawingAreaUpdateChunk.cpp in Sources */, 1064 1065 BC5F7BB9118237990052C02C /* DrawingAreaUpdateChunkMac.cpp in Sources */, 1066 BC2651F611825EF800243E12 /* DrawingAreaProxyUpdateChunkMac.mm in Sources */, 1067 BC2652161182608100243E12 /* DrawingAreaProxy.cpp in Sources */, 1068 BC2652181182608100243E12 /* DrawingAreaProxyUpdateChunk.cpp in Sources */, 1065 1069 ); 1066 1070 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebKit2/win/WebKit2.vcproj
r58189 r58199 705 705 > 706 706 <File 707 RelativePath="..\UIProcess\DrawingAreaProxy.cpp" 708 > 709 </File> 710 <File 711 RelativePath="..\UIProcess\DrawingAreaProxy.h" 712 > 713 </File> 714 <File 715 RelativePath="..\UIProcess\DrawingAreaProxyUpdateChunk.cpp" 716 > 717 </File> 718 <File 719 RelativePath="..\UIProcess\DrawingAreaProxyUpdateChunk.h" 720 > 721 </File> 722 <File 707 723 RelativePath="..\UIProcess\PageClient.h" 708 724 > … … 996 1012 > 997 1013 <File 998 RelativePath="..\UIProcess\win\DrawingAreaProxy.cpp" 999 > 1000 </File> 1001 <File 1002 RelativePath="..\UIProcess\win\DrawingAreaProxy.h" 1014 RelativePath="..\UIProcess\win\DrawingAreaProxyUpdateChunkWin.cpp" 1003 1015 > 1004 1016 </File>
Note: See TracChangeset
for help on using the changeset viewer.