Changeset 64364 in webkit
- Timestamp:
- Jul 30, 2010 11:18:04 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r64361 r64364 1 2010-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 1 8 2010-07-30 Adam Roben <aroben@apple.com> 2 9 -
trunk/WebCore/platform/graphics/win/WKCACFContextFlusher.cpp
r64361 r64364 30 30 #include "WKCACFContextFlusher.h" 31 31 32 #include <WebKitSystemInterface/WebKitSystemInterface.h>33 32 #include <wtf/StdLibExtras.h> 33 #include <QuartzCore/CACFContext.h> 34 34 35 35 namespace WebCore { … … 49 49 } 50 50 51 void WKCACFContextFlusher::addContext( WKCACFContext*context)51 void WKCACFContextFlusher::addContext(CACFContextRef context) 52 52 { 53 53 ASSERT(context); 54 54 55 m_contexts.add(context); 55 if (m_contexts.add(context).second) 56 CFRetain(context); 56 57 } 57 58 58 void WKCACFContextFlusher::removeContext( WKCACFContext*context)59 void WKCACFContextFlusher::removeContext(CACFContextRef context) 59 60 { 60 61 ASSERT(context); 61 62 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); 63 69 } 64 70 … … 71 77 72 78 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 } 75 84 } 76 85 -
trunk/WebCore/platform/graphics/win/WKCACFContextFlusher.h
r64361 r64364 33 33 #include <wtf/HashSet.h> 34 34 35 struct WKCACFContext;35 typedef struct _CACFContext* CACFContextRef; 36 36 37 37 namespace WebCore { … … 41 41 static WKCACFContextFlusher& shared(); 42 42 43 void addContext( WKCACFContext*);44 void removeContext( WKCACFContext*);43 void addContext(CACFContextRef); 44 void removeContext(CACFContextRef); 45 45 46 46 void flushAllContexts(); … … 50 50 ~WKCACFContextFlusher(); 51 51 52 typedef HashSet< WKCACFContext*> ContextSet;52 typedef HashSet<CACFContextRef> ContextSet; 53 53 ContextSet m_contexts; 54 54 }; -
trunk/WebCore/platform/graphics/win/WKCACFLayer.cpp
r64361 r64364 31 31 32 32 #include "WKCACFLayerRenderer.h" 33 #include <WebKitSystemInterface/WebKitSystemInterface.h> 33 #include <wtf/text/CString.h> 34 34 35 #include <stdio.h> 36 #include <QuartzCore/CACFContext.h> 37 #include <QuartzCore/CARender.h> 38 39 #ifndef NDEBUG 35 40 #include <wtf/CurrentTime.h> 36 # include <wtf/text/CString.h>41 #endif 37 42 38 43 namespace WebCore { … … 161 166 } 162 167 163 void WKCACFLayer::becomeRootLayerForContext( WKCACFContext*context)164 { 165 wkCACFContextSetLayer(context, layer());168 void WKCACFLayer::becomeRootLayerForContext(CACFContextRef context) 169 { 170 CACFContextSetLayer(context, layer()); 166 171 setNeedsCommit(); 167 172 } -
trunk/WebCore/platform/graphics/win/WKCACFLayer.h
r64361 r64364 43 43 #include "TransformationMatrix.h" 44 44 45 struct WKCACFContext;46 47 45 namespace WebCore { 48 46 … … 83 81 84 82 // Makes this layer the root when the passed context is rendered 85 void becomeRootLayerForContext( WKCACFContext*);83 void becomeRootLayerForContext(CACFContextRef); 86 84 87 85 static RetainPtr<CFTypeRef> cfValue(float value) { return RetainPtr<CFTypeRef>(AdoptCF, CFNumberCreate(0, kCFNumberFloat32Type, &value)); } -
trunk/WebCore/platform/graphics/win/WKCACFLayerRenderer.cpp
r64361 r64364 37 37 #include "WKCACFLayer.h" 38 38 #include "WebCoreInstanceHandle.h" 39 #include <WebKitSystemInterface/WebKitSystemInterface.h> 39 #include <CoreGraphics/CGSRegion.h> 40 #include <QuartzCore/CACFContext.h> 41 #include <QuartzCore/CARenderOGL.h> 40 42 #include <wtf/HashMap.h> 41 43 #include <wtf/OwnArrayPtr.h> … … 107 109 }; 108 110 109 typedef HashMap< WKCACFContext*, WKCACFLayerRenderer*> ContextToWindowMap;111 typedef HashMap<CACFContextRef, WKCACFLayerRenderer*> ContextToWindowMap; 110 112 111 113 static ContextToWindowMap& windowsForContexts() … … 205 207 } 206 208 207 void WKCACFLayerRenderer::didFlushContext( WKCACFContext*context)209 void WKCACFLayerRenderer::didFlushContext(CACFContextRef context) 208 210 { 209 211 WKCACFLayerRenderer* window = windowsForContexts().get(context); … … 227 229 , m_scrollLayer(WKCACFLayer::create(WKCACFLayer::Layer)) 228 230 , 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) 230 234 , m_hostWindow(0) 231 235 , m_renderTimer(this, &WKCACFLayerRenderer::renderTimerFired) … … 235 239 , m_mustResetLostDeviceBeforeRendering(false) 236 240 { 237 windowsForContexts().set(m_context , this);241 windowsForContexts().set(m_context.get(), this); 238 242 239 243 // Under the root layer, we have a clipping layer to clip the content, … … 264 268 265 269 if (m_context) 266 m_rootLayer->becomeRootLayerForContext(m_context );270 m_rootLayer->becomeRootLayerForContext(m_context.get()); 267 271 268 272 #ifndef NDEBUG … … 275 279 { 276 280 destroyRenderer(); 277 wkCACFContextDestroy(m_context);278 281 } 279 282 … … 333 336 void WKCACFLayerRenderer::layerTreeDidChange() 334 337 { 335 WKCACFContextFlusher::shared().addContext(m_context );338 WKCACFContextFlusher::shared().addContext(m_context.get()); 336 339 renderSoon(); 337 340 } … … 411 414 m_d3dDevice->SetTransform(D3DTS_PROJECTION, &projection); 412 415 413 wkCACFContextInitializeD3DDevice(m_context, m_d3dDevice.get());416 m_renderer = CARenderOGLNew(&kCARenderDX9Callbacks, m_d3dDevice.get(), 0); 414 417 415 418 if (IsWindow(m_hostWindow)) … … 422 425 { 423 426 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; 428 435 m_d3dDevice = 0; 429 436 if (s_d3d) … … 513 520 } 514 521 515 void WKCACFLayerRenderer::render(const Vector<CGRect>& windowDirtyRects)522 void WKCACFLayerRenderer::render(const Vector<CGRect>& dirtyRects) 516 523 { 517 524 ASSERT(m_d3dDevice); … … 536 543 537 544 // Give the renderer some space to use. This needs to be valid until the 538 // wkCACFContextFinishUpdate() call below.545 // CARenderUpdateFinish() call below. 539 546 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]); 542 557 543 558 HRESULT err = S_OK; 544 559 do { 560 CGSRegionObj rgn = CARenderUpdateCopyRegion(u); 561 562 if (!rgn) 563 break; 564 545 565 // FIXME: don't need to clear dirty region if layer tree is opaque. 546 566 547 WKCACFUpdateRectEnumerator* e = wkCACFContextCopyUpdateRectEnumerator(m_context);548 if (!e)549 break;550 551 567 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)) { 553 570 D3DRECT rect; 554 571 rect.x1 = r->origin.x; … … 559 576 rects.append(rect); 560 577 } 561 wkCACFUpdateRectEnumeratorRelease(e); 578 CGSReleaseRegionEnumerator(e); 579 CGSReleaseRegion(rgn); 562 580 563 581 if (rects.isEmpty()) … … 567 585 568 586 m_d3dDevice->BeginScene(); 569 wkCACFContextRenderUpdate(m_context);587 CARenderOGLRender(m_renderer, u); 570 588 m_d3dDevice->EndScene(); 571 589 … … 573 591 574 592 if (err == D3DERR_DEVICELOST) { 575 wkCACFContextAddUpdateRect(m_context,bounds);593 CARenderUpdateAddRect(u, &bounds); 576 594 if (!resetDevice(LostDevice)) { 577 595 // We can't reset the device right now. Try again soon. … … 582 600 } while (err == D3DERR_DEVICELOST); 583 601 584 wkCACFContextFinishUpdate(m_context);602 CARenderUpdateFinish(u); 585 603 586 604 #ifndef NDEBUG … … 624 642 { 625 643 ASSERT(m_d3dDevice); 626 ASSERT(m_ context);644 ASSERT(m_renderContext); 627 645 628 646 HRESULT hr = m_d3dDevice->TestCooperativeLevel(); … … 643 661 // We can reset the device. 644 662 645 // We have to release the context's D3D resrouceswhenever we reset the IDirect3DDevice9 in order to663 // We have to purge the CARenderOGLContext whenever we reset the IDirect3DDevice9 in order to 646 664 // destroy any D3DPOOL_DEFAULT resources that Core Animation has allocated (e.g., textures used 647 665 // for mask layers). See <http://msdn.microsoft.com/en-us/library/bb174425(v=VS.85).aspx>. 648 wkCACFContextReleaseD3DResources(m_context);666 CARenderOGLPurge(m_renderer); 649 667 650 668 D3DPRESENT_PARAMETERS parameters = initialPresentationParameters(); -
trunk/WebCore/platform/graphics/win/WKCACFLayerRenderer.h
r64361 r64364 42 42 43 43 interface IDirect3DDevice9; 44 struct WKCACFContext; 44 typedef struct _CACFContext* CACFContextRef; 45 typedef struct _CARenderContext CARenderContext; 46 typedef struct _CARenderOGLContext CARenderOGLContext; 45 47 46 48 namespace WebCore { … … 63 65 64 66 static bool acceleratedCompositingAvailable(); 65 static void didFlushContext( WKCACFContext*);67 static void didFlushContext(CACFContextRef); 66 68 67 69 void setScrollFrame(const IntPoint&, const IntSize&); … … 107 109 RefPtr<WKCACFLayer> m_rootChildLayer; 108 110 RefPtr<WKCACFLayer> m_clipLayer; 109 WKCACFContext* m_context; 111 RetainPtr<CACFContextRef> m_context; 112 CARenderContext* m_renderContext; 113 CARenderOGLContext* m_renderer; 110 114 HWND m_hostWindow; 111 115 Timer<WKCACFLayerRenderer> m_renderTimer; -
trunk/WebKit2/ChangeLog
r64363 r64364 1 2010-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 1 8 2010-07-30 Adam Roben <aroben@apple.com> 2 9 -
trunk/WebKit2/win/WebKit2Apple.vsprops
r64363 r64364 7 7 <Tool 8 8 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" 10 10 ModuleDefinitionFile="WebKit2.def" 11 11 DelayLoadDLLs="QTMovieWin$(WebKitConfigSuffix).dll" -
trunk/WebKitLibraries/ChangeLog
r64361 r64364 1 2010-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 1 8 2010-07-30 Adam Roben <aroben@apple.com> 2 9 -
trunk/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h
r64361 r64364 29 29 struct CGAffineTransform; 30 30 struct CGPoint; 31 struct CGRect;32 31 struct CGSize; 33 struct IDirect3DDevice9;34 struct WKCACFContext;35 struct WKCACFUpdateRectEnumerator;36 32 37 typedef struct _CACFLayer* CACFLayerRef;38 33 typedef const struct __CFData* CFDataRef; 39 34 typedef const struct __CFString* CFStringRef; 40 typedef double CFTimeInterval;41 35 typedef struct CGColor* CGColorRef; 42 36 typedef struct CGContext* CGContextRef; … … 45 39 typedef CGFontIndex CGGlyph; 46 40 typedef wchar_t UChar; 47 typedef struct _CFURLCredential* CFURLCredentialRef;48 41 typedef struct _CFURLResponse* CFURLResponseRef; 49 42 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef; 50 43 typedef struct _CFURLRequest* CFMutableURLRequestRef; 51 44 typedef const struct _CFURLRequest* CFURLRequestRef; 45 typedef struct _CFURLCredential* CFURLCredentialRef; 52 46 typedef struct __CFHTTPMessage* CFHTTPMessageRef; 53 47 typedef const struct __CFNumber* CFNumberRef; … … 57 51 typedef struct tagLOGFONTW LOGFONTW; 58 52 typedef 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;65 53 66 54 void wkSetFontSmoothingLevel(int type); … … 102 90 CFStringRef wkCFNetworkErrorGetLocalizedDescription(CFIndex errorCode); 103 91 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 157 92 #endif // WebKitSystemInterface_h
Note: See TracChangeset
for help on using the changeset viewer.