Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 2025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2036 } | 2036 } |
| 2037 | 2037 |
| 2038 bool FrameView::isTransparent() const | 2038 bool FrameView::isTransparent() const |
| 2039 { | 2039 { |
| 2040 return m_isTransparent; | 2040 return m_isTransparent; |
| 2041 } | 2041 } |
| 2042 | 2042 |
| 2043 void FrameView::setTransparent(bool isTransparent) | 2043 void FrameView::setTransparent(bool isTransparent) |
| 2044 { | 2044 { |
| 2045 m_isTransparent = isTransparent; | 2045 m_isTransparent = isTransparent; |
| 2046 didChangeBackgroundOpaqueness(); | |
| 2046 } | 2047 } |
| 2047 | 2048 |
| 2048 bool FrameView::hasOpaqueBackground() const | 2049 bool FrameView::hasOpaqueBackground() const |
| 2049 { | 2050 { |
| 2050 return !m_isTransparent && !m_baseBackgroundColor.hasAlpha(); | 2051 return !m_isTransparent && !m_baseBackgroundColor.hasAlpha(); |
| 2051 } | 2052 } |
| 2052 | 2053 |
| 2053 Color FrameView::baseBackgroundColor() const | 2054 Color FrameView::baseBackgroundColor() const |
| 2054 { | 2055 { |
| 2055 return m_baseBackgroundColor; | 2056 return m_baseBackgroundColor; |
| 2056 } | 2057 } |
| 2057 | 2058 |
| 2058 void FrameView::setBaseBackgroundColor(const Color& backgroundColor) | 2059 void FrameView::setBaseBackgroundColor(const Color& backgroundColor) |
| 2059 { | 2060 { |
| 2060 if (!backgroundColor.isValid()) | 2061 if (!backgroundColor.isValid()) |
| 2061 m_baseBackgroundColor = Color::white; | 2062 m_baseBackgroundColor = Color::white; |
| 2062 else | 2063 else |
| 2063 m_baseBackgroundColor = backgroundColor; | 2064 m_baseBackgroundColor = backgroundColor; |
| 2064 | 2065 |
| 2066 didChangeBackgroundOpaqueness(); | |
| 2065 recalculateScrollbarOverlayStyle(); | 2067 recalculateScrollbarOverlayStyle(); |
| 2066 } | 2068 } |
| 2067 | 2069 |
| 2068 void FrameView::updateBackgroundRecursively(const Color& backgroundColor, bool t ransparent) | 2070 void FrameView::updateBackgroundRecursively(const Color& backgroundColor, bool t ransparent) |
| 2069 { | 2071 { |
| 2070 for (Frame* frame = m_frame.get(); frame; frame = frame->tree()->traverseNex t(m_frame.get())) { | 2072 for (Frame* frame = m_frame.get(); frame; frame = frame->tree()->traverseNex t(m_frame.get())) { |
| 2071 if (FrameView* view = frame->view()) { | 2073 if (FrameView* view = frame->view()) { |
| 2072 view->setTransparent(transparent); | 2074 view->setTransparent(transparent); |
| 2073 view->setBaseBackgroundColor(backgroundColor); | 2075 view->setBaseBackgroundColor(backgroundColor); |
| 2074 } | 2076 } |
| 2075 } | 2077 } |
| 2076 } | 2078 } |
| 2077 | 2079 |
| 2080 void FrameView::didChangeBackgroundOpaqueness() | |
|
jamesr
2013/05/28 23:03:52
I think this function would be clearer if this jus
| |
| 2081 { | |
| 2082 if (!m_frame->page() || m_frame->page()->mainFrame() != m_frame.get()) | |
| 2083 return; | |
| 2084 if (!renderView() || !renderView()->layer()->backing()) | |
| 2085 return; | |
| 2086 if (GraphicsLayer* layer = renderView()->layer()->backing()->graphicsLayer() ) | |
| 2087 layer->setContentsOpaque(hasOpaqueBackground()); | |
| 2088 } | |
| 2089 | |
| 2078 bool FrameView::shouldUpdateWhileOffscreen() const | 2090 bool FrameView::shouldUpdateWhileOffscreen() const |
| 2079 { | 2091 { |
| 2080 return m_shouldUpdateWhileOffscreen; | 2092 return m_shouldUpdateWhileOffscreen; |
| 2081 } | 2093 } |
| 2082 | 2094 |
| 2083 void FrameView::setShouldUpdateWhileOffscreen(bool shouldUpdateWhileOffscreen) | 2095 void FrameView::setShouldUpdateWhileOffscreen(bool shouldUpdateWhileOffscreen) |
| 2084 { | 2096 { |
| 2085 m_shouldUpdateWhileOffscreen = shouldUpdateWhileOffscreen; | 2097 m_shouldUpdateWhileOffscreen = shouldUpdateWhileOffscreen; |
| 2086 } | 2098 } |
| 2087 | 2099 |
| (...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3403 } | 3415 } |
| 3404 | 3416 |
| 3405 AXObjectCache* FrameView::axObjectCache() const | 3417 AXObjectCache* FrameView::axObjectCache() const |
| 3406 { | 3418 { |
| 3407 if (frame() && frame()->document()) | 3419 if (frame() && frame()->document()) |
| 3408 return frame()->document()->existingAXObjectCache(); | 3420 return frame()->document()->existingAXObjectCache(); |
| 3409 return 0; | 3421 return 0; |
| 3410 } | 3422 } |
| 3411 | 3423 |
| 3412 } // namespace WebCore | 3424 } // namespace WebCore |
| OLD | NEW |