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

Side by Side Diff: Source/core/rendering/RenderProgress.cpp

Issue 478433002: Avoid RenderObject::paintInvalidationForWholeRenderer() if possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: TestExpectations Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 } 45 }
46 46
47 void RenderProgress::updateFromElement() 47 void RenderProgress::updateFromElement()
48 { 48 {
49 HTMLProgressElement* element = progressElement(); 49 HTMLProgressElement* element = progressElement();
50 if (m_position == element->position()) 50 if (m_position == element->position())
51 return; 51 return;
52 m_position = element->position(); 52 m_position = element->position();
53 53
54 updateAnimationState(); 54 updateAnimationState();
55 paintInvalidationForWholeRenderer(); 55 setShouldDoFullPaintInvalidation(true);
56 RenderBlockFlow::updateFromElement(); 56 RenderBlockFlow::updateFromElement();
57 } 57 }
58 58
59 double RenderProgress::animationProgress() const 59 double RenderProgress::animationProgress() const
60 { 60 {
61 return m_animating ? (fmod((currentTime() - m_animationStartTime), m_animati onDuration) / m_animationDuration) : 0; 61 return m_animating ? (fmod((currentTime() - m_animationStartTime), m_animati onDuration) / m_animationDuration) : 0;
62 } 62 }
63 63
64 bool RenderProgress::isDeterminate() const 64 bool RenderProgress::isDeterminate() const
65 { 65 {
66 return (HTMLProgressElement::IndeterminatePosition != position() 66 return (HTMLProgressElement::IndeterminatePosition != position()
67 && HTMLProgressElement::InvalidPosition != position()); 67 && HTMLProgressElement::InvalidPosition != position());
68 } 68 }
69 69
70 void RenderProgress::animationTimerFired(Timer<RenderProgress>*) 70 void RenderProgress::animationTimerFired(Timer<RenderProgress>*)
71 { 71 {
72 paintInvalidationForWholeRenderer(); 72 setShouldDoFullPaintInvalidation(true);
73 if (!m_animationTimer.isActive() && m_animating) 73 if (!m_animationTimer.isActive() && m_animating)
74 m_animationTimer.startOneShot(m_animationRepeatInterval, FROM_HERE); 74 m_animationTimer.startOneShot(m_animationRepeatInterval, FROM_HERE);
75 } 75 }
76 76
77 void RenderProgress::updateAnimationState() 77 void RenderProgress::updateAnimationState()
78 { 78 {
79 m_animationDuration = RenderTheme::theme().animationDurationForProgressBar(t his); 79 m_animationDuration = RenderTheme::theme().animationDurationForProgressBar(t his);
80 m_animationRepeatInterval = RenderTheme::theme().animationRepeatIntervalForP rogressBar(this); 80 m_animationRepeatInterval = RenderTheme::theme().animationRepeatIntervalForP rogressBar(this);
81 81
82 bool animating = style()->hasAppearance() && m_animationDuration > 0; 82 bool animating = style()->hasAppearance() && m_animationDuration > 0;
(...skipping 14 matching lines...) Expand all
97 return 0; 97 return 0;
98 98
99 if (isHTMLProgressElement(*node())) 99 if (isHTMLProgressElement(*node()))
100 return toHTMLProgressElement(node()); 100 return toHTMLProgressElement(node());
101 101
102 ASSERT(node()->shadowHost()); 102 ASSERT(node()->shadowHost());
103 return toHTMLProgressElement(node()->shadowHost()); 103 return toHTMLProgressElement(node()->shadowHost());
104 } 104 }
105 105
106 } // namespace blink 106 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderObjectChildList.cpp ('k') | Source/core/rendering/RenderTableCol.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698