WebKit Bugzilla
Attachment 356371 Details for
Bug 192305
: [WPE] Add API for webview background color configuration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192305-20181203104435.patch (text/plain), 6.70 KB, created by
Philippe Normand
on 2018-12-03 02:44:36 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Philippe Normand
Created:
2018-12-03 02:44:36 PST
Size:
6.70 KB
patch
obsolete
>Subversion Revision: 238792 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 1bcddcba95191e2067da33ce295bc4241adc676d..e0e3fbb710760cd75884bffa733a874feb32242c 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,26 @@ >+2018-12-03 Philippe Normand <pnormand@igalia.com> >+ >+ [WPE] Add API to allow application to disable background rendering >+ https://bugs.webkit.org/show_bug.cgi?id=192305 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This new API should be useful when the WebView is overlaying >+ content on top of another graphics scene. >+ >+ * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: >+ (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext): Take >+ opacity into account when drawing the view background color too. >+ * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: Make the >+ view background transparent. When opacity is 1 the texture mapper >+ will render it white anyway. >+ * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: >+ (WebKit::ThreadedCompositor::renderLayerTree): Fix typo. >+ * UIProcess/API/glib/WebKitWebView.cpp: >+ (webkit_web_view_set_draws_background): >+ (webkit_web_view_draws_background): >+ * UIProcess/API/wpe/WebKitWebView.h: >+ > 2018-12-03 Keith Rollin <krollin@apple.com> > > Remove Network Capture >diff --git a/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp b/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp >index 1b2ed1b0275e65bbe191955998c293a83ba64608..2f72a7e46426011212cb0d0afe711ea934355d79 100644 >--- a/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp >+++ b/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp >@@ -78,13 +78,9 @@ void CoordinatedGraphicsScene::paintToCurrentGLContext(const TransformationMatri > m_textureMapper->beginPainting(PaintFlags); > m_textureMapper->beginClip(TransformationMatrix(), clipRect); > >- if (drawsBackground) { >- RGBA32 rgba = makeRGBA32FromFloats(backgroundColor.red(), >- backgroundColor.green(), backgroundColor.blue(), >- backgroundColor.alpha() * opacity); >- m_textureMapper->drawSolidColor(clipRect, TransformationMatrix(), Color(rgba)); >- } else >- m_textureMapper->clearColor(m_viewBackgroundColor); >+ auto& color = drawsBackground ? backgroundColor : m_viewBackgroundColor; >+ RGBA32 rgba = makeRGBA32FromFloats(color.red(), color.green(), color.blue(), color.alpha() * opacity); >+ m_textureMapper->drawSolidColor(clipRect, TransformationMatrix(), Color(rgba)); > > if (currentRootLayer->opacity() != opacity || currentRootLayer->transform() != matrix) { > currentRootLayer->setOpacity(opacity); >diff --git a/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h b/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h >index d4bb58268fe752216138d564117b4b76ec8a9f93..8fa5424a94bd820bdc8b960cde19e6a5752daeae 100644 >--- a/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h >+++ b/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h >@@ -113,7 +113,7 @@ private: > std::unique_ptr<WebCore::TextureMapperLayer> m_rootLayer; > > Nicosia::PlatformLayer::LayerID m_rootLayerID { 0 }; >- WebCore::Color m_viewBackgroundColor { WebCore::Color::white }; >+ WebCore::Color m_viewBackgroundColor { WebCore::Color::transparent }; > > WebCore::TextureMapperFPSCounter m_fpsCounter; > }; >diff --git a/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp b/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp >index 7522f84ea8f8a6823bb921ffc3f05cfbd87eb581..a1bec081c6892a990b1e10ff956d77fba69dc91e 100644 >--- a/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp >+++ b/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp >@@ -254,7 +254,7 @@ void ThreadedCompositor::renderLayerTree() > > m_scene->applyStateChanges(states); > m_scene->paintToCurrentGLContext(viewportTransform, 1, FloatRect { FloatPoint { }, viewportSize }, >- Color::transparent, !drawsBackground, m_paintFlags); >+ Color::transparent, drawsBackground, m_paintFlags); > > m_context->swapBuffers(); > >diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp b/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp >index 234859663d1f2c780898f060f4014988e786b4f6..4357e0fe7252dc7ddfc011d10cab76a882469a5a 100644 >--- a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp >+++ b/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp >@@ -3985,6 +3985,40 @@ void webkit_web_view_get_background_color(WebKitWebView* webView, GdkRGBA* rgba) > } > #endif // PLATFORM(GTK) > >+#if PLATFORM(WPE) >+/** >+ * webkit_web_view_set_draws_background: >+ * @web_view: a #WebKitWebView >+ * @draws_background: Wether the @web_view background should be rendered or not >+ * >+ * By default the @web_view background is rendered but in some cases it can be >+ * useful to disable it, such as when the @web_view rendering is blended with >+ * another graphics scene. >+ */ >+void webkit_web_view_set_draws_background(WebKitWebView* webView, gboolean drawsBackground) >+{ >+ g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView)); >+ >+ getPage(webView).setDrawsBackground(drawsBackground); >+} >+ >+/** >+ * webkit_web_view_draws_background: >+ * @web_view: a #WebKitWebView >+ * >+ * Gets whether the @web_view background is being rendered or not. >+ * >+ * Returns: %TRUE if the background is rendered, or %FALSE otherwise. >+ */ >+gboolean webkit_web_view_draws_background(WebKitWebView* webView) >+{ >+ g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), FALSE); >+ >+ return getPage(webView).drawsBackground(); >+} >+#endif // PLATFORM(WPE) >+ >+ > /* > * webkit_web_view_is_editable: > * @web_view: a #WebKitWebView >diff --git a/Source/WebKit/UIProcess/API/wpe/WebKitWebView.h b/Source/WebKit/UIProcess/API/wpe/WebKitWebView.h >index 2e389fd0b3cec2993eb096ecd3f73b5666efcfab..129c221bfcc47e93d10932e69ebf8f6581b0fbde 100644 >--- a/Source/WebKit/UIProcess/API/wpe/WebKitWebView.h >+++ b/Source/WebKit/UIProcess/API/wpe/WebKitWebView.h >@@ -495,6 +495,13 @@ WEBKIT_API void > webkit_web_view_restore_session_state (WebKitWebView *web_view, > WebKitWebViewSessionState *state); > >+WEBKIT_API void >+webkit_web_view_set_draws_background (WebKitWebView *web_view, >+ gboolean draws_background); >+ >+WEBKIT_API gboolean >+webkit_web_view_draws_background (WebKitWebView *web_view); >+ > G_END_DECLS > > #endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192305
:
356371
|
358458
|
358459
|
358597
|
358799
|
359005
|
359470
|
359477
|
360849
|
361048
|
361672
|
361676
|
361678