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

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

Issue 2715243004: [blink] Support (semi-)transparent background colors in WebView/Frame. (Closed)
Patch Set: Set WebViewImpl transparency for fullscreen. Created 3 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/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index 945f27e4c99ab304fcb214c84680cb17730107fd..d6496bcdc611f8f6ea3844548d03a48ce06d9729 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -3523,9 +3523,7 @@ void WebViewImpl::setIsTransparent(bool isTransparent) {
// Future frames check this to know whether to be transparent.
m_isTransparent = isTransparent;
-
- if (m_layerTreeView)
- m_layerTreeView->setHasTransparentBackground(this->isTransparent());
+ updateLayerTreeBackgroundColor();
}
bool WebViewImpl::isTransparent() const {
@@ -4014,9 +4012,12 @@ void WebViewImpl::updateLayerTreeBackgroundColor() {
if (!m_layerTreeView)
return;
- m_layerTreeView->setBackgroundColor(alphaChannel(m_backgroundColorOverride)
- ? m_backgroundColorOverride
- : backgroundColor());
+ WebColor color = alphaChannel(m_backgroundColorOverride)
+ ? m_backgroundColorOverride
+ : backgroundColor();
+ m_layerTreeView->setBackgroundColor(color);
+ m_layerTreeView->setHasTransparentBackground(alphaChannel(color) <
dgozman 2017/03/01 19:11:52 Similarly to Chris' question, do we actually need
Eric Seckler 2017/03/07 18:00:47 Implemented as suggested.
+ SK_AlphaOPAQUE);
}
void WebViewImpl::updateLayerTreeDeviceScaleFactor() {

Powered by Google App Engine
This is Rietveld 408576698