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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp

Issue 1491193003: Fix several corner case issues of scrollbar paint invalidation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google Inc. All rights reserved.
3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. 3 * Copyright (C) 2008, 2011 Apple 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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 400
401 if (Scrollbar* scrollbar = verticalScrollbar()) { 401 if (Scrollbar* scrollbar = verticalScrollbar()) {
402 ScrollbarTheme::theme()->updateScrollbarOverlayStyle(scrollbar); 402 ScrollbarTheme::theme()->updateScrollbarOverlayStyle(scrollbar);
403 setScrollbarNeedsPaintInvalidation(scrollbar); 403 setScrollbarNeedsPaintInvalidation(scrollbar);
404 } 404 }
405 } 405 }
406 406
407 void ScrollableArea::setScrollbarNeedsPaintInvalidation(Scrollbar* scrollbar) 407 void ScrollableArea::setScrollbarNeedsPaintInvalidation(Scrollbar* scrollbar)
408 { 408 {
409 if (scrollbar == horizontalScrollbar()) { 409 if (scrollbar == horizontalScrollbar()) {
410 if (GraphicsLayer* graphicsLayer = layerForHorizontalScrollbar()) {
411 graphicsLayer->setNeedsDisplay();
412 graphicsLayer->setContentsNeedsDisplay();
413 return;
414 }
415 m_horizontalScrollbarNeedsPaintInvalidation = true; 410 m_horizontalScrollbarNeedsPaintInvalidation = true;
416 scrollControlWasSetNeedsPaintInvalidation(); 411 scrollControlWasSetNeedsPaintInvalidation();
417 return; 412 return;
418 } 413 }
419 if (scrollbar == verticalScrollbar()) { 414 if (scrollbar == verticalScrollbar()) {
420 if (GraphicsLayer* graphicsLayer = layerForVerticalScrollbar()) {
421 graphicsLayer->setNeedsDisplay();
422 graphicsLayer->setContentsNeedsDisplay();
423 return;
424 }
425 m_verticalScrollbarNeedsPaintInvalidation = true; 415 m_verticalScrollbarNeedsPaintInvalidation = true;
426 scrollControlWasSetNeedsPaintInvalidation(); 416 scrollControlWasSetNeedsPaintInvalidation();
427 return; 417 return;
428 } 418 }
429 // Otherwise the scrollbar is just created and has not been set as either 419 // Otherwise the scrollbar is just created and has not been set as either
430 // horizontalScrollbar() or verticalScrollbar(). 420 // horizontalScrollbar() or verticalScrollbar().
431 } 421 }
432 422
433 void ScrollableArea::setScrollCornerNeedsPaintInvalidation() 423 void ScrollableArea::setScrollCornerNeedsPaintInvalidation()
434 { 424 {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 verticalScrollbarWidth = !verticalBar->isOverlayScrollbar() ? verticalBa r->width() : 0; 568 verticalScrollbarWidth = !verticalBar->isOverlayScrollbar() ? verticalBa r->width() : 0;
579 if (Scrollbar* horizontalBar = horizontalScrollbar()) 569 if (Scrollbar* horizontalBar = horizontalScrollbar())
580 horizontalScrollbarHeight = !horizontalBar->isOverlayScrollbar() ? horiz ontalBar->height() : 0; 570 horizontalScrollbarHeight = !horizontalBar->isOverlayScrollbar() ? horiz ontalBar->height() : 0;
581 571
582 return IntSize(std::max(0, size.width() - verticalScrollbarWidth), 572 return IntSize(std::max(0, size.width() - verticalScrollbarWidth),
583 std::max(0, size.height() - horizontalScrollbarHeight)); 573 std::max(0, size.height() - horizontalScrollbarHeight));
584 574
585 } 575 }
586 576
587 } // namespace blink 577 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698