Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1200)

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp

Issue 2259493004: Fix Compositing of Opaque Scrolling Layers and Add Tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
chrishtr 2016/09/02 01:19:38 Are you checking for integer translation?
Stephen Chennney 2016/09/06 21:06:21 I could DCHECK for it. I believe we force integer
chrishtr 2016/09/06 22:17:59 The sum of the translations from the root must be
Stephen Chennney 2016/09/07 19:57:54 This comment on an earlier review explains why we
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698