Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1574)

Unified Diff: third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp

Issue 1565893004: Sets a transparent background for out-of-process subframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compile Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
index 033a49e59fb956e16f9f9914cd55df6e48e7975b..b34b41e653453379f2bd007c30460ab81122561d 100644
--- a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
+++ b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
@@ -98,6 +98,7 @@ WebFrameWidgetImpl::WebFrameWidgetImpl(WebWidgetClient* client, WebLocalFrame* l
, m_layerTreeViewClosed(false)
, m_suppressNextKeypressEvent(false)
, m_ignoreInputEvents(false)
+ , m_isTransparent(false)
#if ENABLE(OILPAN)
, m_selfKeepAlive(this)
#endif
@@ -106,6 +107,9 @@ WebFrameWidgetImpl::WebFrameWidgetImpl(WebWidgetClient* client, WebLocalFrame* l
initializeLayerTreeView();
m_localRoot->setFrameWidget(this);
allInstances().add(this);
+
+ if (localRoot->parent())
+ setIsTransparent(true);
}
WebFrameWidgetImpl::~WebFrameWidgetImpl()
@@ -278,7 +282,7 @@ void WebFrameWidgetImpl::updateLayerTreeBackgroundColor()
if (!m_layerTreeView)
return;
- m_layerTreeView->setBackgroundColor(alphaChannel(view()->backgroundColorOverride()) ? view()->backgroundColorOverride() : view()->backgroundColor());
+ m_layerTreeView->setBackgroundColor(backgroundColor());
}
void WebFrameWidgetImpl::updateLayerTreeDeviceScaleFactor()
@@ -290,10 +294,17 @@ void WebFrameWidgetImpl::updateLayerTreeDeviceScaleFactor()
m_layerTreeView->setDeviceScaleFactor(deviceScaleFactor);
}
+void WebFrameWidgetImpl::setIsTransparent(bool isTransparent)
+{
+ m_isTransparent = isTransparent;
+
+ if (m_layerTreeView)
+ m_layerTreeView->setHasTransparentBackground(isTransparent);
+}
+
bool WebFrameWidgetImpl::isTransparent() const
{
- // FIXME: This might need to proxy to the WebView's isTransparent().
- return false;
+ return m_isTransparent;
}
void WebFrameWidgetImpl::layoutAndPaintAsync(WebLayoutAndPaintAsyncCallback* callback)
@@ -381,6 +392,18 @@ bool WebFrameWidgetImpl::hasTouchEventHandlersAt(const WebPoint& point)
return true;
}
+void WebFrameWidgetImpl::setBaseBackgroundColor(WebColor color)
+{
+ if (m_baseBackgroundColor == color)
+ return;
+
+ m_baseBackgroundColor = color;
+
+ m_localRoot->frameView()->setBaseBackgroundColor(color);
+
+ updateAllLifecyclePhases();
+}
+
void WebFrameWidgetImpl::scheduleAnimation()
{
if (m_layerTreeView) {
@@ -483,7 +506,7 @@ WebColor WebFrameWidgetImpl::backgroundColor() const
if (isTransparent())
return Color::transparent;
if (!m_localRoot->frameView())
- return view()->backgroundColor();
+ return m_baseBackgroundColor;
FrameView* view = m_localRoot->frameView();
return view->documentBackgroundColor().rgb();
}
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.h ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698