bool GraphicsContext3DInternal::initialize(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, bool renderDirectlyToHostWindow) { WebKit::WebGraphicsContext3D::Attributes webAttributes; webAttributes.alpha = attrs.alpha; webAttributes.depth = attrs.depth; webAttributes.stencil = attrs.stencil; webAttributes.antialias = attrs.antialias; webAttributes.premultipliedAlpha = attrs.premultipliedAlpha; webAttributes.canRecoverFromContextLoss = attrs.canRecoverFromContextLoss; webAttributes.noExtensions = attrs.noExtensions; OwnPtr<WebKit::WebGraphicsContext3D> webContext = adoptPtr(WebKit::webKitClient()->createGraphicsContext3D()); if (!webContext) return false; Chrome* chrome = static_cast<Chrome*>(hostWindow); m_webViewImpl = static_cast<WebKit::WebViewImpl*>(chrome->client()->webView()); if (!m_webViewImpl) return false; if (!webContext->initialize(webAttributes, m_webViewImpl, renderDirectlyToHostWindow)) return false; m_impl = webContext.release(); #if USE(ACCELERATED_COMPOSITING) m_compositingLayer = WebGLLayerChromium::create(0); #endif return true; }
void CalendarPickerElement::closePopup() { if (!m_popup) return; if (!document()->page()) return; Chrome* chrome = document()->page()->chrome(); if (!chrome) return; chrome->client()->closePagePopup(m_popup); }
void CalendarPickerElement::openPopup() { if (m_popup) return; if (!document()->page()) return; Chrome* chrome = document()->page()->chrome(); if (!chrome) return; if (!document()->view()) return; IntRect elementRectInRootView = document()->view()->contentsToRootView(hostInput()->getPixelSnappedRect()); m_popup = chrome->client()->openPagePopup(this, elementRectInRootView); }
void RenderThemeQt::setPaletteFromPageClientIfExists(QPalette& palette) const { // If the webview has a custom palette, use it if (!m_page) return; Chrome* chrome = m_page->chrome(); if (!chrome) return; ChromeClient* chromeClient = chrome->client(); if (!chromeClient) return; QWebPageClient* pageClient = chromeClient->platformPageClient(); if (!pageClient) return; palette = pageClient->palette(); }
PassRefPtr<GraphicsContext3D> GraphicsContext3DPrivate::createGraphicsContextFromWebContext(PassOwnPtr<WebKit::WebGraphicsContext3D> webContext, GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle, ThreadUsage threadUsage) { Chrome* chrome = static_cast<Chrome*>(hostWindow); WebKit::WebViewImpl* webViewImpl = chrome ? static_cast<WebKit::WebViewImpl*>(chrome->client()->webView()) : 0; if (threadUsage == ForUseOnThisThread && !webContext->makeContextCurrent()) return 0; OwnPtr<GraphicsContext3DPrivate> priv = GraphicsContext3DPrivate::create(webViewImpl, webContext, attrs); if (!priv) return 0; bool renderDirectlyToHostWindow = renderStyle == GraphicsContext3D::RenderDirectlyToHostWindow; RefPtr<GraphicsContext3D> result = adoptRef(new GraphicsContext3D(attrs, hostWindow, renderDirectlyToHostWindow)); result->m_private = priv.release(); return result.release(); }
void RenderThemeQt::setPaletteFromPageClientIfExists(QPalette& palette) const { #if USE(QT_MOBILE_THEME) static QPalette lightGrayPalette(Qt::lightGray); palette = lightGrayPalette; return; #endif // If the webview has a custom palette, use it if (!m_page) return; Chrome* chrome = m_page->chrome(); if (!chrome) return; ChromeClient* chromeClient = chrome->client(); if (!chromeClient) return; QWebPageClient* pageClient = chromeClient->platformPageClient(); if (!pageClient) return; palette = pageClient->palette(); }