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

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

Issue 2083223002: Disable drawing of video backgrounds in OverlayFullscreenVideo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | 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) 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 18 matching lines...) Expand all
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/frame/VisualViewport.h" 35 #include "core/frame/VisualViewport.h"
36 #include "core/html/HTMLCanvasElement.h" 36 #include "core/html/HTMLCanvasElement.h"
37 #include "core/html/HTMLIFrameElement.h" 37 #include "core/html/HTMLIFrameElement.h"
38 #include "core/html/HTMLMediaElement.h" 38 #include "core/html/HTMLMediaElement.h"
39 #include "core/html/HTMLVideoElement.h"
39 #include "core/html/canvas/CanvasRenderingContext.h" 40 #include "core/html/canvas/CanvasRenderingContext.h"
40 #include "core/inspector/InspectorInstrumentation.h" 41 #include "core/inspector/InspectorInstrumentation.h"
41 #include "core/layout/LayoutEmbeddedObject.h" 42 #include "core/layout/LayoutEmbeddedObject.h"
42 #include "core/layout/LayoutHTMLCanvas.h" 43 #include "core/layout/LayoutHTMLCanvas.h"
43 #include "core/layout/LayoutImage.h" 44 #include "core/layout/LayoutImage.h"
44 #include "core/layout/LayoutPart.h" 45 #include "core/layout/LayoutPart.h"
45 #include "core/layout/LayoutVideo.h" 46 #include "core/layout/LayoutVideo.h"
46 #include "core/layout/LayoutView.h" 47 #include "core/layout/LayoutView.h"
47 #include "core/layout/compositing/PaintLayerCompositor.h" 48 #include "core/layout/compositing/PaintLayerCompositor.h"
48 #include "core/page/ChromeClient.h" 49 #include "core/page/ChromeClient.h"
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 793
793 FloatSize oldSize = m_graphicsLayer->size(); 794 FloatSize oldSize = m_graphicsLayer->size();
794 const FloatSize contentsSize(relativeCompositingBounds.size()); 795 const FloatSize contentsSize(relativeCompositingBounds.size());
795 if (oldSize != contentsSize) 796 if (oldSize != contentsSize)
796 m_graphicsLayer->setSize(contentsSize); 797 m_graphicsLayer->setSize(contentsSize);
797 798
798 // m_graphicsLayer is the corresponding GraphicsLayer for this PaintLayer an d its non-compositing 799 // m_graphicsLayer is the corresponding GraphicsLayer for this PaintLayer an d its non-compositing
799 // descendants. So, the visibility flag for m_graphicsLayer should be true i f there are any 800 // descendants. So, the visibility flag for m_graphicsLayer should be true i f there are any
800 // non-compositing visible layers. 801 // non-compositing visible layers.
801 bool contentsVisible = m_owningLayer.hasVisibleContent() || hasVisibleNonCom positingDescendant(&m_owningLayer); 802 bool contentsVisible = m_owningLayer.hasVisibleContent() || hasVisibleNonCom positingDescendant(&m_owningLayer);
802
803 m_graphicsLayer->setContentsVisible(contentsVisible); 803 m_graphicsLayer->setContentsVisible(contentsVisible);
804 804
805 m_graphicsLayer->setBackfaceVisibility(layoutObject()->style()->backfaceVisi bility() == BackfaceVisibilityVisible); 805 m_graphicsLayer->setBackfaceVisibility(layoutObject()->style()->backfaceVisi bility() == BackfaceVisibilityVisible);
806 } 806 }
807 807
808 void CompositedLayerMapping::computeGraphicsLayerParentLocation(const PaintLayer * compositingContainer, const IntRect& ancestorCompositingBounds, IntPoint& grap hicsLayerParentLocation) 808 void CompositedLayerMapping::computeGraphicsLayerParentLocation(const PaintLayer * compositingContainer, const IntRect& ancestorCompositingBounds, IntPoint& grap hicsLayerParentLocation)
809 { 809 {
810 if (compositingContainer && compositingContainer->compositedLayerMapping()-> hasClippingLayer()) { 810 if (compositingContainer && compositingContainer->compositedLayerMapping()-> hasClippingLayer()) {
811 // If the compositing ancestor has a layer to clip children, we parent i n that, and therefore 811 // If the compositing ancestor has a layer to clip children, we parent i n that, and therefore
812 // position relative to it. 812 // position relative to it.
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
1217 // And drawing of composited children takes into account the subpixel 1217 // And drawing of composited children takes into account the subpixel
1218 // accumulation of this CLM already (through its own 1218 // accumulation of this CLM already (through its own
1219 // graphicsLayerParentLocation it appears). 1219 // graphicsLayerParentLocation it appears).
1220 FloatPoint offsetDueToAncestorGraphicsLayers = m_graphicsLayer->position() + graphicsLayerParentLocation; 1220 FloatPoint offsetDueToAncestorGraphicsLayers = m_graphicsLayer->position() + graphicsLayerParentLocation;
1221 m_contentOffsetInCompositingLayer = LayoutSize(snappedOffsetFromCompositedAn cestor - offsetDueToAncestorGraphicsLayers); 1221 m_contentOffsetInCompositingLayer = LayoutSize(snappedOffsetFromCompositedAn cestor - offsetDueToAncestorGraphicsLayers);
1222 m_contentOffsetInCompositingLayerDirty = false; 1222 m_contentOffsetInCompositingLayerDirty = false;
1223 } 1223 }
1224 1224
1225 void CompositedLayerMapping::updateDrawsContent() 1225 void CompositedLayerMapping::updateDrawsContent()
1226 { 1226 {
1227 bool hasPaintedContent = containsPaintedContent(); 1227 bool inOverlayFullscreenVideo = false;
1228 if (layoutObject()->isVideo()) {
1229 HTMLVideoElement* videoElement = toHTMLVideoElement(layoutObject()->node ());
1230 if (videoElement->isFullscreen() && videoElement->usesOverlayFullscreenV ideo())
1231 inOverlayFullscreenVideo = true;
1232 }
1233 bool hasPaintedContent = inOverlayFullscreenVideo ? false : containsPaintedC ontent();
1228 m_graphicsLayer->setDrawsContent(hasPaintedContent); 1234 m_graphicsLayer->setDrawsContent(hasPaintedContent);
1229 1235
1230 if (m_scrollingLayer) { 1236 if (m_scrollingLayer) {
1231 // m_scrollingLayer never has backing store. 1237 // m_scrollingLayer never has backing store.
1232 // m_scrollingContentsLayer only needs backing store if the scrolled con tents need to paint. 1238 // m_scrollingContentsLayer only needs backing store if the scrolled con tents need to paint.
1233 m_scrollingContentsAreEmpty = !m_owningLayer.hasVisibleContent() || !(la youtObject()->hasBackground() || layoutObject()->hasBackdropFilter() || paintsCh ildren()); 1239 m_scrollingContentsAreEmpty = !m_owningLayer.hasVisibleContent() || !(la youtObject()->hasBackground() || layoutObject()->hasBackdropFilter() || paintsCh ildren());
1234 m_scrollingContentsLayer->setDrawsContent(!m_scrollingContentsAreEmpty); 1240 m_scrollingContentsLayer->setDrawsContent(!m_scrollingContentsAreEmpty);
1235 } 1241 }
1236 1242
1237 if (hasPaintedContent && isAcceleratedCanvas(layoutObject())) { 1243 if (hasPaintedContent && isAcceleratedCanvas(layoutObject())) {
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after
2641 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 2647 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
2642 name = "Scrolling Contents Layer"; 2648 name = "Scrolling Contents Layer";
2643 } else { 2649 } else {
2644 ASSERT_NOT_REACHED(); 2650 ASSERT_NOT_REACHED();
2645 } 2651 }
2646 2652
2647 return name; 2653 return name;
2648 } 2654 }
2649 2655
2650 } // namespace blink 2656 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698