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

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

Issue 134753003: Reland r165710 "Replace RenderFullScreen with top layer" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: patch for landing Created 6 years, 11 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) 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 16 matching lines...) Expand all
27 27
28 #include "core/rendering/RenderVideo.h" 28 #include "core/rendering/RenderVideo.h"
29 29
30 #include "HTMLNames.h" 30 #include "HTMLNames.h"
31 #include "core/dom/Document.h" 31 #include "core/dom/Document.h"
32 #include "core/html/HTMLVideoElement.h" 32 #include "core/html/HTMLVideoElement.h"
33 #include "core/frame/Frame.h" 33 #include "core/frame/Frame.h"
34 #include "core/frame/FrameView.h" 34 #include "core/frame/FrameView.h"
35 #include "core/rendering/LayoutRectRecorder.h" 35 #include "core/rendering/LayoutRectRecorder.h"
36 #include "core/rendering/PaintInfo.h" 36 #include "core/rendering/PaintInfo.h"
37 #include "core/rendering/RenderFullScreen.h"
38 #include "platform/graphics/media/MediaPlayer.h" 37 #include "platform/graphics/media/MediaPlayer.h"
39 #include "public/platform/WebLayer.h" 38 #include "public/platform/WebLayer.h"
40 39
41 namespace WebCore { 40 namespace WebCore {
42 41
43 using namespace HTMLNames; 42 using namespace HTMLNames;
44 43
45 RenderVideo::RenderVideo(HTMLVideoElement* video) 44 RenderVideo::RenderVideo(HTMLVideoElement* video)
46 : RenderMedia(video) 45 : RenderMedia(video)
47 { 46 {
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 LayoutUnit RenderVideo::minimumReplacedHeight() const 227 LayoutUnit RenderVideo::minimumReplacedHeight() const
229 { 228 {
230 return RenderReplaced::minimumReplacedHeight(); 229 return RenderReplaced::minimumReplacedHeight();
231 } 230 }
232 231
233 bool RenderVideo::supportsAcceleratedRendering() const 232 bool RenderVideo::supportsAcceleratedRendering() const
234 { 233 {
235 return !!mediaElement()->platformLayer(); 234 return !!mediaElement()->platformLayer();
236 } 235 }
237 236
238 static const RenderBlock* rendererPlaceholder(const RenderObject* renderer)
239 {
240 RenderObject* parent = renderer->parent();
241 if (!parent)
242 return 0;
243
244 RenderFullScreen* fullScreen = parent->isRenderFullScreen() ? toRenderFullSc reen(parent) : 0;
245 if (!fullScreen)
246 return 0;
247
248 return fullScreen->placeholder();
249 }
250
251 LayoutUnit RenderVideo::offsetLeft() const
252 {
253 if (const RenderBlock* block = rendererPlaceholder(this))
254 return block->offsetLeft();
255 return RenderMedia::offsetLeft();
256 }
257
258 LayoutUnit RenderVideo::offsetTop() const
259 {
260 if (const RenderBlock* block = rendererPlaceholder(this))
261 return block->offsetTop();
262 return RenderMedia::offsetTop();
263 }
264
265 LayoutUnit RenderVideo::offsetWidth() const
266 {
267 if (const RenderBlock* block = rendererPlaceholder(this))
268 return block->offsetWidth();
269 return RenderMedia::offsetWidth();
270 }
271
272 LayoutUnit RenderVideo::offsetHeight() const
273 {
274 if (const RenderBlock* block = rendererPlaceholder(this))
275 return block->offsetHeight();
276 return RenderMedia::offsetHeight();
277 }
278
279 } // namespace WebCore 237 } // namespace WebCore
OLDNEW
« LayoutTests/TestExpectations ('K') | « Source/core/rendering/RenderVideo.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698