| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 if (rootShouldAlwaysComposite()) { | 108 if (rootShouldAlwaysComposite()) { |
| 109 // FIXME: Is this needed? It was added in https://bugs.webkit.org/show_b
ug.cgi?id=26651. | 109 // FIXME: Is this needed? It was added in https://bugs.webkit.org/show_b
ug.cgi?id=26651. |
| 110 // No tests fail if it's deleted. | 110 // No tests fail if it's deleted. |
| 111 setNeedsCompositingUpdate(CompositingUpdateRebuildTree); | 111 setNeedsCompositingUpdate(CompositingUpdateRebuildTree); |
| 112 setCompositingModeEnabled(true); | 112 setCompositingModeEnabled(true); |
| 113 } | 113 } |
| 114 } | 114 } |
| 115 | 115 |
| 116 bool RenderLayerCompositor::rootShouldAlwaysComposite() const | 116 bool RenderLayerCompositor::rootShouldAlwaysComposite() const |
| 117 { | 117 { |
| 118 // FIXME(sky): Remove | 118 #if ENABLE(COMPOSITOR) |
| 119 return true; | 119 return true; |
| 120 #else |
| 121 return false; |
| 122 #endif |
| 120 } | 123 } |
| 121 | 124 |
| 122 void RenderLayerCompositor::updateAcceleratedCompositingSettings() | 125 void RenderLayerCompositor::updateAcceleratedCompositingSettings() |
| 123 { | 126 { |
| 124 m_compositingReasonFinder.updateTriggers(); | 127 m_compositingReasonFinder.updateTriggers(); |
| 125 m_rootShouldAlwaysCompositeDirty = true; | 128 m_rootShouldAlwaysCompositeDirty = true; |
| 126 } | 129 } |
| 127 | 130 |
| 131 bool RenderLayerCompositor::hasAcceleratedCompositing() const |
| 132 { |
| 133 #if ENABLE(COMPOSITOR) |
| 134 return true; |
| 135 #else |
| 136 return false; |
| 137 #endif |
| 138 } |
| 139 |
| 128 bool RenderLayerCompositor::layerSquashingEnabled() const | 140 bool RenderLayerCompositor::layerSquashingEnabled() const |
| 129 { | 141 { |
| 130 if (!RuntimeEnabledFeatures::layerSquashingEnabled()) | 142 if (!RuntimeEnabledFeatures::layerSquashingEnabled()) |
| 131 return false; | 143 return false; |
| 132 return true; | 144 return true; |
| 133 } | 145 } |
| 134 | 146 |
| 135 bool RenderLayerCompositor::preferCompositingToLCDTextEnabled() const | 147 bool RenderLayerCompositor::preferCompositingToLCDTextEnabled() const |
| 136 { | 148 { |
| 137 return m_compositingReasonFinder.hasOverflowScrollTrigger(); | 149 return m_compositingReasonFinder.hasOverflowScrollTrigger(); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 CompositingInputsUpdater::assertNeedsCompositingInputsUpdateBitsCleared(root
RenderLayer()); | 215 CompositingInputsUpdater::assertNeedsCompositingInputsUpdateBitsCleared(root
RenderLayer()); |
| 204 #endif | 216 #endif |
| 205 } | 217 } |
| 206 | 218 |
| 207 void RenderLayerCompositor::updateIfNeeded() | 219 void RenderLayerCompositor::updateIfNeeded() |
| 208 { | 220 { |
| 209 CompositingUpdateType updateType = m_pendingUpdateType; | 221 CompositingUpdateType updateType = m_pendingUpdateType; |
| 210 m_pendingUpdateType = CompositingUpdateNone; | 222 m_pendingUpdateType = CompositingUpdateNone; |
| 211 | 223 |
| 212 if (!hasAcceleratedCompositing()) { | 224 if (!hasAcceleratedCompositing()) { |
| 225 #if ENABLE(COMPOSITOR) |
| 213 updateWithoutAcceleratedCompositing(updateType); | 226 updateWithoutAcceleratedCompositing(updateType); |
| 227 #endif |
| 214 return; | 228 return; |
| 215 } | 229 } |
| 216 | 230 |
| 217 if (updateType == CompositingUpdateNone) | 231 if (updateType == CompositingUpdateNone) |
| 218 return; | 232 return; |
| 219 | 233 |
| 220 RenderLayer* updateRoot = rootRenderLayer(); | 234 RenderLayer* updateRoot = rootRenderLayer(); |
| 221 | 235 |
| 222 Vector<RenderLayer*> layersNeedingPaintInvalidation; | 236 Vector<RenderLayer*> layersNeedingPaintInvalidation; |
| 223 | 237 |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 } else if (graphicsLayer == m_scrollLayer.get()) { | 773 } else if (graphicsLayer == m_scrollLayer.get()) { |
| 760 name = "LocalFrame Scrolling Layer"; | 774 name = "LocalFrame Scrolling Layer"; |
| 761 } else { | 775 } else { |
| 762 ASSERT_NOT_REACHED(); | 776 ASSERT_NOT_REACHED(); |
| 763 } | 777 } |
| 764 | 778 |
| 765 return name; | 779 return name; |
| 766 } | 780 } |
| 767 | 781 |
| 768 } // namespace blink | 782 } // namespace blink |
| OLD | NEW |