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

Side by Side Diff: third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp

Issue 2283183002: Don't adjust scroll for selection if it's already empty. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/ObjectPaintInvalidator.h" 5 #include "core/paint/ObjectPaintInvalidator.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "core/layout/LayoutBlockFlow.h" 9 #include "core/layout/LayoutBlockFlow.h"
10 #include "core/layout/compositing/CompositedLayerMapping.h" 10 #include "core/layout/compositing/CompositedLayerMapping.h"
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 { 412 {
413 // Update selection rect when we are doing full invalidation (in case that t he object is moved, 413 // Update selection rect when we are doing full invalidation (in case that t he object is moved,
414 // composite status changed, etc.) or shouldInvalidationSelection is set (in case that the 414 // composite status changed, etc.) or shouldInvalidationSelection is set (in case that the
415 // selection itself changed). 415 // selection itself changed).
416 bool fullInvalidation = isImmediateFullPaintInvalidationReason(reason); 416 bool fullInvalidation = isImmediateFullPaintInvalidationReason(reason);
417 if (!fullInvalidation && !m_object.shouldInvalidateSelection()) 417 if (!fullInvalidation && !m_object.shouldInvalidateSelection())
418 return; 418 return;
419 419
420 LayoutRect oldSelectionRect = selectionPaintInvalidationMap().get(&m_object) ; 420 LayoutRect oldSelectionRect = selectionPaintInvalidationMap().get(&m_object) ;
421 LayoutRect newSelectionRect = m_object.localSelectionRect(); 421 LayoutRect newSelectionRect = m_object.localSelectionRect();
422 if (!newSelectionRect.isEmpty()) 422 if (!newSelectionRect.isEmpty()) {
423 m_context.mapLocalRectToPaintInvalidationBacking(m_object, newSelectionR ect); 423 m_context.mapLocalRectToPaintInvalidationBacking(m_object, newSelectionR ect);
424 424 newSelectionRect.move(m_object.scrollAdjustmentForPaintInvalidation(*m_c ontext.paintInvalidationContainer));
425 newSelectionRect.move(m_object.scrollAdjustmentForPaintInvalidation(*m_conte xt.paintInvalidationContainer)); 425 }
426 426
427 setPreviousSelectionPaintInvalidationRect(m_object, newSelectionRect); 427 setPreviousSelectionPaintInvalidationRect(m_object, newSelectionRect);
428 428
429 if (!fullInvalidation) { 429 if (!fullInvalidation) {
430 fullyInvalidatePaint(PaintInvalidationSelection, oldSelectionRect, newSe lectionRect); 430 fullyInvalidatePaint(PaintInvalidationSelection, oldSelectionRect, newSe lectionRect);
431 m_context.paintingLayer->setNeedsRepaint(); 431 m_context.paintingLayer->setNeedsRepaint();
432 m_object.invalidateDisplayItemClients(PaintInvalidationSelection); 432 m_object.invalidateDisplayItemClients(PaintInvalidationSelection);
433 } 433 }
434 } 434 }
435 435
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 m_object.invalidateDisplayItemClients(reason); 467 m_object.invalidateDisplayItemClients(reason);
468 return reason; 468 return reason;
469 } 469 }
470 470
471 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts() 471 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts()
472 : m_disabler(&gDisablePaintInvalidationStateAsserts, true) 472 : m_disabler(&gDisablePaintInvalidationStateAsserts, true)
473 { 473 {
474 } 474 }
475 475
476 } // namespace blink 476 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698