| 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 * Copyright (C) 2014 Google Inc. All rights reserved. | 3 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 | 231 |
| 232 bool canBeComposited = compositor->canBeComposited(layer); | 232 bool canBeComposited = compositor->canBeComposited(layer); |
| 233 if (canBeComposited) { | 233 if (canBeComposited) { |
| 234 reasonsToComposite |= directReasons; | 234 reasonsToComposite |= directReasons; |
| 235 | 235 |
| 236 if (layer->isRootLayer() && compositor->rootShouldAlwaysComposite()) | 236 if (layer->isRootLayer() && compositor->rootShouldAlwaysComposite()) |
| 237 reasonsToComposite |= CompositingReasonRoot; | 237 reasonsToComposite |= CompositingReasonRoot; |
| 238 | 238 |
| 239 if (reasonsToComposite && layer->scrollsOverflow() && !layer->needsCompo
sitedScrolling()) { | 239 if (reasonsToComposite && layer->scrollsOverflow() && !layer->needsCompo
sitedScrolling()) { |
| 240 // We will only set needsCompositedScrolling if we don't care about | 240 // We will only set needsCompositedScrolling if we don't care about |
| 241 // the LCD text hit, we may be able to switch to the compositor | 241 // the LCD text hit, or when the background supports painting LCD te
xt. |
| 242 // We may be able to switch to the compositor |
| 242 // driven path if we're alread composited for other reasons and are | 243 // driven path if we're alread composited for other reasons and are |
| 243 // therefore using grayscale AA. | 244 // therefore using grayscale AA. |
| 244 // | |
| 245 // FIXME: it should also be possible to promote if the layer can | |
| 246 // still use LCD text when promoted, but detecting when the | |
| 247 // compositor can do this is tricky. Currently, the layer must be | |
| 248 // both opaque and may only have an integer translation as its | |
| 249 // transform. Both opacity and screen space transform are inherited | |
| 250 // properties, so this cannot be determined from local information. | |
| 251 layer->getScrollableArea()->updateNeedsCompositedScrolling(PaintLaye
rScrollableArea::IgnoreLCDText); | 245 layer->getScrollableArea()->updateNeedsCompositedScrolling(PaintLaye
rScrollableArea::IgnoreLCDText); |
| 252 if (layer->needsCompositedScrolling()) | 246 if (layer->needsCompositedScrolling()) |
| 253 reasonsToComposite |= CompositingReasonOverflowScrollingTouch; | 247 reasonsToComposite |= CompositingReasonOverflowScrollingTouch; |
| 254 } | 248 } |
| 255 } | 249 } |
| 256 | 250 |
| 257 if ((reasonsToComposite & CompositingReasonOverflowScrollingTouch) && !layer
->isRootLayer()) | 251 if ((reasonsToComposite & CompositingReasonOverflowScrollingTouch) && !layer
->isRootLayer()) |
| 258 currentRecursionData.m_hasCompositedScrollingAncestor = true; | 252 currentRecursionData.m_hasCompositedScrollingAncestor = true; |
| 259 | 253 |
| 260 // Next, accumulate reasons related to overlap. | 254 // Next, accumulate reasons related to overlap. |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 overlapMap.finishCurrentOverlapTestingContext(); | 442 overlapMap.finishCurrentOverlapTestingContext(); |
| 449 | 443 |
| 450 descendantHas3DTransform |= anyDescendantHas3DTransform || layer->has3DT
ransform(); | 444 descendantHas3DTransform |= anyDescendantHas3DTransform || layer->has3DT
ransform(); |
| 451 } | 445 } |
| 452 | 446 |
| 453 // At this point we have finished collecting all reasons to composite this l
ayer. | 447 // At this point we have finished collecting all reasons to composite this l
ayer. |
| 454 layer->setCompositingReasons(reasonsToComposite); | 448 layer->setCompositingReasons(reasonsToComposite); |
| 455 } | 449 } |
| 456 | 450 |
| 457 } // namespace blink | 451 } // namespace blink |
| OLD | NEW |