Changeset 64364 in webkit


Ignore:
Timestamp:
Jul 30, 2010 11:18:04 AM (14 years ago)
Author:
Adam Roben
Message:

Roll our r64361 and r64363

We can't make these changes until QuartzCore.lib is included in
WebKitSupportLibrary.

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r64361 r64364  
     12010-07-30  Adam Roben  <aroben@apple.com>
     2
     3        Roll our r64361 and r64363
     4
     5        We can't make these changes until QuartzCore.lib is included in
     6        WebKitSupportLibrary.
     7
    182010-07-30  Adam Roben  <aroben@apple.com>
    29
  • trunk/WebCore/platform/graphics/win/WKCACFContextFlusher.cpp

    r64361 r64364  
    3030#include "WKCACFContextFlusher.h"
    3131
    32 #include <WebKitSystemInterface/WebKitSystemInterface.h>
    3332#include <wtf/StdLibExtras.h>
     33#include <QuartzCore/CACFContext.h>
    3434
    3535namespace WebCore {
     
    4949}
    5050
    51 void WKCACFContextFlusher::addContext(WKCACFContext* context)
     51void WKCACFContextFlusher::addContext(CACFContextRef context)
    5252{
    5353    ASSERT(context);
    5454
    55     m_contexts.add(context);
     55    if (m_contexts.add(context).second)
     56        CFRetain(context);
    5657}
    5758
    58 void WKCACFContextFlusher::removeContext(WKCACFContext* context)
     59void WKCACFContextFlusher::removeContext(CACFContextRef context)
    5960{
    6061    ASSERT(context);
    6162
    62     m_contexts.remove(context);
     63    ContextSet::iterator found = m_contexts.find(context);
     64    if (found == m_contexts.end())
     65        return;
     66
     67    CFRelease(*found);
     68    m_contexts.remove(found);
    6369}
    6470
     
    7177
    7278    ContextSet::const_iterator end = contextsToFlush.end();
    73     for (ContextSet::const_iterator it = contextsToFlush.begin(); it != end; ++it)
    74         wkCACFContextFlush(*it);
     79    for (ContextSet::const_iterator it = contextsToFlush.begin(); it != end; ++it) {
     80        CACFContextRef context = *it;
     81        CACFContextFlush(context);
     82        CFRelease(context);
     83    }
    7584}
    7685
  • trunk/WebCore/platform/graphics/win/WKCACFContextFlusher.h

    r64361 r64364  
    3333#include <wtf/HashSet.h>
    3434
    35 struct WKCACFContext;
     35typedef struct _CACFContext* CACFContextRef;
    3636
    3737namespace WebCore {
     
    4141    static WKCACFContextFlusher& shared();
    4242
    43     void addContext(WKCACFContext*);
    44     void removeContext(WKCACFContext*);
     43    void addContext(CACFContextRef);
     44    void removeContext(CACFContextRef);
    4545
    4646    void flushAllContexts();
     
    5050    ~WKCACFContextFlusher();
    5151
    52     typedef HashSet<WKCACFContext*> ContextSet;
     52    typedef HashSet<CACFContextRef> ContextSet;
    5353    ContextSet m_contexts;
    5454};
  • trunk/WebCore/platform/graphics/win/WKCACFLayer.cpp

    r64361 r64364  
    3131
    3232#include "WKCACFLayerRenderer.h"
    33 #include <WebKitSystemInterface/WebKitSystemInterface.h>
     33#include <wtf/text/CString.h>
     34
    3435#include <stdio.h>
     36#include <QuartzCore/CACFContext.h>
     37#include <QuartzCore/CARender.h>
     38
     39#ifndef NDEBUG
    3540#include <wtf/CurrentTime.h>
    36 #include <wtf/text/CString.h>
     41#endif
    3742
    3843namespace WebCore {
     
    161166}
    162167
    163 void WKCACFLayer::becomeRootLayerForContext(WKCACFContext* context)
    164 {
    165     wkCACFContextSetLayer(context, layer());
     168void WKCACFLayer::becomeRootLayerForContext(CACFContextRef context)
     169{
     170    CACFContextSetLayer(context, layer());
    166171    setNeedsCommit();
    167172}
  • trunk/WebCore/platform/graphics/win/WKCACFLayer.h

    r64361 r64364  
    4343#include "TransformationMatrix.h"
    4444
    45 struct WKCACFContext;
    46 
    4745namespace WebCore {
    4846
     
    8381
    8482    // Makes this layer the root when the passed context is rendered
    85     void becomeRootLayerForContext(WKCACFContext*);
     83    void becomeRootLayerForContext(CACFContextRef);
    8684
    8785    static RetainPtr<CFTypeRef> cfValue(float value) { return RetainPtr<CFTypeRef>(AdoptCF, CFNumberCreate(0, kCFNumberFloat32Type, &value)); }
  • trunk/WebCore/platform/graphics/win/WKCACFLayerRenderer.cpp

    r64361 r64364  
    3737#include "WKCACFLayer.h"
    3838#include "WebCoreInstanceHandle.h"
    39 #include <WebKitSystemInterface/WebKitSystemInterface.h>
     39#include <CoreGraphics/CGSRegion.h>
     40#include <QuartzCore/CACFContext.h>
     41#include <QuartzCore/CARenderOGL.h>
    4042#include <wtf/HashMap.h>
    4143#include <wtf/OwnArrayPtr.h>
     
    107109};
    108110
    109 typedef HashMap<WKCACFContext*, WKCACFLayerRenderer*> ContextToWindowMap;
     111typedef HashMap<CACFContextRef, WKCACFLayerRenderer*> ContextToWindowMap;
    110112
    111113static ContextToWindowMap& windowsForContexts()
     
    205207}
    206208
    207 void WKCACFLayerRenderer::didFlushContext(WKCACFContext* context)
     209void WKCACFLayerRenderer::didFlushContext(CACFContextRef context)
    208210{
    209211    WKCACFLayerRenderer* window = windowsForContexts().get(context);
     
    227229    , m_scrollLayer(WKCACFLayer::create(WKCACFLayer::Layer))
    228230    , m_clipLayer(WKCACFLayer::create(WKCACFLayer::Layer))
    229     , m_context(wkCACFContextCreate())
     231    , m_context(AdoptCF, CACFContextCreate(0))
     232    , m_renderContext(static_cast<CARenderContext*>(CACFContextGetRenderContext(m_context.get())))
     233    , m_renderer(0)
    230234    , m_hostWindow(0)
    231235    , m_renderTimer(this, &WKCACFLayerRenderer::renderTimerFired)
     
    235239    , m_mustResetLostDeviceBeforeRendering(false)
    236240{
    237     windowsForContexts().set(m_context, this);
     241    windowsForContexts().set(m_context.get(), this);
    238242
    239243    // Under the root layer, we have a clipping layer to clip the content,
     
    264268
    265269    if (m_context)
    266         m_rootLayer->becomeRootLayerForContext(m_context);
     270        m_rootLayer->becomeRootLayerForContext(m_context.get());
    267271
    268272#ifndef NDEBUG
     
    275279{
    276280    destroyRenderer();
    277     wkCACFContextDestroy(m_context);
    278281}
    279282
     
    333336void WKCACFLayerRenderer::layerTreeDidChange()
    334337{
    335     WKCACFContextFlusher::shared().addContext(m_context);
     338    WKCACFContextFlusher::shared().addContext(m_context.get());
    336339    renderSoon();
    337340}
     
    411414    m_d3dDevice->SetTransform(D3DTS_PROJECTION, &projection);
    412415
    413     wkCACFContextInitializeD3DDevice(m_context, m_d3dDevice.get());
     416    m_renderer = CARenderOGLNew(&kCARenderDX9Callbacks, m_d3dDevice.get(), 0);
    414417
    415418    if (IsWindow(m_hostWindow))
     
    422425{
    423426    if (m_context) {
    424         windowsForContexts().remove(m_context);
    425         WKCACFContextFlusher::shared().removeContext(m_context);
    426     }
    427 
     427        CACFContextSetLayer(m_context.get(), 0);
     428        windowsForContexts().remove(m_context.get());
     429        WKCACFContextFlusher::shared().removeContext(m_context.get());
     430    }
     431
     432    if (m_renderer)
     433        CARenderOGLDestroy(m_renderer);
     434    m_renderer = 0;
    428435    m_d3dDevice = 0;
    429436    if (s_d3d)
     
    513520}
    514521
    515 void WKCACFLayerRenderer::render(const Vector<CGRect>& windowDirtyRects)
     522void WKCACFLayerRenderer::render(const Vector<CGRect>& dirtyRects)
    516523{
    517524    ASSERT(m_d3dDevice);
     
    536543
    537544    // Give the renderer some space to use. This needs to be valid until the
    538     // wkCACFContextFinishUpdate() call below.
     545    // CARenderUpdateFinish() call below.
    539546    char space[4096];
    540     if (!wkCACFContextBeginUpdate(m_context, space, sizeof(space), t, bounds, windowDirtyRects.data(), windowDirtyRects.size()))
    541         return;
     547    CARenderUpdate* u = CARenderUpdateBegin(space, sizeof(space), t, 0, 0, &bounds);
     548    if (!u)
     549        return;
     550
     551    CARenderContextLock(m_renderContext);
     552    CARenderUpdateAddContext(u, m_renderContext);
     553    CARenderContextUnlock(m_renderContext);
     554
     555    for (size_t i = 0; i < dirtyRects.size(); ++i)
     556        CARenderUpdateAddRect(u, &dirtyRects[i]);
    542557
    543558    HRESULT err = S_OK;
    544559    do {
     560        CGSRegionObj rgn = CARenderUpdateCopyRegion(u);
     561
     562        if (!rgn)
     563            break;
     564
    545565        // FIXME: don't need to clear dirty region if layer tree is opaque.
    546566
    547         WKCACFUpdateRectEnumerator* e = wkCACFContextCopyUpdateRectEnumerator(m_context);
    548         if (!e)
    549             break;
    550 
    551567        Vector<D3DRECT, 64> rects;
    552         for (const CGRect* r = wkCACFUpdateRectEnumeratorNextRect(e); r; r = wkCACFUpdateRectEnumeratorNextRect(e)) {
     568        CGSRegionEnumeratorObj e = CGSRegionEnumerator(rgn);
     569        for (const CGRect* r = CGSNextRect(e); r; r = CGSNextRect(e)) {
    553570            D3DRECT rect;
    554571            rect.x1 = r->origin.x;
     
    559576            rects.append(rect);
    560577        }
    561         wkCACFUpdateRectEnumeratorRelease(e);
     578        CGSReleaseRegionEnumerator(e);
     579        CGSReleaseRegion(rgn);
    562580
    563581        if (rects.isEmpty())
     
    567585
    568586        m_d3dDevice->BeginScene();
    569         wkCACFContextRenderUpdate(m_context);
     587        CARenderOGLRender(m_renderer, u);
    570588        m_d3dDevice->EndScene();
    571589
     
    573591
    574592        if (err == D3DERR_DEVICELOST) {
    575             wkCACFContextAddUpdateRect(m_context, bounds);
     593            CARenderUpdateAddRect(u, &bounds);
    576594            if (!resetDevice(LostDevice)) {
    577595                // We can't reset the device right now. Try again soon.
     
    582600    } while (err == D3DERR_DEVICELOST);
    583601
    584     wkCACFContextFinishUpdate(m_context);
     602    CARenderUpdateFinish(u);
    585603
    586604#ifndef NDEBUG
     
    624642{
    625643    ASSERT(m_d3dDevice);
    626     ASSERT(m_context);
     644    ASSERT(m_renderContext);
    627645
    628646    HRESULT hr = m_d3dDevice->TestCooperativeLevel();
     
    643661    // We can reset the device.
    644662
    645     // We have to release the context's D3D resrouces whenever we reset the IDirect3DDevice9 in order to
     663    // We have to purge the CARenderOGLContext whenever we reset the IDirect3DDevice9 in order to
    646664    // destroy any D3DPOOL_DEFAULT resources that Core Animation has allocated (e.g., textures used
    647665    // for mask layers). See <http://msdn.microsoft.com/en-us/library/bb174425(v=VS.85).aspx>.
    648     wkCACFContextReleaseD3DResources(m_context);
     666    CARenderOGLPurge(m_renderer);
    649667
    650668    D3DPRESENT_PARAMETERS parameters = initialPresentationParameters();
  • trunk/WebCore/platform/graphics/win/WKCACFLayerRenderer.h

    r64361 r64364  
    4242
    4343interface IDirect3DDevice9;
    44 struct WKCACFContext;
     44typedef struct _CACFContext* CACFContextRef;
     45typedef struct _CARenderContext CARenderContext;
     46typedef struct _CARenderOGLContext CARenderOGLContext;
    4547
    4648namespace WebCore {
     
    6365
    6466    static bool acceleratedCompositingAvailable();
    65     static void didFlushContext(WKCACFContext*);
     67    static void didFlushContext(CACFContextRef);
    6668
    6769    void setScrollFrame(const IntPoint&, const IntSize&);
     
    107109    RefPtr<WKCACFLayer> m_rootChildLayer;
    108110    RefPtr<WKCACFLayer> m_clipLayer;
    109     WKCACFContext* m_context;
     111    RetainPtr<CACFContextRef> m_context;
     112    CARenderContext* m_renderContext;
     113    CARenderOGLContext* m_renderer;
    110114    HWND m_hostWindow;
    111115    Timer<WKCACFLayerRenderer> m_renderTimer;
  • trunk/WebKit2/ChangeLog

    r64363 r64364  
     12010-07-30  Adam Roben  <aroben@apple.com>
     2
     3        Roll our r64361 and r64363
     4
     5        We can't make these changes until QuartzCore.lib is included in
     6        WebKitSupportLibrary.
     7
    182010-07-30  Adam Roben  <aroben@apple.com>
    29
  • trunk/WebKit2/win/WebKit2Apple.vsprops

    r64363 r64364  
    77        <Tool
    88                Name="VCLinkerTool"
    9                 AdditionalDependencies="CFNetwork$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib QTMovieWin$(WebKitConfigSuffix).lib WebKitSystemInterface$(WebKitConfigSuffix).lib QuartzCore$(WebKitConfigSuffix).lib"
     9                AdditionalDependencies="CFNetwork$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib QTMovieWin$(WebKitConfigSuffix).lib WebKitSystemInterface$(WebKitConfigSuffix).lib"
    1010                ModuleDefinitionFile="WebKit2.def"
    1111                DelayLoadDLLs="QTMovieWin$(WebKitConfigSuffix).dll"
  • trunk/WebKitLibraries/ChangeLog

    r64361 r64364  
     12010-07-30  Adam Roben  <aroben@apple.com>
     2
     3        Roll our r64361 and r64363
     4
     5        We can't make these changes until QuartzCore.lib is included in
     6        WebKitSupportLibrary.
     7
    182010-07-30  Adam Roben  <aroben@apple.com>
    29
  • trunk/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h

    r64361 r64364  
    2929struct CGAffineTransform;
    3030struct CGPoint;
    31 struct CGRect;
    3231struct CGSize;
    33 struct IDirect3DDevice9;
    34 struct WKCACFContext;
    35 struct WKCACFUpdateRectEnumerator;
    3632
    37 typedef struct _CACFLayer* CACFLayerRef;
    3833typedef const struct __CFData* CFDataRef;
    3934typedef const struct __CFString* CFStringRef;
    40 typedef double CFTimeInterval;
    4135typedef struct CGColor* CGColorRef;
    4236typedef struct CGContext* CGContextRef;
     
    4539typedef CGFontIndex CGGlyph;
    4640typedef wchar_t UChar;
    47 typedef struct _CFURLCredential* CFURLCredentialRef;
    4841typedef struct _CFURLResponse* CFURLResponseRef;
    4942typedef struct OpaqueCFHTTPCookieStorage*  CFHTTPCookieStorageRef;
    5043typedef struct _CFURLRequest* CFMutableURLRequestRef;
    5144typedef const struct _CFURLRequest* CFURLRequestRef;
     45typedef struct _CFURLCredential* CFURLCredentialRef;
    5246typedef struct __CFHTTPMessage* CFHTTPMessageRef;
    5347typedef const struct __CFNumber* CFNumberRef;
     
    5751typedef struct tagLOGFONTW LOGFONTW;
    5852typedef LOGFONTW LOGFONT;
    59 typedef struct _CACFLayer *CACFLayerRef;
    60 typedef struct __CVBuffer *CVBufferRef;
    61 typedef CVBufferRef CVImageBufferRef;
    62 typedef CVImageBufferRef CVPixelBufferRef;
    63 typedef struct _CAImageQueue *CAImageQueueRef;
    64 typedef unsigned long CFTypeID;
    6553
    6654void wkSetFontSmoothingLevel(int type);
     
    10290CFStringRef wkCFNetworkErrorGetLocalizedDescription(CFIndex errorCode);
    10391
    104 
    105 enum wkCAImageQueueFlags {
    106     kWKCAImageQueueAsync = 1U << 0,
    107     kWKCAImageQueueFill = 1U << 1,
    108     kWKCAImageQueueProtected = 1U << 2,
    109     kWKCAImageQueueUseCleanAperture = 1U << 3,
    110     kWKCAImageQueueUseAspectRatio = 1U << 4,
    111     kWKCAImageQueueLowQualityColor = 1U << 5,
    112 };
    113 
    114 enum wkWKCAImageQueueImageType {
    115     kWKCAImageQueueNil = 1,
    116     kWKCAImageQueueSurface,
    117     kWKCAImageQueueBuffer,
    118     kWKCAImageQueueIOSurface,
    119 };
    120 
    121 enum wkWKCAImageQueueImageFlags {
    122     kWKCAImageQueueOpaque = 1U << 0,
    123     kWKCAImageQueueFlush = 1U << 1,
    124     kWKCAImageQueueWillFlush = 1U << 2,
    125     kWKCAImageQueueFlipped = 1U << 3,
    126     kWKCAImageQueueWaitGPU = 1U << 4,
    127 };
    128 
    129 typedef void (*wkCAImageQueueReleaseCallback)(unsigned int type, uint64_t id, void *info);
    130 CAImageQueueRef wkCAImageQueueCreate(uint32_t width, uint32_t height, uint32_t capacity);
    131 void wkCAImageQueueInvalidate(CAImageQueueRef iq);
    132 size_t wkCAImageQueueCollect(CAImageQueueRef iq);
    133 bool wkCAImageQueueInsertImage(CAImageQueueRef iq, CFTimeInterval t, unsigned int type, uint64_t id, uint32_t flags, wkCAImageQueueReleaseCallback release, void *info);
    134 uint64_t wkCAImageQueueRegisterPixelBuffer(CAImageQueueRef iq, void *data, size_t data_size, size_t rowbytes, size_t width, size_t height, OSType pixel_format, CFDictionaryRef attachments, uint32_t flags);
    135 void wkCAImageQueueSetFlags(CAImageQueueRef iq, uint32_t mask, uint32_t flags);
    136 uint32_t wkCAImageQueueGetFlags(CAImageQueueRef iq);
    137 CFTypeID wkCAImageQueueGetTypeID(void);
    138 
    139 WKCACFContext* wkCACFContextCreate();
    140 void wkCACFContextDestroy(WKCACFContext*);
    141 
    142 void wkCACFContextSetLayer(WKCACFContext*, CACFLayerRef);
    143 void wkCACFContextFlush(WKCACFContext*);
    144 
    145 void wkCACFContextInitializeD3DDevice(WKCACFContext*, IDirect3DDevice9*);
    146 void wkCACFContextReleaseD3DResources(WKCACFContext*);
    147 
    148 bool wkCACFContextBeginUpdate(WKCACFContext*, void* buffer, size_t bufferSize, CFTimeInterval time, const CGRect& bounds, const CGRect dirtyRects[], size_t dirtyRectCount);
    149 void wkCACFContextRenderUpdate(WKCACFContext*);
    150 void wkCACFContextFinishUpdate(WKCACFContext*);
    151 void wkCACFContextAddUpdateRect(WKCACFContext*, const CGRect&);
    152 
    153 WKCACFUpdateRectEnumerator* wkCACFContextCopyUpdateRectEnumerator(WKCACFContext*);
    154 const CGRect* wkCACFUpdateRectEnumeratorNextRect(WKCACFUpdateRectEnumerator*);
    155 void wkCACFUpdateRectEnumeratorRelease(WKCACFUpdateRectEnumerator*);
    156 
    15792#endif // WebKitSystemInterface_h
Note: See TracChangeset for help on using the changeset viewer.