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

Side by Side Diff: Source/core/layout/compositing/LayerCompositor.cpp

Issue 931003002: Move and rename RenderPart to LayoutPart. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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/layout/compositing/LayerCompositor.h ('k') | Source/core/page/EventHandler.cpp » ('j') | 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 Apple Inc. All rights reserved. 2 * Copyright (C) 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 21 matching lines...) Expand all
32 #include "core/editing/FrameSelection.h" 32 #include "core/editing/FrameSelection.h"
33 #include "core/frame/FrameHost.h" 33 #include "core/frame/FrameHost.h"
34 #include "core/frame/FrameView.h" 34 #include "core/frame/FrameView.h"
35 #include "core/frame/LocalFrame.h" 35 #include "core/frame/LocalFrame.h"
36 #include "core/frame/Settings.h" 36 #include "core/frame/Settings.h"
37 #include "core/html/HTMLIFrameElement.h" 37 #include "core/html/HTMLIFrameElement.h"
38 #include "core/inspector/InspectorInstrumentation.h" 38 #include "core/inspector/InspectorInstrumentation.h"
39 #include "core/inspector/InspectorNodeIds.h" 39 #include "core/inspector/InspectorNodeIds.h"
40 #include "core/layout/LayerStackingNode.h" 40 #include "core/layout/LayerStackingNode.h"
41 #include "core/layout/LayerStackingNodeIterator.h" 41 #include "core/layout/LayerStackingNodeIterator.h"
42 #include "core/layout/LayoutPart.h"
42 #include "core/layout/LayoutVideo.h" 43 #include "core/layout/LayoutVideo.h"
43 #include "core/layout/compositing/CompositedLayerMapping.h" 44 #include "core/layout/compositing/CompositedLayerMapping.h"
44 #include "core/layout/compositing/CompositingInputsUpdater.h" 45 #include "core/layout/compositing/CompositingInputsUpdater.h"
45 #include "core/layout/compositing/CompositingLayerAssigner.h" 46 #include "core/layout/compositing/CompositingLayerAssigner.h"
46 #include "core/layout/compositing/CompositingRequirementsUpdater.h" 47 #include "core/layout/compositing/CompositingRequirementsUpdater.h"
47 #include "core/layout/compositing/GraphicsLayerTreeBuilder.h" 48 #include "core/layout/compositing/GraphicsLayerTreeBuilder.h"
48 #include "core/layout/compositing/GraphicsLayerUpdater.h" 49 #include "core/layout/compositing/GraphicsLayerUpdater.h"
49 #include "core/loader/FrameLoaderClient.h" 50 #include "core/loader/FrameLoaderClient.h"
50 #include "core/page/Chrome.h" 51 #include "core/page/Chrome.h"
51 #include "core/page/ChromeClient.h" 52 #include "core/page/ChromeClient.h"
52 #include "core/page/Page.h" 53 #include "core/page/Page.h"
53 #include "core/page/scrolling/ScrollingCoordinator.h" 54 #include "core/page/scrolling/ScrollingCoordinator.h"
54 #include "core/paint/FramePainter.h" 55 #include "core/paint/FramePainter.h"
55 #include "core/paint/TransformRecorder.h" 56 #include "core/paint/TransformRecorder.h"
56 #include "core/rendering/RenderEmbeddedObject.h" 57 #include "core/rendering/RenderEmbeddedObject.h"
57 #include "core/rendering/RenderPart.h"
58 #include "core/rendering/RenderView.h" 58 #include "core/rendering/RenderView.h"
59 #include "platform/RuntimeEnabledFeatures.h" 59 #include "platform/RuntimeEnabledFeatures.h"
60 #include "platform/ScriptForbiddenScope.h" 60 #include "platform/ScriptForbiddenScope.h"
61 #include "platform/TraceEvent.h" 61 #include "platform/TraceEvent.h"
62 #include "platform/graphics/GraphicsLayer.h" 62 #include "platform/graphics/GraphicsLayer.h"
63 #include "platform/graphics/paint/DisplayItemList.h" 63 #include "platform/graphics/paint/DisplayItemList.h"
64 #include "platform/graphics/paint/DrawingRecorder.h" 64 #include "platform/graphics/paint/DrawingRecorder.h"
65 #include "platform/graphics/paint/TransformDisplayItem.h" 65 #include "platform/graphics/paint/TransformDisplayItem.h"
66 #include "public/platform/Platform.h" 66 #include "public/platform/Platform.h"
67 67
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 return m_compositing; 100 return m_compositing;
101 } 101 }
102 102
103 void LayerCompositor::setCompositingModeEnabled(bool enable) 103 void LayerCompositor::setCompositingModeEnabled(bool enable)
104 { 104 {
105 if (enable == m_compositing) 105 if (enable == m_compositing)
106 return; 106 return;
107 107
108 m_compositing = enable; 108 m_compositing = enable;
109 109
110 // RenderPart::requiresAcceleratedCompositing is used to determine self-pain tingness 110 // LayoutPart::requiresAcceleratedCompositing is used to determine self-pain tingness
111 // and bases it's return value for frames on the m_compositing bit here. 111 // and bases it's return value for frames on the m_compositing bit here.
112 if (HTMLFrameOwnerElement* ownerElement = m_renderView.document().ownerEleme nt()) { 112 if (HTMLFrameOwnerElement* ownerElement = m_renderView.document().ownerEleme nt()) {
113 if (RenderPart* renderer = ownerElement->renderPart()) 113 if (LayoutPart* renderer = ownerElement->layoutPart())
114 renderer->layer()->updateSelfPaintingLayer(); 114 renderer->layer()->updateSelfPaintingLayer();
115 } 115 }
116 116
117 if (m_compositing) 117 if (m_compositing)
118 ensureRootLayer(); 118 ensureRootLayer();
119 else 119 else
120 destroyRootLayer(); 120 destroyRootLayer();
121 121
122 // Compositing also affects the answer to RenderIFrame::requiresAcceleratedC ompositing(), so 122 // Compositing also affects the answer to RenderIFrame::requiresAcceleratedC ompositing(), so
123 // we need to schedule a style recalc in our parent document. 123 // we need to schedule a style recalc in our parent document.
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 compositedLayerMappingChanged = true; 458 compositedLayerMappingChanged = true;
459 } 459 }
460 460
461 break; 461 break;
462 case RemoveFromSquashingLayer: 462 case RemoveFromSquashingLayer:
463 case NoCompositingStateChange: 463 case NoCompositingStateChange:
464 // Do nothing. 464 // Do nothing.
465 break; 465 break;
466 } 466 }
467 467
468 if (compositedLayerMappingChanged && layer->renderer()->isRenderPart()) { 468 if (compositedLayerMappingChanged && layer->renderer()->isLayoutPart()) {
469 LayerCompositor* innerCompositor = frameContentsCompositor(toRenderPart( layer->renderer())); 469 LayerCompositor* innerCompositor = frameContentsCompositor(toLayoutPart( layer->renderer()));
470 if (innerCompositor && innerCompositor->staleInCompositingMode()) 470 if (innerCompositor && innerCompositor->staleInCompositingMode())
471 innerCompositor->updateRootLayerAttachment(); 471 innerCompositor->updateRootLayerAttachment();
472 } 472 }
473 473
474 if (compositedLayerMappingChanged) 474 if (compositedLayerMappingChanged)
475 layer->clipper().clearClipRectsIncludingDescendants(PaintingClipRects); 475 layer->clipper().clearClipRectsIncludingDescendants(PaintingClipRects);
476 476
477 // If a fixed position layer gained/lost a compositedLayerMapping or the rea son not compositing it changed, 477 // If a fixed position layer gained/lost a compositedLayerMapping or the rea son not compositing it changed,
478 // the scrolling coordinator needs to recalculate whether it can do fast scr olling. 478 // the scrolling coordinator needs to recalculate whether it can do fast scr olling.
479 if (compositedLayerMappingChanged) { 479 if (compositedLayerMappingChanged) {
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 String layerTreeText = rootLayer->layerTreeAsText(flags); 607 String layerTreeText = rootLayer->layerTreeAsText(flags);
608 608
609 // The true root layer is not included in the dump, so if we want to report 609 // The true root layer is not included in the dump, so if we want to report
610 // its paint invalidation rects, they must be included here. 610 // its paint invalidation rects, they must be included here.
611 if (flags & LayerTreeIncludesPaintInvalidationRects) 611 if (flags & LayerTreeIncludesPaintInvalidationRects)
612 return m_renderView.frameView()->trackedPaintInvalidationRectsAsText() + layerTreeText; 612 return m_renderView.frameView()->trackedPaintInvalidationRectsAsText() + layerTreeText;
613 613
614 return layerTreeText; 614 return layerTreeText;
615 } 615 }
616 616
617 LayerCompositor* LayerCompositor::frameContentsCompositor(RenderPart* renderer) 617 LayerCompositor* LayerCompositor::frameContentsCompositor(LayoutPart* renderer)
618 { 618 {
619 if (!renderer->node()->isFrameOwnerElement()) 619 if (!renderer->node()->isFrameOwnerElement())
620 return 0; 620 return 0;
621 621
622 HTMLFrameOwnerElement* element = toHTMLFrameOwnerElement(renderer->node()); 622 HTMLFrameOwnerElement* element = toHTMLFrameOwnerElement(renderer->node());
623 if (Document* contentDocument = element->contentDocument()) { 623 if (Document* contentDocument = element->contentDocument()) {
624 if (RenderView* view = contentDocument->renderView()) 624 if (RenderView* view = contentDocument->renderView())
625 return view->compositor(); 625 return view->compositor();
626 } 626 }
627 return 0; 627 return 0;
628 } 628 }
629 629
630 // FIXME: What does this function do? It needs a clearer name. 630 // FIXME: What does this function do? It needs a clearer name.
631 bool LayerCompositor::parentFrameContentLayers(RenderPart* renderer) 631 bool LayerCompositor::parentFrameContentLayers(LayoutPart* renderer)
632 { 632 {
633 LayerCompositor* innerCompositor = frameContentsCompositor(renderer); 633 LayerCompositor* innerCompositor = frameContentsCompositor(renderer);
634 if (!innerCompositor || !innerCompositor->staleInCompositingMode() || innerC ompositor->rootLayerAttachment() != RootLayerAttachedViaEnclosingFrame) 634 if (!innerCompositor || !innerCompositor->staleInCompositingMode() || innerC ompositor->rootLayerAttachment() != RootLayerAttachedViaEnclosingFrame)
635 return false; 635 return false;
636 636
637 Layer* layer = renderer->layer(); 637 Layer* layer = renderer->layer();
638 if (!layer->hasCompositedLayerMapping()) 638 if (!layer->hasCompositedLayerMapping())
639 return false; 639 return false;
640 640
641 CompositedLayerMapping* compositedLayerMapping = layer->compositedLayerMappi ng(); 641 CompositedLayerMapping* compositedLayerMapping = layer->compositedLayerMappi ng();
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 } else if (graphicsLayer == m_scrollLayer.get()) { 1162 } else if (graphicsLayer == m_scrollLayer.get()) {
1163 name = "LocalFrame Scrolling Layer"; 1163 name = "LocalFrame Scrolling Layer";
1164 } else { 1164 } else {
1165 ASSERT_NOT_REACHED(); 1165 ASSERT_NOT_REACHED();
1166 } 1166 }
1167 1167
1168 return name; 1168 return name;
1169 } 1169 }
1170 1170
1171 } // namespace blink 1171 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/compositing/LayerCompositor.h ('k') | Source/core/page/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698