summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android/jni/WebViewCore.cpp
diff options
context:
space:
mode:
authorTeng-Hui Zhu <ztenghui@google.com>2012-04-02 17:08:02 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-04-02 17:08:02 -0700
commit24667dd680e19d654262f570efeb697dfc87922c (patch)
tree78b045a2b5b9f5649136be7f2d3c091560a575e2 /Source/WebKit/android/jni/WebViewCore.cpp
parent96027bf9f9621433909777b481964fdbd9258f85 (diff)
parentafe34397d6d4655c908f0995e760772980722da3 (diff)
downloadexternal_webkit-24667dd680e19d654262f570efeb697dfc87922c.zip
external_webkit-24667dd680e19d654262f570efeb697dfc87922c.tar.gz
external_webkit-24667dd680e19d654262f570efeb697dfc87922c.tar.bz2
Merge "Translucent background color support for webview"
Diffstat (limited to 'Source/WebKit/android/jni/WebViewCore.cpp')
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index 8f7efe2..540b1dd 100644
--- a/Source/WebKit/android/jni/WebViewCore.cpp
+++ b/Source/WebKit/android/jni/WebViewCore.cpp
@@ -871,16 +871,25 @@ BaseLayerAndroid* WebViewCore::createBaseLayer(SkRegion* region)
#if USE(ACCELERATED_COMPOSITING)
// We set the background color
+ Color background = Color::white;
if (m_mainFrame && m_mainFrame->document()
&& m_mainFrame->document()->body()) {
+ bool hasCSSBackground = false;
+
Document* document = m_mainFrame->document();
RefPtr<RenderStyle> style = document->styleForElementIgnoringPendingStylesheets(document->body());
if (style->hasBackground()) {
- Color color = style->visitedDependentColor(CSSPropertyBackgroundColor);
- if (color.isValid() && color.alpha() > 0)
- base->setBackgroundColor(color);
+ background = style->visitedDependentColor(CSSPropertyBackgroundColor);
+ hasCSSBackground = true;
+ }
+
+ WebCore::FrameView* view = m_mainFrame->view();
+ if (view) {
+ Color viewBackground = view->baseBackgroundColor();
+ background = hasCSSBackground ? viewBackground.blend(background) : viewBackground;
}
}
+ base->setBackgroundColor(background);
// We update the layers
ChromeClientAndroid* chromeC = static_cast<ChromeClientAndroid*>(m_mainFrame->page()->chrome()->client());