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

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

Issue 13959008: Remove NonCompositedContentHost (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase. add setBackgroundColor to setIsAcceleratedCompositingActive Created 7 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 | Annotate | Revision Log
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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 362
363 if (flags & IsUpdateRoot) { 363 if (flags & IsUpdateRoot) {
364 updateGraphicsLayerGeometry(); 364 updateGraphicsLayerGeometry();
365 layerCompositor->updateRootLayerPosition(); 365 layerCompositor->updateRootLayerPosition();
366 RenderLayer* stackingContainer = m_owningLayer->enclosingStackingCon tainer(); 366 RenderLayer* stackingContainer = m_owningLayer->enclosingStackingCon tainer();
367 if (!layerCompositor->compositingLayersNeedRebuild() && stackingCont ainer && (stackingContainer != m_owningLayer)) 367 if (!layerCompositor->compositingLayersNeedRebuild() && stackingCont ainer && (stackingContainer != m_owningLayer))
368 layerCompositor->updateCompositingDescendantGeometry(stackingCon tainer, stackingContainer, flags & CompositingChildrenOnly); 368 layerCompositor->updateCompositingDescendantGeometry(stackingCon tainer, stackingContainer, flags & CompositingChildrenOnly);
369 } 369 }
370 } 370 }
371 371
372 if (flags & NeedsFullRepaint && !paintsIntoWindow() && !paintsIntoComposited Ancestor()) 372 if (flags & NeedsFullRepaint && !paintsIntoCompositedAncestor())
373 setContentsNeedDisplay(); 373 setContentsNeedDisplay();
374 } 374 }
375 375
376 bool RenderLayerBacking::updateGraphicsLayerConfiguration() 376 bool RenderLayerBacking::updateGraphicsLayerConfiguration()
377 { 377 {
378 RenderLayerCompositor* compositor = this->compositor(); 378 RenderLayerCompositor* compositor = this->compositor();
379 RenderObject* renderer = this->renderer(); 379 RenderObject* renderer = this->renderer();
380 380
381 m_owningLayer->updateDescendantDependentFlags(); 381 m_owningLayer->updateDescendantDependentFlags();
382 m_owningLayer->updateZOrderLists(); 382 m_owningLayer->updateZOrderLists();
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
1311 } 1311 }
1312 1312
1313 // Conservative test for having no rendered children. 1313 // Conservative test for having no rendered children.
1314 bool RenderLayerBacking::hasVisibleNonCompositingDescendantLayers() const 1314 bool RenderLayerBacking::hasVisibleNonCompositingDescendantLayers() const
1315 { 1315 {
1316 return hasVisibleNonCompositingDescendant(m_owningLayer); 1316 return hasVisibleNonCompositingDescendant(m_owningLayer);
1317 } 1317 }
1318 1318
1319 bool RenderLayerBacking::containsPaintedContent() const 1319 bool RenderLayerBacking::containsPaintedContent() const
1320 { 1320 {
1321 if (isSimpleContainerCompositingLayer() || paintsIntoWindow() || paintsIntoC ompositedAncestor() || m_artificiallyInflatedBounds || m_owningLayer->isReflecti on()) 1321 if (isSimpleContainerCompositingLayer() || paintsIntoCompositedAncestor() || m_artificiallyInflatedBounds || m_owningLayer->isReflection())
1322 return false; 1322 return false;
1323 1323
1324 if (isDirectlyCompositedImage()) 1324 if (isDirectlyCompositedImage())
1325 return false; 1325 return false;
1326 1326
1327 // FIXME: we could optimize cases where the image, video or canvas is known to fill the border box entirely, 1327 // FIXME: we could optimize cases where the image, video or canvas is known to fill the border box entirely,
1328 // and set background color on the layer in that case, instead of allocating backing store and painting. 1328 // and set background color on the layer in that case, instead of allocating backing store and painting.
1329 if (renderer()->isVideo() && toRenderVideo(renderer())->shouldDisplayVideo() ) 1329 if (renderer()->isVideo() && toRenderVideo(renderer())->shouldDisplayVideo() )
1330 return m_owningLayer->hasBoxDecorationsOrBackground(); 1330 return m_owningLayer->hasBoxDecorationsOrBackground();
1331 1331
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1494 { 1494 {
1495 if (m_ancestorClippingLayer) 1495 if (m_ancestorClippingLayer)
1496 return m_ancestorClippingLayer.get(); 1496 return m_ancestorClippingLayer.get();
1497 1497
1498 if (m_contentsContainmentLayer) 1498 if (m_contentsContainmentLayer)
1499 return m_contentsContainmentLayer.get(); 1499 return m_contentsContainmentLayer.get();
1500 1500
1501 return m_graphicsLayer.get(); 1501 return m_graphicsLayer.get();
1502 } 1502 }
1503 1503
1504 bool RenderLayerBacking::paintsIntoWindow() const
1505 {
1506 if (m_owningLayer->isRootLayer()) {
1507 return compositor()->rootLayerAttachment() != RenderLayerCompositor::Roo tLayerAttachedViaEnclosingFrame;
1508 }
1509
1510 return false;
1511 }
1512
1513 void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking) 1504 void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking)
1514 { 1505 {
1515 if (requiresOwnBacking == m_requiresOwnBackingStore) 1506 if (requiresOwnBacking == m_requiresOwnBackingStore)
1516 return; 1507 return;
1517 1508
1518 m_requiresOwnBackingStore = requiresOwnBacking; 1509 m_requiresOwnBackingStore = requiresOwnBacking;
1519 1510
1520 // This affects the answer to paintsIntoCompositedAncestor(), which in turn affects 1511 // This affects the answer to paintsIntoCompositedAncestor(), which in turn affects
1521 // cached clip rects, so when it changes we have to clear clip rects on desc endants. 1512 // cached clip rects, so when it changes we have to clear clip rects on desc endants.
1522 m_owningLayer->clearClipRectsIncludingDescendants(PaintingClipRects); 1513 m_owningLayer->clearClipRectsIncludingDescendants(PaintingClipRects);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1583 IntRect layerDirtyRect = r; 1574 IntRect layerDirtyRect = r;
1584 layerDirtyRect.move(-m_scrollingContentsLayer->offsetFromRenderer()); 1575 layerDirtyRect.move(-m_scrollingContentsLayer->offsetFromRenderer());
1585 m_scrollingContentsLayer->setNeedsDisplayInRect(layerDirtyRect); 1576 m_scrollingContentsLayer->setNeedsDisplayInRect(layerDirtyRect);
1586 } 1577 }
1587 } 1578 }
1588 1579
1589 void RenderLayerBacking::paintIntoLayer(const GraphicsLayer* graphicsLayer, Grap hicsContext* context, 1580 void RenderLayerBacking::paintIntoLayer(const GraphicsLayer* graphicsLayer, Grap hicsContext* context,
1590 const IntRect& paintDirtyRect, // In the coords of rootLayer . 1581 const IntRect& paintDirtyRect, // In the coords of rootLayer .
1591 PaintBehavior paintBehavior, GraphicsLayerPaintingPhase pain tingPhase) 1582 PaintBehavior paintBehavior, GraphicsLayerPaintingPhase pain tingPhase)
1592 { 1583 {
1593 if (paintsIntoWindow() || paintsIntoCompositedAncestor()) { 1584 if (paintsIntoCompositedAncestor()) {
1594 ASSERT_NOT_REACHED(); 1585 ASSERT_NOT_REACHED();
1595 return; 1586 return;
1596 } 1587 }
1597 1588
1598 FontCachePurgePreventer fontCachePurgePreventer; 1589 FontCachePurgePreventer fontCachePurgePreventer;
1599 1590
1600 RenderLayer::PaintLayerFlags paintFlags = 0; 1591 RenderLayer::PaintLayerFlags paintFlags = 0;
1601 if (paintingPhase & GraphicsLayerPaintBackground) 1592 if (paintingPhase & GraphicsLayerPaintBackground)
1602 paintFlags |= RenderLayer::PaintLayerPaintingCompositingBackgroundPhase; 1593 paintFlags |= RenderLayer::PaintLayerPaintingCompositingBackgroundPhase;
1603 if (paintingPhase & GraphicsLayerPaintForeground) 1594 if (paintingPhase & GraphicsLayerPaintForeground)
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
1955 info.addMember(m_childContainmentLayer, "childContainmentLayer"); 1946 info.addMember(m_childContainmentLayer, "childContainmentLayer");
1956 info.addMember(m_maskLayer, "maskLayer"); 1947 info.addMember(m_maskLayer, "maskLayer");
1957 info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar") ; 1948 info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar") ;
1958 info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar"); 1949 info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar");
1959 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); 1950 info.addMember(m_layerForScrollCorner, "layerForScrollCorner");
1960 info.addMember(m_scrollingLayer, "scrollingLayer"); 1951 info.addMember(m_scrollingLayer, "scrollingLayer");
1961 info.addMember(m_scrollingContentsLayer, "scrollingContentsLayer"); 1952 info.addMember(m_scrollingContentsLayer, "scrollingContentsLayer");
1962 } 1953 }
1963 1954
1964 } // namespace WebCore 1955 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698