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

Side by Side Diff: sky/engine/core/rendering/compositing/RenderLayerCompositor.cpp

Issue 686903003: Remove RenderPart. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 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 20 matching lines...) Expand all
31 #include "core/frame/FrameView.h" 31 #include "core/frame/FrameView.h"
32 #include "core/frame/LocalFrame.h" 32 #include "core/frame/LocalFrame.h"
33 #include "core/frame/Settings.h" 33 #include "core/frame/Settings.h"
34 #include "core/inspector/InspectorNodeIds.h" 34 #include "core/inspector/InspectorNodeIds.h"
35 #include "core/page/Chrome.h" 35 #include "core/page/Chrome.h"
36 #include "core/page/ChromeClient.h" 36 #include "core/page/ChromeClient.h"
37 #include "core/page/Page.h" 37 #include "core/page/Page.h"
38 #include "core/page/scrolling/ScrollingCoordinator.h" 38 #include "core/page/scrolling/ScrollingCoordinator.h"
39 #include "core/rendering/RenderLayerStackingNode.h" 39 #include "core/rendering/RenderLayerStackingNode.h"
40 #include "core/rendering/RenderLayerStackingNodeIterator.h" 40 #include "core/rendering/RenderLayerStackingNodeIterator.h"
41 #include "core/rendering/RenderPart.h"
42 #include "core/rendering/RenderVideo.h" 41 #include "core/rendering/RenderVideo.h"
43 #include "core/rendering/RenderView.h" 42 #include "core/rendering/RenderView.h"
44 #include "core/rendering/compositing/CompositedLayerMapping.h" 43 #include "core/rendering/compositing/CompositedLayerMapping.h"
45 #include "core/rendering/compositing/CompositingInputsUpdater.h" 44 #include "core/rendering/compositing/CompositingInputsUpdater.h"
46 #include "core/rendering/compositing/CompositingLayerAssigner.h" 45 #include "core/rendering/compositing/CompositingLayerAssigner.h"
47 #include "core/rendering/compositing/CompositingRequirementsUpdater.h" 46 #include "core/rendering/compositing/CompositingRequirementsUpdater.h"
48 #include "core/rendering/compositing/GraphicsLayerTreeBuilder.h" 47 #include "core/rendering/compositing/GraphicsLayerTreeBuilder.h"
49 #include "core/rendering/compositing/GraphicsLayerUpdater.h" 48 #include "core/rendering/compositing/GraphicsLayerUpdater.h"
50 #include "platform/RuntimeEnabledFeatures.h" 49 #include "platform/RuntimeEnabledFeatures.h"
51 #include "platform/ScriptForbiddenScope.h" 50 #include "platform/ScriptForbiddenScope.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 break; 334 break;
336 case RemoveFromSquashingLayer: 335 case RemoveFromSquashingLayer:
337 case NoCompositingStateChange: 336 case NoCompositingStateChange:
338 // Do nothing. 337 // Do nothing.
339 break; 338 break;
340 } 339 }
341 340
342 if (layer->hasCompositedLayerMapping() && layer->compositedLayerMapping()->u pdateRequiresOwnBackingStoreForIntrinsicReasons()) 341 if (layer->hasCompositedLayerMapping() && layer->compositedLayerMapping()->u pdateRequiresOwnBackingStoreForIntrinsicReasons())
343 compositedLayerMappingChanged = true; 342 compositedLayerMappingChanged = true;
344 343
345 if (compositedLayerMappingChanged && layer->renderer()->isRenderPart()) {
346 RenderLayerCompositor* innerCompositor = frameContentsCompositor(toRende rPart(layer->renderer()));
347 if (innerCompositor && innerCompositor->staleInCompositingMode())
348 innerCompositor->updateRootLayerAttachment();
349 }
350
351 if (compositedLayerMappingChanged) 344 if (compositedLayerMappingChanged)
352 layer->clipper().clearClipRectsIncludingDescendants(PaintingClipRects); 345 layer->clipper().clearClipRectsIncludingDescendants(PaintingClipRects);
353 346
354 // If a fixed position layer gained/lost a compositedLayerMapping or the rea son not compositing it changed, 347 // If a fixed position layer gained/lost a compositedLayerMapping or the rea son not compositing it changed,
355 // the scrolling coordinator needs to recalculate whether it can do fast scr olling. 348 // the scrolling coordinator needs to recalculate whether it can do fast scr olling.
356 if (compositedLayerMappingChanged) { 349 if (compositedLayerMappingChanged) {
357 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordina tor()) 350 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordina tor())
358 scrollingCoordinator->frameViewFixedObjectsDidChange(m_renderView.fr ameView()); 351 scrollingCoordinator->frameViewFixedObjectsDidChange(m_renderView.fr ameView());
359 } 352 }
360 353
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 String layerTreeText = rootLayer->layerTreeAsText(flags); 463 String layerTreeText = rootLayer->layerTreeAsText(flags);
471 464
472 // The true root layer is not included in the dump, so if we want to report 465 // The true root layer is not included in the dump, so if we want to report
473 // its paint invalidation rects, they must be included here. 466 // its paint invalidation rects, they must be included here.
474 if (flags & LayerTreeIncludesPaintInvalidationRects) 467 if (flags & LayerTreeIncludesPaintInvalidationRects)
475 return m_renderView.frameView()->trackedPaintInvalidationRectsAsText() + layerTreeText; 468 return m_renderView.frameView()->trackedPaintInvalidationRectsAsText() + layerTreeText;
476 469
477 return layerTreeText; 470 return layerTreeText;
478 } 471 }
479 472
480 RenderLayerCompositor* RenderLayerCompositor::frameContentsCompositor(RenderPart * renderer)
481 {
482 return 0;
483 }
484
485 // FIXME: What does this function do? It needs a clearer name.
486 bool RenderLayerCompositor::parentFrameContentLayers(RenderPart* renderer)
487 {
488 RenderLayerCompositor* innerCompositor = frameContentsCompositor(renderer);
489 if (!innerCompositor || !innerCompositor->staleInCompositingMode() || innerC ompositor->rootLayerAttachment() != RootLayerAttachedViaEnclosingFrame)
490 return false;
491
492 RenderLayer* layer = renderer->layer();
493 if (!layer->hasCompositedLayerMapping())
494 return false;
495
496 CompositedLayerMapping* compositedLayerMapping = layer->compositedLayerMappi ng();
497 GraphicsLayer* hostingLayer = compositedLayerMapping->parentForSublayers();
498 GraphicsLayer* rootLayer = innerCompositor->rootGraphicsLayer();
499 if (hostingLayer->children().size() != 1 || hostingLayer->children()[0] != r ootLayer) {
500 hostingLayer->removeAllChildren();
501 hostingLayer->addChild(rootLayer);
502 }
503 return true;
504 }
505
506 static void fullyInvalidatePaintRecursive(RenderLayer* layer) 473 static void fullyInvalidatePaintRecursive(RenderLayer* layer)
507 { 474 {
508 if (layer->compositingState() == PaintsIntoOwnBacking) { 475 if (layer->compositingState() == PaintsIntoOwnBacking) {
509 layer->compositedLayerMapping()->setContentsNeedDisplay(); 476 layer->compositedLayerMapping()->setContentsNeedDisplay();
510 layer->compositedLayerMapping()->setSquashingContentsNeedDisplay(); 477 layer->compositedLayerMapping()->setSquashingContentsNeedDisplay();
511 } 478 }
512 479
513 for (RenderLayer* child = layer->firstChild(); child; child = child->nextSib ling()) 480 for (RenderLayer* child = layer->firstChild(); child; child = child->nextSib ling())
514 fullyInvalidatePaintRecursive(child); 481 fullyInvalidatePaintRecursive(child);
515 } 482 }
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 } else if (graphicsLayer == m_scrollLayer.get()) { 904 } else if (graphicsLayer == m_scrollLayer.get()) {
938 name = "LocalFrame Scrolling Layer"; 905 name = "LocalFrame Scrolling Layer";
939 } else { 906 } else {
940 ASSERT_NOT_REACHED(); 907 ASSERT_NOT_REACHED();
941 } 908 }
942 909
943 return name; 910 return name;
944 } 911 }
945 912
946 } // namespace blink 913 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/compositing/RenderLayerCompositor.h ('k') | sky/engine/platform/graphics/CompositingReasons.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698