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

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

Issue 18896003: [WIP] Migrate Fullscreen to use top layer instead of RenderFullScreen (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 17 matching lines...) Expand all
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/page/Frame.h" 33 #include "core/page/Frame.h"
34 #include "core/page/FrameView.h" 34 #include "core/page/FrameView.h"
35 #include "core/page/Page.h" 35 #include "core/page/Page.h"
36 #include "core/platform/graphics/MediaPlayer.h" 36 #include "core/platform/graphics/MediaPlayer.h"
37 #include "core/rendering/PaintInfo.h" 37 #include "core/rendering/PaintInfo.h"
38 #include "core/rendering/RenderFullScreen.h"
39 38
40 namespace WebCore { 39 namespace WebCore {
41 40
42 using namespace HTMLNames; 41 using namespace HTMLNames;
43 42
44 RenderVideo::RenderVideo(HTMLVideoElement* video) 43 RenderVideo::RenderVideo(HTMLVideoElement* video)
45 : RenderMedia(video) 44 : RenderMedia(video)
46 { 45 {
47 setIntrinsicSize(calculateIntrinsicSize()); 46 setIntrinsicSize(calculateIntrinsicSize());
48 } 47 }
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 259
261 bool RenderVideo::supportsAcceleratedRendering() const 260 bool RenderVideo::supportsAcceleratedRendering() const
262 { 261 {
263 MediaPlayer* p = mediaElement()->player(); 262 MediaPlayer* p = mediaElement()->player();
264 if (p) 263 if (p)
265 return p->supportsAcceleratedRendering(); 264 return p->supportsAcceleratedRendering();
266 265
267 return false; 266 return false;
268 } 267 }
269 268
270 static const RenderBlock* rendererPlaceholder(const RenderObject* renderer)
271 {
272 RenderObject* parent = renderer->parent();
273 if (!parent)
274 return 0;
275
276 RenderFullScreen* fullScreen = parent->isRenderFullScreen() ? toRenderFullSc reen(parent) : 0;
277 if (!fullScreen)
278 return 0;
279
280 return fullScreen->placeholder();
281 }
282
283 LayoutUnit RenderVideo::offsetLeft() const
284 {
285 if (const RenderBlock* block = rendererPlaceholder(this))
286 return block->offsetLeft();
287 return RenderMedia::offsetLeft();
288 }
289
290 LayoutUnit RenderVideo::offsetTop() const
291 {
292 if (const RenderBlock* block = rendererPlaceholder(this))
293 return block->offsetTop();
294 return RenderMedia::offsetTop();
295 }
296
297 LayoutUnit RenderVideo::offsetWidth() const
298 {
299 if (const RenderBlock* block = rendererPlaceholder(this))
300 return block->offsetWidth();
301 return RenderMedia::offsetWidth();
302 }
303
304 LayoutUnit RenderVideo::offsetHeight() const
305 {
306 if (const RenderBlock* block = rendererPlaceholder(this))
307 return block->offsetHeight();
308 return RenderMedia::offsetHeight();
309 }
310
falken 2013/07/09 12:50:22 These were added in https://bugs.webkit.org/show_b
311 } // namespace WebCore 269 } // namespace WebCore
OLDNEW
« Source/core/dom/FullscreenController.cpp ('K') | « Source/core/rendering/RenderVideo.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698