Changeset 58189 in webkit


Ignore:
Timestamp:
Apr 23, 2010 2:58:10 PM (14 years ago)
Author:
weinig@apple.com
Message:

Fix for https://bugs.webkit.org/show_bug.cgi?id=38059
Merge mac and win DrawingAreaUpdateChunk implementation.

Reviewed by Anders Carlsson.

  • UIProcess/win/DrawingAreaProxy.cpp:

(WebKit::DrawingAreaProxy::didSetSize):
(WebKit::DrawingAreaProxy::didReceiveMessage):

  • UIProcess/win/DrawingAreaProxy.h:
  • WebKit2.xcodeproj/project.pbxproj:
  • WebProcess/WebPage/DrawingAreaUpdateChunk.cpp: Copied from WebProcess/WebPage/mac/DrawingAreaUpdateChunk.cpp.

(WebKit::DrawingAreaUpdateChunk::setSize):

  • WebProcess/WebPage/DrawingAreaUpdateChunk.h: Copied from WebProcess/WebPage/mac/DrawingAreaUpdateChunk.h.
  • WebProcess/WebPage/mac/DrawingAreaUpdateChunk.cpp: Removed.
  • WebProcess/WebPage/mac/DrawingAreaUpdateChunk.h: Removed.
  • WebProcess/WebPage/mac/DrawingAreaUpdateChunkMac.cpp: Copied from WebProcess/WebPage/mac/DrawingAreaUpdateChunk.cpp.
  • WebProcess/WebPage/win/DrawingAreaUpdateChunk.cpp: Removed.
  • WebProcess/WebPage/win/DrawingAreaUpdateChunk.h: Removed.
  • WebProcess/WebPage/win/DrawingAreaUpdateChunkWin.cpp: Copied from WebProcess/WebPage/win/DrawingAreaUpdateChunk.cpp.

(WebKit::DrawingAreaUpdateChunk::paintIntoUpdateChunk):

  • win/WebKit2.vcproj:
Location:
trunk/WebKit2
Files:
1 deleted
5 edited
1 copied
3 moved

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r58184 r58189  
     12010-04-23  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Fix for https://bugs.webkit.org/show_bug.cgi?id=38059
     6        Merge mac and win DrawingAreaUpdateChunk implementation.
     7
     8        * UIProcess/win/DrawingAreaProxy.cpp:
     9        (WebKit::DrawingAreaProxy::didSetSize):
     10        (WebKit::DrawingAreaProxy::didReceiveMessage):
     11        * UIProcess/win/DrawingAreaProxy.h:
     12        * WebKit2.xcodeproj/project.pbxproj:
     13        * WebProcess/WebPage/DrawingAreaUpdateChunk.cpp: Copied from WebProcess/WebPage/mac/DrawingAreaUpdateChunk.cpp.
     14        (WebKit::DrawingAreaUpdateChunk::setSize):
     15        * WebProcess/WebPage/DrawingAreaUpdateChunk.h: Copied from WebProcess/WebPage/mac/DrawingAreaUpdateChunk.h.
     16        * WebProcess/WebPage/mac/DrawingAreaUpdateChunk.cpp: Removed.
     17        * WebProcess/WebPage/mac/DrawingAreaUpdateChunk.h: Removed.
     18        * WebProcess/WebPage/mac/DrawingAreaUpdateChunkMac.cpp: Copied from WebProcess/WebPage/mac/DrawingAreaUpdateChunk.cpp.
     19        * WebProcess/WebPage/win/DrawingAreaUpdateChunk.cpp: Removed.
     20        * WebProcess/WebPage/win/DrawingAreaUpdateChunk.h: Removed.
     21        * WebProcess/WebPage/win/DrawingAreaUpdateChunkWin.cpp: Copied from WebProcess/WebPage/win/DrawingAreaUpdateChunk.cpp.
     22        (WebKit::DrawingAreaUpdateChunk::paintIntoUpdateChunk):
     23        * win/WebKit2.vcproj:
     24
    1252010-04-23  Anders Carlsson  <andersca@apple.com>
    226
  • trunk/WebKit2/UIProcess/win/DrawingAreaProxy.cpp

    r58180 r58189  
    139139}
    140140
    141 void DrawingAreaProxy::didSetSize(const IntSize& viewSize, UpdateChunk* updateChunk)
     141void DrawingAreaProxy::didSetSize(UpdateChunk* updateChunk)
    142142{
    143143    ASSERT(m_isWaitingForDidSetFrameNotification);
    144144    m_isWaitingForDidSetFrameNotification = false;
    145145
     146    IntSize viewSize = updateChunk->frame().size();
    146147    if (viewSize != m_lastSetViewSize)
    147148        setSize(m_lastSetViewSize);
     
    175176        }
    176177        case DrawingAreaProxyMessage::DidSetSize: {
    177             IntSize viewSize;
    178178            UpdateChunk updateChunk;
    179             if (!arguments.decode(CoreIPC::Out(viewSize, updateChunk)))
     179            if (!arguments.decode(CoreIPC::Out(updateChunk)))
    180180                return;
    181181
    182             didSetSize(viewSize, &updateChunk);
     182            didSetSize(&updateChunk);
    183183            break;
    184184        }
  • trunk/WebKit2/UIProcess/win/DrawingAreaProxy.h

    r57945 r58189  
    6565    void ensureBackingStore();
    6666    void drawUpdateChunkIntoBackingStore(UpdateChunk*);
    67     void didSetSize(const WebCore::IntSize&, UpdateChunk*);
     67    void didSetSize(UpdateChunk*);
    6868    void update(UpdateChunk*);
    6969
  • trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r58125 r58189  
    107107                BC59534210FC04520098F82D /* WebLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BC59534010FC04520098F82D /* WebLoaderClient.h */; };
    108108                BC597075116591D000551FCA /* ProcessModel.h in Headers */ = {isa = PBXBuildFile; fileRef = BC597074116591D000551FCA /* ProcessModel.h */; };
     109                BC5F7BB41182376C0052C02C /* DrawingAreaUpdateChunk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC5F7BB21182376C0052C02C /* DrawingAreaUpdateChunk.cpp */; };
     110                BC5F7BB51182376C0052C02C /* DrawingAreaUpdateChunk.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5F7BB31182376C0052C02C /* DrawingAreaUpdateChunk.h */; };
     111                BC5F7BB9118237990052C02C /* DrawingAreaUpdateChunkMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC5F7BB8118237990052C02C /* DrawingAreaUpdateChunkMac.cpp */; };
    109112                BC617EE8104CB34700FB3FE1 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1C7DE100E846E0078DEBC /* JavaScriptCore.framework */; };
    110113                BC6EDAA6111271C600E7678B /* PageClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BC6EDAA5111271C600E7678B /* PageClient.h */; };
    111114                BC8452A71162C80900CAB9B5 /* DrawingArea.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8452A51162C80900CAB9B5 /* DrawingArea.cpp */; };
    112115                BC8452A81162C80900CAB9B5 /* DrawingArea.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8452A61162C80900CAB9B5 /* DrawingArea.h */; };
    113                 BC8452BB1162C96F00CAB9B5 /* DrawingAreaUpdateChunk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8452B91162C96F00CAB9B5 /* DrawingAreaUpdateChunk.cpp */; };
    114                 BC8452BC1162C96F00CAB9B5 /* DrawingAreaUpdateChunk.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8452BA1162C96F00CAB9B5 /* DrawingAreaUpdateChunk.h */; };
    115116                BC8699B5116AADAA002A925B /* WKView.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8699B2116AADAA002A925B /* WKView.h */; settings = {ATTRIBUTES = (Public, ); }; };
    116117                BC8699B6116AADAA002A925B /* WKView.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC8699B3116AADAA002A925B /* WKView.mm */; };
     
    304305                BC59534010FC04520098F82D /* WebLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebLoaderClient.h; sourceTree = "<group>"; };
    305306                BC597074116591D000551FCA /* ProcessModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessModel.h; sourceTree = "<group>"; };
     307                BC5F7BB21182376C0052C02C /* DrawingAreaUpdateChunk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DrawingAreaUpdateChunk.cpp; sourceTree = "<group>"; };
     308                BC5F7BB31182376C0052C02C /* DrawingAreaUpdateChunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingAreaUpdateChunk.h; sourceTree = "<group>"; };
     309                BC5F7BB8118237990052C02C /* DrawingAreaUpdateChunkMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DrawingAreaUpdateChunkMac.cpp; sourceTree = "<group>"; };
    306310                BC6EDAA5111271C600E7678B /* PageClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageClient.h; sourceTree = "<group>"; };
    307311                BC8452A51162C80900CAB9B5 /* DrawingArea.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DrawingArea.cpp; sourceTree = "<group>"; };
    308312                BC8452A61162C80900CAB9B5 /* DrawingArea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingArea.h; sourceTree = "<group>"; };
    309                 BC8452B91162C96F00CAB9B5 /* DrawingAreaUpdateChunk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DrawingAreaUpdateChunk.cpp; sourceTree = "<group>"; };
    310                 BC8452BA1162C96F00CAB9B5 /* DrawingAreaUpdateChunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingAreaUpdateChunk.h; sourceTree = "<group>"; };
    311313                BC8699B2116AADAA002A925B /* WKView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKView.h; sourceTree = "<group>"; };
    312314                BC8699B3116AADAA002A925B /* WKView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKView.mm; sourceTree = "<group>"; };
     
    575577                                BC8452A51162C80900CAB9B5 /* DrawingArea.cpp */,
    576578                                BC8452A61162C80900CAB9B5 /* DrawingArea.h */,
     579                                BC5F7BB21182376C0052C02C /* DrawingAreaUpdateChunk.cpp */,
     580                                BC5F7BB31182376C0052C02C /* DrawingAreaUpdateChunk.h */,
    577581                                BC111ADC112F5B9300337BAB /* WebFrame.cpp */,
    578582                                BC032D8910F437A00058C15A /* WebFrame.h */,
     
    796800                        isa = PBXGroup;
    797801                        children = (
    798                                 BC8452B91162C96F00CAB9B5 /* DrawingAreaUpdateChunk.cpp */,
    799                                 BC8452BA1162C96F00CAB9B5 /* DrawingAreaUpdateChunk.h */,
     802                                BC5F7BB8118237990052C02C /* DrawingAreaUpdateChunkMac.cpp */,
    800803                                BC963D6D113DD1A500574BE2 /* WebPageMac.mm */,
    801804                        );
     
    891894                                BC8780FC1161C2B800CC2768 /* PlatformProcessIdentifier.h in Headers */,
    892895                                BC8452A81162C80900CAB9B5 /* DrawingArea.h in Headers */,
    893                                 BC8452BC1162C96F00CAB9B5 /* DrawingAreaUpdateChunk.h in Headers */,
    894896                                BC597075116591D000551FCA /* ProcessModel.h in Headers */,
    895897                                BC8699B5116AADAA002A925B /* WKView.h in Headers */,
     
    907909                                BCF69FA91176D1CB00471A52 /* WKNavigationData.h in Headers */,
    908910                                BCC938E11180DE440085E5FE /* WKContextPrivate.h in Headers */,
     911                                BC5F7BB51182376C0052C02C /* DrawingAreaUpdateChunk.h in Headers */,
    909912                        );
    910913                        runOnlyForDeploymentPostprocessing = 0;
     
    10501053                                1A30EAC6115D7DA30053E937 /* ConnectionMac.cpp in Sources */,
    10511054                                BC8452A71162C80900CAB9B5 /* DrawingArea.cpp in Sources */,
    1052                                 BC8452BB1162C96F00CAB9B5 /* DrawingAreaUpdateChunk.cpp in Sources */,
    10531055                                BC8699B6116AADAA002A925B /* WKView.mm in Sources */,
    10541056                                BC20EBB1116EEB0800094A50 /* WKString.cpp in Sources */,
     
    10591061                                BCF69FA31176D01400471A52 /* WebNavigationData.cpp in Sources */,
    10601062                                BCF69FAA1176D1CB00471A52 /* WKNavigationData.cpp in Sources */,
     1063                                BC5F7BB41182376C0052C02C /* DrawingAreaUpdateChunk.cpp in Sources */,
     1064                                BC5F7BB9118237990052C02C /* DrawingAreaUpdateChunkMac.cpp in Sources */,
    10611065                        );
    10621066                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebKit2/WebProcess/WebPage/DrawingAreaUpdateChunk.cpp

    r58184 r58189  
    3333#include "WebPage.h"
    3434#include "WebProcess.h"
    35 #include <WebCore/GraphicsContext.h>
    36 #include <wtf/RetainPtr.h>
    3735
    3836using namespace WebCore;
     
    7977}
    8078
    81 void DrawingAreaUpdateChunk::paintIntoUpdateChunk(UpdateChunk* updateChunk)
    82 {
    83     RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB());
    84     RetainPtr<CGContextRef> bitmapContext(AdoptCF, CGBitmapContextCreate(updateChunk->data(), updateChunk->rect().width(), updateChunk->rect().height(), 8, updateChunk->rect().width() * 4, colorSpace.get(), kCGImageAlphaPremultipliedLast));
    85 
    86     // WebCore expects a flipped coordinate system.
    87     CGContextTranslateCTM(bitmapContext.get(), 0.0, updateChunk->rect().height());
    88     CGContextScaleCTM(bitmapContext.get(), 1.0, -1.0);
    89 
    90     // Now paint into the backing store.
    91     GraphicsContext graphicsContext(bitmapContext.get());
    92     graphicsContext.translate(-updateChunk->rect().x(), -updateChunk->rect().y());
    93    
    94     m_webPage->drawRect(graphicsContext, updateChunk->rect());
    95 }
    96 
    9779void DrawingAreaUpdateChunk::display()
    9880{
     
    131113void DrawingAreaUpdateChunk::setSize(const IntSize& viewSize)
    132114{
     115    ASSERT_ARG(viewSize, !viewSize.isEmpty());
     116
    133117    // We don't want to wait for an update until we display.
    134118    m_isWaitingForUpdate = false;
  • trunk/WebKit2/WebProcess/WebPage/DrawingAreaUpdateChunk.h

    r58184 r58189  
    5050
    5151private:
    52     void paintIntoUpdateChunk(UpdateChunk*);
    53    
    5452    void scheduleDisplay();
    5553    void setSize(const WebCore::IntSize& viewSize);
    5654
    5755    void didUpdate();
     56
     57    // Platform overrides
     58    void paintIntoUpdateChunk(UpdateChunk*);
    5859
    5960    WebCore::IntRect m_dirtyRect;
  • trunk/WebKit2/WebProcess/WebPage/mac/DrawingAreaUpdateChunkMac.cpp

    r58184 r58189  
    2626#include "DrawingAreaUpdateChunk.h"
    2727
    28 #include "DrawingAreaMessageKinds.h"
    29 #include "DrawingAreaProxyMessageKinds.h"
    30 #include "MessageID.h"
    3128#include "UpdateChunk.h"
    32 #include "WebCoreTypeArgumentMarshalling.h"
    3329#include "WebPage.h"
    34 #include "WebProcess.h"
    3530#include <WebCore/GraphicsContext.h>
    3631#include <wtf/RetainPtr.h>
     
    3934
    4035namespace WebKit {
    41 
    42 DrawingAreaUpdateChunk::DrawingAreaUpdateChunk(WebPage* webPage)
    43     : DrawingArea(DrawingAreaUpdateChunkType, webPage)
    44     , m_isWaitingForUpdate(false)
    45     , m_displayTimer(WebProcess::shared().runLoop(), this, &DrawingAreaUpdateChunk::display)
    46 {
    47 }
    48 
    49 DrawingAreaUpdateChunk::~DrawingAreaUpdateChunk()
    50 {
    51 }
    52 
    53 void DrawingAreaUpdateChunk::invalidateWindow(const IntRect& rect, bool immediate)
    54 {
    55 }
    56 
    57 void DrawingAreaUpdateChunk::invalidateContentsAndWindow(const IntRect& rect, bool immediate)
    58 {
    59     setNeedsDisplay(rect);
    60 }
    61 
    62 void DrawingAreaUpdateChunk::invalidateContentsForSlowScroll(const IntRect& rect, bool immediate)
    63 {
    64     setNeedsDisplay(rect);
    65 }
    66 
    67 void DrawingAreaUpdateChunk::scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
    68 {
    69     // FIXME: Do something much smarter.
    70     setNeedsDisplay(rectToScroll);
    71 }
    72 
    73 void DrawingAreaUpdateChunk::setNeedsDisplay(const IntRect& rect)
    74 {
    75     // FIXME: Collect a set of rects/region instead of just the union
    76     // of all rects.
    77     m_dirtyRect.unite(rect);
    78     scheduleDisplay();
    79 }
    8036
    8137void DrawingAreaUpdateChunk::paintIntoUpdateChunk(UpdateChunk* updateChunk)
     
    9551}
    9652
    97 void DrawingAreaUpdateChunk::display()
    98 {
    99     ASSERT(!m_isWaitingForUpdate);
    100 
    101     if (m_dirtyRect.isEmpty())
    102         return;
    103 
    104     // Layout if necessary.
    105     m_webPage->layoutIfNeeded();
    106  
    107     IntRect dirtyRect = m_dirtyRect;
    108     m_dirtyRect = IntRect();
    109 
    110     // Create a new UpdateChunk and paint into it.
    111     UpdateChunk updateChunk(dirtyRect);
    112     paintIntoUpdateChunk(&updateChunk);
    113 
    114     WebProcess::shared().connection()->send(DrawingAreaProxyMessage::Update, m_webPage->pageID(), CoreIPC::In(updateChunk));
    115 
    116     m_isWaitingForUpdate = true;
    117     m_displayTimer.stop();
    118 }
    119 
    120 void DrawingAreaUpdateChunk::scheduleDisplay()
    121 {
    122     if (m_isWaitingForUpdate)
    123         return;
    124    
    125     if (m_displayTimer.isActive())
    126         return;
    127 
    128     m_displayTimer.startOneShot(0);
    129 }
    130 
    131 void DrawingAreaUpdateChunk::setSize(const IntSize& viewSize)
    132 {
    133     // We don't want to wait for an update until we display.
    134     m_isWaitingForUpdate = false;
    135    
    136     m_webPage->setSize(viewSize);
    137 
    138     // Layout if necessary.
    139     m_webPage->layoutIfNeeded();
    140 
    141     // Create a new UpdateChunk and paint into it.
    142     UpdateChunk updateChunk(IntRect(0, 0, viewSize.width(), viewSize.height()));
    143     paintIntoUpdateChunk(&updateChunk);
    144 
    145     m_displayTimer.stop();
    146 
    147     WebProcess::shared().connection()->send(DrawingAreaProxyMessage::DidSetSize, m_webPage->pageID(), CoreIPC::In(updateChunk));
    148 }
    149 
    150 void DrawingAreaUpdateChunk::didUpdate()
    151 {
    152     m_isWaitingForUpdate = false;
    153 
    154     // Display if needed.
    155     display();
    156 }
    157 
    158 void DrawingAreaUpdateChunk::didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder& arguments)
    159 {
    160     switch (messageID.get<DrawingAreaMessage::Kind>()) {
    161         case DrawingAreaMessage::SetSize: {
    162             IntSize size;
    163             if (!arguments.decode(CoreIPC::Out(size)))
    164                 return;
    165 
    166             setSize(size);
    167             break;
    168         }
    169        
    170         case DrawingAreaMessage::DidUpdate:
    171             didUpdate();
    172             break;
    173 
    174         default:
    175             ASSERT_NOT_REACHED();
    176             break;
    177     }
    178 }
    179 
    18053} // namespace WebKit
  • trunk/WebKit2/WebProcess/WebPage/win/DrawingAreaUpdateChunkWin.cpp

    r58184 r58189  
    2626#include "DrawingAreaUpdateChunk.h"
    2727
    28 #include "DrawingAreaMessageKinds.h"
    29 #include "DrawingAreaProxyMessageKinds.h"
    30 #include "MessageID.h"
    3128#include "UpdateChunk.h"
    32 #include "WebCoreTypeArgumentMarshalling.h"
    3329#include "WebPage.h"
    34 #include "WebProcess.h"
    3530#include <WebCore/BitmapInfo.h>
    3631#include <WebCore/GraphicsContext.h>
     
    3934
    4035namespace WebKit {
    41 
    42 DrawingAreaUpdateChunk::DrawingAreaUpdateChunk(WebPage* webPage)
    43     : DrawingArea(DrawingAreaUpdateChunkType, webPage)
    44     , m_isWaitingForUpdate(false)
    45     , m_displayTimer(WebProcess::shared().runLoop(), this, &DrawingArea::display)
    46 {
    47 }
    48 
    49 DrawingAreaUpdateChunk::~DrawingAreaUpdateChunk()
    50 {
    51 }
    52 
    53 void DrawingAreaUpdateChunk::invalidateWindow(const IntRect& rect, bool immediate)
    54 {
    55 }
    56 
    57 void DrawingAreaUpdateChunk::invalidateContentsAndWindow(const IntRect& rect, bool immediate)
    58 {
    59     setNeedsDisplay(rect);
    60 }
    61 
    62 void DrawingAreaUpdateChunk::invalidateContentsForSlowScroll(const IntRect& rect, bool immediate)
    63 {
    64     setNeedsDisplay(rect);
    65 }
    66 
    67 void DrawingAreaUpdateChunk::scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
    68 {
    69     setNeedsDisplay(rectToScroll);
    70 }
    71 
    72 void DrawingAreaUpdateChunk::setNeedsDisplay(const WebCore::IntRect& rect)
    73 {
    74     m_dirtyRect.unite(rect);
    75     scheduleDisplay();
    76 }
    7736
    7837void DrawingAreaUpdateChunk::paintIntoUpdateChunk(UpdateChunk* updateChunk)
     
    8544
    8645    HBITMAP hbmpOld = static_cast<HBITMAP>(::SelectObject(hdc.get(), hbmp.get()));
    87    
     46
    8847    GraphicsContext gc(hdc.get());
    8948    gc.save();
    90    
     49
    9150    // FIXME: Is this white fill needed?
    9251    RECT rect = updateChunk->frame();
     
    10261}
    10362
    104 void DrawingAreaUpdateChunk::display()
    105 {
    106     ASSERT(!m_isWaitingForUpdate);
    107 
    108     if (m_dirtyRect.isEmpty())
    109         return;
    110 
    111     // Layout if necessary.
    112     m_webPage->layoutIfNeeded();
    113 
    114     IntRect dirtyRect = m_dirtyRect;
    115     m_dirtyRect = IntRect();
    116 
    117     UpdateChunk updateChunk(dirtyRect);
    118     paintIntoUpdateChunk(&updateChunk);
    119 
    120     WebProcess::shared().connection()->send(DrawingAreaProxyMessage::Update, m_webPage->pageID(), CoreIPC::In(updateChunk));
    121 
    122     m_isWaitingForUpdate = true;
    123     m_displayTimer.stop();
    124 }
    125 
    126 void DrawingAreaUpdateChunk::scheduleDisplay()
    127 {
    128     if (m_isWaitingForUpdate)
    129         return;
    130 
    131     if (m_displayTimer.isActive())
    132         return;
    133 
    134     m_displayTimer.startOneShot(0);
    135 }
    136 
    137 void DrawingAreaUpdateChunk::setSize(const WebCore::IntSize& viewSize)
    138 {
    139     ASSERT_ARG(viewSize, !viewSize.isEmpty());
    140 
    141     // We don't want to wait for an update until we display.
    142     m_isWaitingForUpdate = false;
    143 
    144     m_webPage->setSize(viewSize);
    145 
    146     // Layout if necessary.
    147     m_webPage->layoutIfNeeded();
    148 
    149     // Create a new UpdateChunk and paint into it.
    150     UpdateChunk updateChunk(IntRect(0, 0, viewSize.width(), viewSize.height()));
    151     paintIntoUpdateChunk(&updateChunk);
    152 
    153     m_displayTimer.stop();
    154 
    155     WebProcess::shared().connection()->send(DrawingAreaProxyMessage::DidSetSize, m_webPage->pageID(), CoreIPC::In(viewSize, updateChunk));
    156 }
    157 
    158 void DrawingAreaUpdateChunk::didUpdate()
    159 {
    160     m_isWaitingForUpdate = false;
    161 
    162     // Display if needed.
    163     display();
    164 }
    165 
    166 void DrawingAreaUpdateChunk::didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder& arguments)
    167 {
    168     switch (messageID.get<DrawingAreaMessage::Kind>()) {
    169         case DrawingAreaMessage::SetSize: {
    170             IntSize size;
    171             if (!arguments.decode(size))
    172                 return;
    173             setSize(size);
    174             break;
    175         }
    176 
    177         case DrawingAreaMessage::DidUpdate:
    178             didUpdate();
    179             break;
    180 
    181         default:
    182             ASSERT_NOT_REACHED();
    183             break;
    184     }
    185 }
    186 
    18763} // namespace WebKit
  • trunk/WebKit2/win/WebKit2.vcproj

    r58117 r58189  
    640640                                </File>
    641641                                <File
     642                                        RelativePath="..\WebProcess\WebPage\DrawingAreaUpdateChunk.cpp"
     643                                        >
     644                                </File>
     645                                <File
     646                                        RelativePath="..\WebProcess\WebPage\DrawingAreaUpdateChunk.h"
     647                                        >
     648                                </File>
     649                                <File
    642650                                        RelativePath="..\WebProcess\WebPage\WebFrame.cpp"
    643651                                        >
     
    659667                                        >
    660668                                        <File
    661                                                 RelativePath="..\WebProcess\WebPage\win\DrawingAreaUpdateChunk.cpp"
    662                                                 >
    663                                         </File>
    664                                         <File
    665                                                 RelativePath="..\WebProcess\WebPage\win\DrawingAreaUpdateChunk.h"
     669                                                RelativePath="..\WebProcess\WebPage\win\DrawingAreaUpdateChunkWin.cpp"
    666670                                                >
    667671                                        </File>
Note: See TracChangeset for help on using the changeset viewer.