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

Unified Diff: Source/core/html/HTMLMediaElement.cpp

Issue 22645014: Merge WebKit r153448 (Optimizes the number of updateTextTrackDisplay calls) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« Source/core/html/HTMLMediaElement.h ('K') | « Source/core/html/HTMLMediaElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMediaElement.cpp
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index 85ecc7663bee2719647c9eb645e2269f605e9f09..3794196f81d4d7a939283de2830aaf795e22d53f 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -1031,16 +1031,8 @@ void HTMLMediaElement::updateActiveTextTrackCues(double movieTime)
activeSetChanged = true;
}
- if (!activeSetChanged) {
- // Even though the active set has not changed, it is possible that the
- // the mode of a track has changed from 'hidden' to 'showing' and the
- // cues have not yet been rendered.
- // Note: don't call updateTextTrackDisplay() unless we have controls because it will
- // create them.
- if (hasMediaControls())
acolwell GONE FROM CHROMIUM 2013/08/12 20:19:02 Why is this code dropped? Doesn't this result in a
vcarbune.chromium 2013/08/19 22:20:12 No, configureTextTrackDisplay now calls this if As
- updateTextTrackDisplay();
+ if (!activeSetChanged)
return;
- }
// 7 - If the time was reached through the usual monotonic increase of the
// current playback position during normal playback, and there are cues in
@@ -1241,8 +1233,7 @@ void HTMLMediaElement::textTrackModeChanged(TextTrack* track)
} else if (track->trackType() == TextTrack::AddTrack && track->mode() != TextTrack::disabledKeyword())
textTrackAddCues(track, track->cues());
- configureTextTrackDisplay();
- updateActiveTextTrackCues(currentTime());
+ configureTextTrackDisplay(AssumeVisibleTextTracksChanged);
}
void HTMLMediaElement::textTrackKindChanged(TextTrack* track)
@@ -3710,7 +3701,7 @@ void HTMLMediaElement::configureMediaControls()
mediaControls()->show();
}
-void HTMLMediaElement::configureTextTrackDisplay()
+void HTMLMediaElement::configureTextTrackDisplay(ConfigureTextTrackDisplayFlags flags)
{
ASSERT(m_textTracks);
LOG(Media, "HTMLMediaElement::configureTextTrackDisplay");
@@ -3726,8 +3717,11 @@ void HTMLMediaElement::configureTextTrackDisplay()
}
}
- if (m_haveVisibleTextTrack == haveVisibleTextTrack)
+ if (flags == DoNotAssumeVisibleTextTracksChanged
+ && m_haveVisibleTextTrack == haveVisibleTextTrack) {
+ updateActiveTextTrackCues(currentTime());
return;
+ }
m_haveVisibleTextTrack = haveVisibleTextTrack;
m_closedCaptionsVisible = m_haveVisibleTextTrack;
« Source/core/html/HTMLMediaElement.h ('K') | « Source/core/html/HTMLMediaElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698