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

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

Issue 568763002: Replace HTMLMediaElement::player() calls with webMediaPlayer() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 | « Source/core/html/HTMLVideoElement.cpp ('k') | 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 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 return pixelSnappedIntRect(replacedContentRect(overriddenIntrinsicSize)); 137 return pixelSnappedIntRect(replacedContentRect(overriddenIntrinsicSize));
138 } 138 }
139 139
140 bool RenderVideo::shouldDisplayVideo() const 140 bool RenderVideo::shouldDisplayVideo() const
141 { 141 {
142 return !videoElement()->shouldDisplayPosterImage(); 142 return !videoElement()->shouldDisplayPosterImage();
143 } 143 }
144 144
145 void RenderVideo::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOf fset) 145 void RenderVideo::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOf fset)
146 { 146 {
147 MediaPlayer* mediaPlayer = mediaElement()->player(); 147 WebMediaPlayer* mediaPlayer = mediaElement()->webMediaPlayer();
148 bool displayingPoster = videoElement()->shouldDisplayPosterImage(); 148 bool displayingPoster = videoElement()->shouldDisplayPosterImage();
149 if (!displayingPoster && !mediaPlayer) 149 if (!displayingPoster && !mediaPlayer)
150 return; 150 return;
151 151
152 LayoutRect rect = videoBox(); 152 LayoutRect rect = videoBox();
153 if (rect.isEmpty()) 153 if (rect.isEmpty())
154 return; 154 return;
155 rect.moveBy(paintOffset); 155 rect.moveBy(paintOffset);
156 156
157 LayoutRect contentRect = contentBoxRect(); 157 LayoutRect contentRect = contentBoxRect();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 void RenderVideo::updateFromElement() 192 void RenderVideo::updateFromElement()
193 { 193 {
194 RenderMedia::updateFromElement(); 194 RenderMedia::updateFromElement();
195 updatePlayer(); 195 updatePlayer();
196 } 196 }
197 197
198 void RenderVideo::updatePlayer() 198 void RenderVideo::updatePlayer()
199 { 199 {
200 updateIntrinsicSize(); 200 updateIntrinsicSize();
201 201
202 MediaPlayer* mediaPlayer = mediaElement()->player(); 202 WebMediaPlayer* mediaPlayer = mediaElement()->webMediaPlayer();
203 if (!mediaPlayer) 203 if (!mediaPlayer)
204 return; 204 return;
205 205
206 if (!videoElement()->isActive()) 206 if (!videoElement()->isActive())
207 return; 207 return;
208 208
209 videoElement()->setNeedsCompositingUpdate(); 209 videoElement()->setNeedsCompositingUpdate();
210 } 210 }
211 211
212 LayoutUnit RenderVideo::computeReplacedLogicalWidth(ShouldComputePreferred shoul dComputePreferred) const 212 LayoutUnit RenderVideo::computeReplacedLogicalWidth(ShouldComputePreferred shoul dComputePreferred) const
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 return CompositingReasonVideo; 278 return CompositingReasonVideo;
279 } 279 }
280 280
281 if (shouldDisplayVideo() && supportsAcceleratedRendering()) 281 if (shouldDisplayVideo() && supportsAcceleratedRendering())
282 return CompositingReasonVideo; 282 return CompositingReasonVideo;
283 283
284 return CompositingReasonNone; 284 return CompositingReasonNone;
285 } 285 }
286 286
287 } // namespace blink 287 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/HTMLVideoElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698