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

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

Issue 1458703010: Mac: Don't repaint scrollbars every frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master2
Patch Set: Rebase and resolve 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) 2004, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2008 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 , m_pressedPart(NoPart) 54 , m_pressedPart(NoPart)
55 , m_pressedPos(0) 55 , m_pressedPos(0)
56 , m_scrollPos(0) 56 , m_scrollPos(0)
57 , m_draggingDocument(false) 57 , m_draggingDocument(false)
58 , m_documentDragPos(0) 58 , m_documentDragPos(0)
59 , m_enabled(true) 59 , m_enabled(true)
60 , m_scrollTimer(this, &Scrollbar::autoscrollTimerFired) 60 , m_scrollTimer(this, &Scrollbar::autoscrollTimerFired)
61 , m_overlapsResizer(false) 61 , m_overlapsResizer(false)
62 , m_isAlphaLocked(false) 62 , m_isAlphaLocked(false)
63 , m_elasticOverscroll(0) 63 , m_elasticOverscroll(0)
64 , m_trackNeedsRepaint(true)
65 , m_thumbNeedsRepaint(true)
64 { 66 {
65 if (!m_theme) 67 if (!m_theme)
66 m_theme = ScrollbarTheme::theme(); 68 m_theme = ScrollbarTheme::theme();
67 69
68 m_theme->registerScrollbar(this); 70 m_theme->registerScrollbar(this);
69 71
70 // FIXME: This is ugly and would not be necessary if we fix cross-platform c ode to actually query for 72 // FIXME: This is ugly and would not be necessary if we fix cross-platform c ode to actually query for
71 // scrollbar thickness and use it when sizing scrollbars (rather than leavin g one dimension of the scrollbar 73 // scrollbar thickness and use it when sizing scrollbars (rather than leavin g one dimension of the scrollbar
72 // alone when sizing). 74 // alone when sizing).
73 int thickness = m_theme->scrollbarThickness(controlSize); 75 int thickness = m_theme->scrollbarThickness(controlSize);
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 return 0; 536 return 0;
535 537
536 if (m_orientation == HorizontalScrollbar) 538 if (m_orientation == HorizontalScrollbar)
537 return m_scrollableArea->scrollPosition().x() - m_scrollableArea->minimu mScrollPosition().x(); 539 return m_scrollableArea->scrollPosition().x() - m_scrollableArea->minimu mScrollPosition().x();
538 540
539 return m_scrollableArea->scrollPosition().y() - m_scrollableArea->minimumScr ollPosition().y(); 541 return m_scrollableArea->scrollPosition().y() - m_scrollableArea->minimumScr ollPosition().y();
540 } 542 }
541 543
542 void Scrollbar::setNeedsPaintInvalidation() 544 void Scrollbar::setNeedsPaintInvalidation()
543 { 545 {
546 if (m_theme->shouldRepaintAllPartsOnInvalidation()) {
547 m_trackNeedsRepaint = true;
548 m_thumbNeedsRepaint = true;
549 }
544 if (m_scrollableArea) 550 if (m_scrollableArea)
545 m_scrollableArea->setScrollbarNeedsPaintInvalidation(this); 551 m_scrollableArea->setScrollbarNeedsPaintInvalidation(this);
546 } 552 }
547 553
548 } // namespace blink 554 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/Scrollbar.h ('k') | third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698