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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 1907753002: Make the video layer contents visible in OverlayFullscreenVideo mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clarified comment Created 4 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 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/HTMLNames.h" 28 #include "core/HTMLNames.h"
29 #include "core/dom/DOMNodeIds.h" 29 #include "core/dom/DOMNodeIds.h"
30 #include "core/fetch/ImageResource.h" 30 #include "core/fetch/ImageResource.h"
31 #include "core/frame/FrameHost.h" 31 #include "core/frame/FrameHost.h"
32 #include "core/frame/FrameView.h" 32 #include "core/frame/FrameView.h"
33 #include "core/frame/RemoteFrame.h" 33 #include "core/frame/RemoteFrame.h"
34 #include "core/frame/Settings.h" 34 #include "core/frame/Settings.h"
35 #include "core/html/HTMLCanvasElement.h" 35 #include "core/html/HTMLCanvasElement.h"
36 #include "core/html/HTMLIFrameElement.h" 36 #include "core/html/HTMLIFrameElement.h"
37 #include "core/html/HTMLMediaElement.h" 37 #include "core/html/HTMLMediaElement.h"
38 #include "core/html/HTMLVideoElement.h"
39 #include "core/html/canvas/CanvasRenderingContext.h" 38 #include "core/html/canvas/CanvasRenderingContext.h"
40 #include "core/inspector/InspectorInstrumentation.h" 39 #include "core/inspector/InspectorInstrumentation.h"
41 #include "core/layout/LayoutEmbeddedObject.h" 40 #include "core/layout/LayoutEmbeddedObject.h"
42 #include "core/layout/LayoutHTMLCanvas.h" 41 #include "core/layout/LayoutHTMLCanvas.h"
43 #include "core/layout/LayoutImage.h" 42 #include "core/layout/LayoutImage.h"
44 #include "core/layout/LayoutPart.h" 43 #include "core/layout/LayoutPart.h"
45 #include "core/layout/LayoutVideo.h" 44 #include "core/layout/LayoutVideo.h"
46 #include "core/layout/LayoutView.h" 45 #include "core/layout/LayoutView.h"
47 #include "core/layout/compositing/PaintLayerCompositor.h" 46 #include "core/layout/compositing/PaintLayerCompositor.h"
48 #include "core/page/ChromeClient.h" 47 #include "core/page/ChromeClient.h"
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 759
761 FloatSize oldSize = m_graphicsLayer->size(); 760 FloatSize oldSize = m_graphicsLayer->size();
762 const FloatSize contentsSize(relativeCompositingBounds.size()); 761 const FloatSize contentsSize(relativeCompositingBounds.size());
763 if (oldSize != contentsSize) 762 if (oldSize != contentsSize)
764 m_graphicsLayer->setSize(contentsSize); 763 m_graphicsLayer->setSize(contentsSize);
765 764
766 // m_graphicsLayer is the corresponding GraphicsLayer for this PaintLayer an d its non-compositing 765 // m_graphicsLayer is the corresponding GraphicsLayer for this PaintLayer an d its non-compositing
767 // descendants. So, the visibility flag for m_graphicsLayer should be true i f there are any 766 // descendants. So, the visibility flag for m_graphicsLayer should be true i f there are any
768 // non-compositing visible layers. 767 // non-compositing visible layers.
769 bool contentsVisible = m_owningLayer.hasVisibleContent() || hasVisibleNonCom positingDescendant(&m_owningLayer); 768 bool contentsVisible = m_owningLayer.hasVisibleContent() || hasVisibleNonCom positingDescendant(&m_owningLayer);
770 if (layoutObject()->isVideo()) { 769
771 HTMLVideoElement* videoElement = toHTMLVideoElement(layoutObject()->node ());
772 if (videoElement->isFullscreen() && videoElement->usesOverlayFullscreenV ideo())
773 contentsVisible = false;
774 }
775 m_graphicsLayer->setContentsVisible(contentsVisible); 770 m_graphicsLayer->setContentsVisible(contentsVisible);
776 771
777 m_graphicsLayer->setBackfaceVisibility(layoutObject()->style()->backfaceVisi bility() == BackfaceVisibilityVisible); 772 m_graphicsLayer->setBackfaceVisibility(layoutObject()->style()->backfaceVisi bility() == BackfaceVisibilityVisible);
778 } 773 }
779 774
780 void CompositedLayerMapping::computeGraphicsLayerParentLocation(const PaintLayer * compositingContainer, const IntRect& ancestorCompositingBounds, IntPoint& grap hicsLayerParentLocation) 775 void CompositedLayerMapping::computeGraphicsLayerParentLocation(const PaintLayer * compositingContainer, const IntRect& ancestorCompositingBounds, IntPoint& grap hicsLayerParentLocation)
781 { 776 {
782 if (compositingContainer && compositingContainer->compositedLayerMapping()-> hasClippingLayer()) { 777 if (compositingContainer && compositingContainer->compositedLayerMapping()-> hasClippingLayer()) {
783 // If the compositing ancestor has a layer to clip children, we parent i n that, and therefore 778 // If the compositing ancestor has a layer to clip children, we parent i n that, and therefore
784 // position relative to it. 779 // position relative to it.
(...skipping 1795 matching lines...) Expand 10 before | Expand all | Expand 10 after
2580 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 2575 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
2581 name = "Scrolling Contents Layer"; 2576 name = "Scrolling Contents Layer";
2582 } else { 2577 } else {
2583 ASSERT_NOT_REACHED(); 2578 ASSERT_NOT_REACHED();
2584 } 2579 }
2585 2580
2586 return name; 2581 return name;
2587 } 2582 }
2588 2583
2589 } // namespace blink 2584 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/linux/virtual/android/fullscreen/video-specified-size-expected.png ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698