| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 , m_hasAcceleratedCompositing(true) | 115 , m_hasAcceleratedCompositing(true) |
| 116 , m_showRepaintCounter(false) | 116 , m_showRepaintCounter(false) |
| 117 , m_needsToRecomputeCompositingRequirements(false) | 117 , m_needsToRecomputeCompositingRequirements(false) |
| 118 , m_compositing(false) | 118 , m_compositing(false) |
| 119 , m_compositingLayersNeedRebuild(false) | 119 , m_compositingLayersNeedRebuild(false) |
| 120 , m_forceCompositingMode(false) | 120 , m_forceCompositingMode(false) |
| 121 , m_needsUpdateCompositingRequirementsState(false) | 121 , m_needsUpdateCompositingRequirementsState(false) |
| 122 , m_isTrackingRepaints(false) | 122 , m_isTrackingRepaints(false) |
| 123 , m_rootLayerAttachment(RootLayerUnattached) | 123 , m_rootLayerAttachment(RootLayerUnattached) |
| 124 { | 124 { |
| 125 updateAcceleratedCompositingSettings(); |
| 125 } | 126 } |
| 126 | 127 |
| 127 RenderLayerCompositor::~RenderLayerCompositor() | 128 RenderLayerCompositor::~RenderLayerCompositor() |
| 128 { | 129 { |
| 129 ASSERT(m_rootLayerAttachment == RootLayerUnattached); | 130 ASSERT(m_rootLayerAttachment == RootLayerUnattached); |
| 130 } | 131 } |
| 131 | 132 |
| 132 void RenderLayerCompositor::enableCompositingMode(bool enable) | 133 void RenderLayerCompositor::enableCompositingMode(bool enable) |
| 133 { | 134 { |
| 134 if (enable == m_compositing) | 135 if (enable == m_compositing) |
| 135 return; | 136 return; |
| 136 | 137 |
| 137 m_compositing = enable; | 138 m_compositing = enable; |
| 138 | 139 |
| 139 if (m_compositing) | 140 if (m_compositing) |
| 140 ensureRootLayer(); | 141 ensureRootLayer(); |
| 141 else | 142 else |
| 142 destroyRootLayer(); | 143 destroyRootLayer(); |
| 143 | 144 |
| 144 notifyIFramesOfCompositingChange(); | 145 notifyIFramesOfCompositingChange(); |
| 145 } | 146 } |
| 146 | 147 |
| 147 void RenderLayerCompositor::cacheAcceleratedCompositingFlags() | 148 void RenderLayerCompositor::updateForceCompositingMode() |
| 149 { |
| 150 // FIXME: Can settings really be null here? |
| 151 if (Settings* settings = m_renderView.document().settings()) { |
| 152 bool forceCompositingMode = settings->forceCompositingMode() && m_hasAcc
eleratedCompositing; |
| 153 if (forceCompositingMode && !isMainFrame()) |
| 154 forceCompositingMode = m_compositingReasonFinder.requiresCompositing
ForScrollableFrame(); |
| 155 if (forceCompositingMode != m_forceCompositingMode) { |
| 156 setCompositingLayersNeedRebuild(); |
| 157 m_forceCompositingMode = forceCompositingMode; |
| 158 } |
| 159 } |
| 160 } |
| 161 |
| 162 void RenderLayerCompositor::updateAcceleratedCompositingSettings() |
| 148 { | 163 { |
| 149 bool hasAcceleratedCompositing = false; | 164 bool hasAcceleratedCompositing = false; |
| 150 bool showRepaintCounter = false; | 165 bool showRepaintCounter = false; |
| 151 bool forceCompositingMode = false; | |
| 152 | 166 |
| 167 // FIXME: Can settings really be null here? |
| 153 if (Settings* settings = m_renderView.document().settings()) { | 168 if (Settings* settings = m_renderView.document().settings()) { |
| 154 hasAcceleratedCompositing = settings->acceleratedCompositingEnabled(); | 169 hasAcceleratedCompositing = settings->acceleratedCompositingEnabled(); |
| 155 | 170 |
| 156 // We allow the chrome to override the settings, in case the page is ren
dered | 171 // We allow the chrome to override the settings, in case the page is ren
dered |
| 157 // on a chrome that doesn't allow accelerated compositing. | 172 // on a chrome that doesn't allow accelerated compositing. |
| 158 if (hasAcceleratedCompositing) { | 173 if (hasAcceleratedCompositing) { |
| 159 if (page()) { | 174 if (page()) { |
| 160 m_compositingReasonFinder.updateTriggers(); | 175 m_compositingReasonFinder.updateTriggers(); |
| 161 hasAcceleratedCompositing = m_compositingReasonFinder.hasTrigger
s(); | 176 hasAcceleratedCompositing = m_compositingReasonFinder.hasTrigger
s(); |
| 162 } | 177 } |
| 163 } | 178 } |
| 164 | 179 |
| 165 showRepaintCounter = settings->showRepaintCounter(); | 180 showRepaintCounter = settings->showRepaintCounter(); |
| 166 forceCompositingMode = settings->forceCompositingMode() && hasAccelerate
dCompositing; | |
| 167 | |
| 168 if (forceCompositingMode && !isMainFrame()) | |
| 169 forceCompositingMode = m_compositingReasonFinder.requiresCompositing
ForScrollableFrame(); | |
| 170 } | 181 } |
| 171 | 182 |
| 172 if (hasAcceleratedCompositing != m_hasAcceleratedCompositing || showRepaintC
ounter != m_showRepaintCounter || forceCompositingMode != m_forceCompositingMode
) | 183 if (hasAcceleratedCompositing != m_hasAcceleratedCompositing || showRepaintC
ounter != m_showRepaintCounter) |
| 173 setCompositingLayersNeedRebuild(); | 184 setCompositingLayersNeedRebuild(); |
| 174 | 185 |
| 175 m_hasAcceleratedCompositing = hasAcceleratedCompositing; | 186 m_hasAcceleratedCompositing = hasAcceleratedCompositing; |
| 176 m_showRepaintCounter = showRepaintCounter; | 187 m_showRepaintCounter = showRepaintCounter; |
| 177 m_forceCompositingMode = forceCompositingMode; | 188 |
| 189 updateForceCompositingMode(); |
| 178 } | 190 } |
| 179 | 191 |
| 180 bool RenderLayerCompositor::layerSquashingEnabled() const | 192 bool RenderLayerCompositor::layerSquashingEnabled() const |
| 181 { | 193 { |
| 182 if (RuntimeEnabledFeatures::bleedingEdgeFastPathsEnabled()) | 194 if (RuntimeEnabledFeatures::bleedingEdgeFastPathsEnabled()) |
| 183 return true; | 195 return true; |
| 184 if (Settings* settings = m_renderView.document().settings()) | 196 if (Settings* settings = m_renderView.document().settings()) |
| 185 return settings->layerSquashingEnabled(); | 197 return settings->layerSquashingEnabled(); |
| 186 | 198 |
| 187 return false; | 199 return false; |
| (...skipping 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1700 } else if (graphicsLayer == m_scrollLayer.get()) { | 1712 } else if (graphicsLayer == m_scrollLayer.get()) { |
| 1701 name = "LocalFrame Scrolling Layer"; | 1713 name = "LocalFrame Scrolling Layer"; |
| 1702 } else { | 1714 } else { |
| 1703 ASSERT_NOT_REACHED(); | 1715 ASSERT_NOT_REACHED(); |
| 1704 } | 1716 } |
| 1705 | 1717 |
| 1706 return name; | 1718 return name; |
| 1707 } | 1719 } |
| 1708 | 1720 |
| 1709 } // namespace WebCore | 1721 } // namespace WebCore |
| OLD | NEW |