Changeset 106371 in webkit
- Timestamp:
- Jan 31, 2012 11:11:54 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/chromium/ChangeLog
r106353 r106371 1 2012-01-31 Antoine Labour <piman@chromium.org> 2 3 Merge WebGraphicsContext3D creation and initialization, and move it to 4 WebViewClient. 5 https://bugs.webkit.org/show_bug.cgi?id=76593 6 7 Reviewed by Darin Fisher. 8 9 * public/WebViewClient.h: 10 (WebKit::WebViewClient::createGraphicsContext3D): 11 * public/platform/WebGraphicsContext3D.h: 12 (WebKit::WebGraphicsContext3D::initialize): 13 * public/platform/WebKitPlatformSupport.h: 14 * src/GraphicsContext3DChromium.cpp: 15 1 16 2012-01-26 Hans Wennborg <hans@chromium.org> 2 17 -
trunk/Source/WebKit/chromium/public/WebViewClient.h
r103215 r106371 43 43 #include "WebWidgetClient.h" 44 44 #include "platform/WebColor.h" 45 #include "platform/WebGraphicsContext3D.h" 45 46 #include "platform/WebString.h" 46 47 … … 110 111 virtual WebStorageNamespace* createSessionStorageNamespace(unsigned quota) { return 0; } 111 112 113 // Creates a graphics context associated with the client's WebView. 114 // renderDirectlyToWebView means whether the context should be setup to 115 // render directly to the WebView (e.g. compositor context), or to an 116 // offscreen surface (e.g. WebGL context). 117 virtual WebGraphicsContext3D* createGraphicsContext3D(const WebGraphicsContext3D::Attributes&, bool renderDirectlyToWebView) { return 0; } 118 112 119 // Misc ---------------------------------------------------------------- 113 120 -
trunk/Source/WebKit/chromium/public/platform/WebGraphicsContext3D.h
r106320 r106371 134 134 virtual ~WebGraphicsContext3D() {} 135 135 136 // Initializes the graphics context; should be the first operation performed 137 // on newly-constructed instances. Returns true on success. 138 virtual bool initialize(Attributes, WebView*, bool renderDirectlyToWebView) = 0; 136 // This function is deprecated and will be removed soon. 137 virtual bool initialize(Attributes, WebView*, bool renderDirectlyToWebView) { return false; } 139 138 140 139 // Makes the OpenGL context current on the current thread. Returns true on -
trunk/Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h
r101335 r106371 37 37 #include "WebData.h" 38 38 #include "WebGamepads.h" 39 #include "WebGraphicsContext3D.h" 39 40 #include "WebLocalizedString.h" 40 41 #include "WebSerializedScriptValue.h" … … 314 315 virtual void callOnMainThread(void (*func)(void*), void* context) { } 315 316 316 // WebGL--------------------------------------------------------------317 318 // May return null if WebGLis not supported.319 // Returns newly allocated WebGraphicsContext3D instance.320 virtual WebGraphicsContext3D* create GraphicsContext3D() { return 0; }317 // GPU ---------------------------------------------------------------- 318 // 319 // May return null if GPU is not supported. 320 // Returns newly allocated and initialized offscreen WebGraphicsContext3D instance. 321 virtual WebGraphicsContext3D* createOffscreenGraphicsContext3D(const WebGraphicsContext3D::Attributes&) { return 0; } 321 322 322 323 // Audio -------------------------------------------------------------- -
trunk/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp
r106320 r106371 47 47 #include "ImageData.h" 48 48 #include "WebKit.h" 49 #include " platform/WebKitPlatformSupport.h"49 #include "WebViewClient.h" 50 50 #include "WebViewImpl.h" 51 51 #include "platform/WebGraphicsContext3D.h" 52 #include "platform/WebKitPlatformSupport.h" 52 53 53 54 #include <stdio.h> … … 152 153 webAttributes.shareResources = attrs.shareResources; 153 154 webAttributes.forUseOnAnotherThread = threadUsage == GraphicsContext3DPrivate::ForUseOnAnotherThread; 154 OwnPtr<WebKit::WebGraphicsContext3D> webContext = adoptPtr(WebKit::webKitPlatformSupport()->createGraphicsContext3D());155 if (!webContext)156 return 0;157 155 158 156 Chrome* chrome = static_cast<Chrome*>(hostWindow); 159 157 WebKit::WebViewImpl* webViewImpl = chrome ? static_cast<WebKit::WebViewImpl*>(chrome->client()->webView()) : 0; 160 161 if (!webContext->initialize(webAttributes, webViewImpl, renderDirectlyToHostWindow)) 158 OwnPtr<WebKit::WebGraphicsContext3D> webContext; 159 if (!webViewImpl || !webViewImpl->client()) { 160 if (renderDirectlyToHostWindow) 161 return 0; 162 webContext = adoptPtr(WebKit::webKitPlatformSupport()->createOffscreenGraphicsContext3D(webAttributes)); 163 } else 164 webContext = adoptPtr(webViewImpl->client()->createGraphicsContext3D(webAttributes, renderDirectlyToHostWindow)); 165 if (!webContext) 162 166 return 0; 163 167 -
trunk/Tools/ChangeLog
r106369 r106371 1 2012-01-31 Antoine Labour <piman@chromium.org> 2 3 Merge WebGraphicsContext3D creation and initialization, and move it to 4 WebViewClient. 5 https://bugs.webkit.org/show_bug.cgi?id=76593 6 7 Reviewed by Darin Fisher. 8 9 * DumpRenderTree/chromium/TestWebPlugin.cpp: 10 (TestWebPlugin::TestWebPlugin): 11 (TestWebPlugin::initialize): 12 * DumpRenderTree/chromium/TestWebPlugin.h: 13 * DumpRenderTree/chromium/WebViewHost.cpp: 14 (WebViewHost::createGraphicsContext3D): 15 (WebViewHost::createPlugin): 16 * DumpRenderTree/chromium/WebViewHost.h: 17 1 18 2012-01-31 Gabor Rapcsanyi <rgabor@webkit.org> 2 19 -
trunk/Tools/DumpRenderTree/chromium/TestWebPlugin.cpp
r102044 r106371 33 33 #include "WebPluginContainer.h" 34 34 #include "WebPluginParams.h" 35 #include "WebViewClient.h" 35 36 #include <wtf/Assertions.h> 36 37 #include <wtf/text/CString.h> … … 62 63 } 63 64 64 TestWebPlugin::TestWebPlugin(WebKit::WebFrame* frame, 65 TestWebPlugin::TestWebPlugin(WebKit::WebViewClient* webViewClient, 66 WebKit::WebFrame* frame, 65 67 const WebKit::WebPluginParams& params) 66 : m_frame(frame) 68 : m_webViewClient(webViewClient) 69 , m_frame(frame) 67 70 , m_container(0) 68 71 , m_context(0) … … 102 105 bool TestWebPlugin::initialize(WebPluginContainer* container) 103 106 { 104 m_context = webKitPlatformSupport()->createGraphicsContext3D(); 107 WebGraphicsContext3D::Attributes attrs; 108 m_context = m_webViewClient->createGraphicsContext3D(attrs, false); 105 109 if (!m_context) 106 return false;107 108 WebGraphicsContext3D::Attributes attrs;109 if (!m_context->initialize(attrs, m_frame->view(), false))110 110 return false; 111 111 -
trunk/Tools/DumpRenderTree/chromium/TestWebPlugin.h
r102044 r106371 32 32 namespace WebKit { 33 33 class WebGraphicsContext3D; 34 class WebViewClient; 34 35 } 35 36 … … 45 46 class TestWebPlugin : public WebKit::WebPlugin { 46 47 public: 47 TestWebPlugin(WebKit::Web Frame*, const WebKit::WebPluginParams&);48 TestWebPlugin(WebKit::WebViewClient*, WebKit::WebFrame*, const WebKit::WebPluginParams&); 48 49 virtual ~TestWebPlugin(); 49 50 … … 116 117 const WTF::CString& fragmentSource); 117 118 119 WebKit::WebViewClient* m_webViewClient; 118 120 WebKit::WebFrame* m_frame; 119 121 WebKit::WebPluginContainer* m_container; -
trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp
r106353 r106371 273 273 } 274 274 275 WebKit::WebGraphicsContext3D* WebViewHost::createGraphicsContext3D(const WebKit::WebGraphicsContext3D::Attributes& attributes, bool direct) 276 { 277 if (!webView()) 278 return 0; 279 return webkit_support::CreateGraphicsContext3D(attributes, webView(), direct); 280 } 281 275 282 void WebViewHost::didAddMessageToConsole(const WebConsoleMessage& message, const WebString& sourceName, unsigned sourceLine) 276 283 { … … 907 914 { 908 915 if (params.mimeType == TestWebPlugin::mimeType()) 909 return new TestWebPlugin( frame, params);916 return new TestWebPlugin(this, frame, params); 910 917 911 918 return webkit_support::CreateWebPlugin(frame, params); -
trunk/Tools/DumpRenderTree/chromium/WebViewHost.h
r106353 r106371 130 130 virtual WebKit::WebWidget* createPopupMenu(const WebKit::WebPopupMenuInfo&); 131 131 virtual WebKit::WebStorageNamespace* createSessionStorageNamespace(unsigned quota); 132 virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D(const WebKit::WebGraphicsContext3D::Attributes&, bool direct); 132 133 virtual void didAddMessageToConsole(const WebKit::WebConsoleMessage&, const WebKit::WebString& sourceName, unsigned sourceLine); 133 134 virtual void didStartLoading();
Note: See TracChangeset
for help on using the changeset viewer.