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

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

Issue 13959008: Remove NonCompositedContentHost (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Adding back LCD text workaround Created 7 years, 8 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 18 matching lines...) Expand all
29 29
30 #include "AnimationController.h" 30 #include "AnimationController.h"
31 #include "CanvasRenderingContext.h" 31 #include "CanvasRenderingContext.h"
32 #include "CSSPropertyNames.h" 32 #include "CSSPropertyNames.h"
33 #include "CachedImage.h" 33 #include "CachedImage.h"
34 #include "Chrome.h" 34 #include "Chrome.h"
35 #include "FontCache.h" 35 #include "FontCache.h"
36 #include "FrameView.h" 36 #include "FrameView.h"
37 #include "GraphicsContext.h" 37 #include "GraphicsContext.h"
38 #include "GraphicsLayer.h" 38 #include "GraphicsLayer.h"
39 #include "GraphicsLayerChromium.h"
39 #include "HTMLCanvasElement.h" 40 #include "HTMLCanvasElement.h"
40 #include "HTMLIFrameElement.h" 41 #include "HTMLIFrameElement.h"
41 #include "HTMLMediaElement.h" 42 #include "HTMLMediaElement.h"
42 #include "HTMLNames.h" 43 #include "HTMLNames.h"
43 #include "InspectorInstrumentation.h" 44 #include "InspectorInstrumentation.h"
44 #include "KeyframeList.h" 45 #include "KeyframeList.h"
45 #include "PluginViewBase.h" 46 #include "PluginViewBase.h"
46 #include "RenderApplet.h" 47 #include "RenderApplet.h"
47 #include "RenderIFrame.h" 48 #include "RenderIFrame.h"
48 #include "RenderImage.h" 49 #include "RenderImage.h"
49 #include "RenderLayerCompositor.h" 50 #include "RenderLayerCompositor.h"
50 #include "RenderEmbeddedObject.h" 51 #include "RenderEmbeddedObject.h"
51 #include "RenderVideo.h" 52 #include "RenderVideo.h"
52 #include "RenderView.h" 53 #include "RenderView.h"
53 #include "ScrollingCoordinator.h" 54 #include "ScrollingCoordinator.h"
54 #include "Settings.h" 55 #include "Settings.h"
55 #include "StyleResolver.h" 56 #include "StyleResolver.h"
56 #include "WebCoreMemoryInstrumentation.h" 57 #include "WebCoreMemoryInstrumentation.h"
58 #include <public/WebContentLayer.h>
57 #include <wtf/CurrentTime.h> 59 #include <wtf/CurrentTime.h>
58 #include <wtf/text/StringBuilder.h> 60 #include <wtf/text/StringBuilder.h>
59 61
60 #include "FilterEffectRenderer.h" 62 #include "FilterEffectRenderer.h"
61 #include "CustomFilterOperation.h" 63 #include "CustomFilterOperation.h"
62 64
63 #include "GraphicsContext3D.h" 65 #include "GraphicsContext3D.h"
64 66
65 using namespace std; 67 using namespace std;
66 68
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 void RenderLayerBacking::createPrimaryGraphicsLayer() 189 void RenderLayerBacking::createPrimaryGraphicsLayer()
188 { 190 {
189 String layerName; 191 String layerName;
190 #ifndef NDEBUG 192 #ifndef NDEBUG
191 layerName = m_owningLayer->debugName(); 193 layerName = m_owningLayer->debugName();
192 #endif 194 #endif
193 195
194 m_graphicsLayer = createGraphicsLayer(layerName); 196 m_graphicsLayer = createGraphicsLayer(layerName);
195 197
196 if (m_isMainFrameRenderViewLayer) { 198 if (m_isMainFrameRenderViewLayer) {
197 m_graphicsLayer->setContentsOpaque(true); 199 m_graphicsLayer->setContentsOpaque(true);
trchen 2013/04/24 21:16:51 Here, look at me.
198 m_graphicsLayer->setAppliesPageScale(); 200 m_graphicsLayer->setAppliesPageScale();
201
202 WebKit::WebContentLayer* layer = static_cast<WebCore::GraphicsLayerChrom ium*>(m_graphicsLayer.get())->contentLayer();
jamesr 2013/04/24 03:16:35 we need to fold GraphicsLayerChromium into Graphic
203 #if !OS(ANDROID)
204 layer->setDrawCheckerboardForMissingTiles(true);
205 #endif
206
207 // FIXME: Remove LCD text setting after it is implemented in chromium.
enne (OOO) 2013/04/24 14:00:24 I suspect but am not positive that this could be r
trchen 2013/04/24 21:16:51 I'm positive. Just found that setUseLCDText is an
208 layer->setUseLCDText(true);
199 } 209 }
200 210
201 updateOpacity(renderer()->style()); 211 updateOpacity(renderer()->style());
202 updateTransform(renderer()->style()); 212 updateTransform(renderer()->style());
203 updateFilters(renderer()->style()); 213 updateFilters(renderer()->style());
204 #if ENABLE(CSS_COMPOSITING) 214 #if ENABLE(CSS_COMPOSITING)
205 updateLayerBlendMode(renderer()->style()); 215 updateLayerBlendMode(renderer()->style());
206 #endif 216 #endif
207 } 217 }
208 218
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 377
368 if (flags & IsUpdateRoot) { 378 if (flags & IsUpdateRoot) {
369 updateGraphicsLayerGeometry(); 379 updateGraphicsLayerGeometry();
370 layerCompositor->updateRootLayerPosition(); 380 layerCompositor->updateRootLayerPosition();
371 RenderLayer* stackingContainer = m_owningLayer->enclosingStackingCon tainer(); 381 RenderLayer* stackingContainer = m_owningLayer->enclosingStackingCon tainer();
372 if (!layerCompositor->compositingLayersNeedRebuild() && stackingCont ainer && (stackingContainer != m_owningLayer)) 382 if (!layerCompositor->compositingLayersNeedRebuild() && stackingCont ainer && (stackingContainer != m_owningLayer))
373 layerCompositor->updateCompositingDescendantGeometry(stackingCon tainer, stackingContainer, flags & CompositingChildrenOnly); 383 layerCompositor->updateCompositingDescendantGeometry(stackingCon tainer, stackingContainer, flags & CompositingChildrenOnly);
374 } 384 }
375 } 385 }
376 386
377 if (flags & NeedsFullRepaint && !paintsIntoWindow() && !paintsIntoComposited Ancestor()) 387 if (flags & NeedsFullRepaint && !paintsIntoCompositedAncestor())
378 setContentsNeedDisplay(); 388 setContentsNeedDisplay();
379 } 389 }
380 390
381 bool RenderLayerBacking::updateGraphicsLayerConfiguration() 391 bool RenderLayerBacking::updateGraphicsLayerConfiguration()
382 { 392 {
383 RenderLayerCompositor* compositor = this->compositor(); 393 RenderLayerCompositor* compositor = this->compositor();
384 RenderObject* renderer = this->renderer(); 394 RenderObject* renderer = this->renderer();
385 395
386 m_owningLayer->updateDescendantDependentFlags(); 396 m_owningLayer->updateDescendantDependentFlags();
387 m_owningLayer->updateZOrderLists(); 397 m_owningLayer->updateZOrderLists();
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 } 1335 }
1326 1336
1327 // Conservative test for having no rendered children. 1337 // Conservative test for having no rendered children.
1328 bool RenderLayerBacking::hasVisibleNonCompositingDescendantLayers() const 1338 bool RenderLayerBacking::hasVisibleNonCompositingDescendantLayers() const
1329 { 1339 {
1330 return hasVisibleNonCompositingDescendant(m_owningLayer); 1340 return hasVisibleNonCompositingDescendant(m_owningLayer);
1331 } 1341 }
1332 1342
1333 bool RenderLayerBacking::containsPaintedContent() const 1343 bool RenderLayerBacking::containsPaintedContent() const
1334 { 1344 {
1335 if (isSimpleContainerCompositingLayer() || paintsIntoWindow() || paintsIntoC ompositedAncestor() || m_artificiallyInflatedBounds || m_owningLayer->isReflecti on()) 1345 if (isSimpleContainerCompositingLayer() || paintsIntoCompositedAncestor() || m_artificiallyInflatedBounds || m_owningLayer->isReflection())
1336 return false; 1346 return false;
1337 1347
1338 if (isDirectlyCompositedImage()) 1348 if (isDirectlyCompositedImage())
1339 return false; 1349 return false;
1340 1350
1341 // FIXME: we could optimize cases where the image, video or canvas is known to fill the border box entirely, 1351 // FIXME: we could optimize cases where the image, video or canvas is known to fill the border box entirely,
1342 // and set background color on the layer in that case, instead of allocating backing store and painting. 1352 // and set background color on the layer in that case, instead of allocating backing store and painting.
1343 #if ENABLE(VIDEO) 1353 #if ENABLE(VIDEO)
1344 if (renderer()->isVideo() && toRenderVideo(renderer())->shouldDisplayVideo() ) 1354 if (renderer()->isVideo() && toRenderVideo(renderer())->shouldDisplayVideo() )
1345 return m_owningLayer->hasBoxDecorationsOrBackground(); 1355 return m_owningLayer->hasBoxDecorationsOrBackground();
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
1511 { 1521 {
1512 if (m_ancestorClippingLayer) 1522 if (m_ancestorClippingLayer)
1513 return m_ancestorClippingLayer.get(); 1523 return m_ancestorClippingLayer.get();
1514 1524
1515 if (m_contentsContainmentLayer) 1525 if (m_contentsContainmentLayer)
1516 return m_contentsContainmentLayer.get(); 1526 return m_contentsContainmentLayer.get();
1517 1527
1518 return m_graphicsLayer.get(); 1528 return m_graphicsLayer.get();
1519 } 1529 }
1520 1530
1521 bool RenderLayerBacking::paintsIntoWindow() const
1522 {
1523 if (m_owningLayer->isRootLayer()) {
1524 return compositor()->rootLayerAttachment() != RenderLayerCompositor::Roo tLayerAttachedViaEnclosingFrame;
1525 }
1526
1527 return false;
1528 }
1529
1530 void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking) 1531 void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking)
1531 { 1532 {
1532 if (requiresOwnBacking == m_requiresOwnBackingStore) 1533 if (requiresOwnBacking == m_requiresOwnBackingStore)
1533 return; 1534 return;
1534 1535
1535 m_requiresOwnBackingStore = requiresOwnBacking; 1536 m_requiresOwnBackingStore = requiresOwnBacking;
1536 1537
1537 // This affects the answer to paintsIntoCompositedAncestor(), which in turn affects 1538 // This affects the answer to paintsIntoCompositedAncestor(), which in turn affects
1538 // cached clip rects, so when it changes we have to clear clip rects on desc endants. 1539 // cached clip rects, so when it changes we have to clear clip rects on desc endants.
1539 m_owningLayer->clearClipRectsIncludingDescendants(PaintingClipRects); 1540 m_owningLayer->clearClipRectsIncludingDescendants(PaintingClipRects);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
1602 IntRect layerDirtyRect = r; 1603 IntRect layerDirtyRect = r;
1603 layerDirtyRect.move(-m_scrollingContentsLayer->offsetFromRenderer()); 1604 layerDirtyRect.move(-m_scrollingContentsLayer->offsetFromRenderer());
1604 m_scrollingContentsLayer->setNeedsDisplayInRect(layerDirtyRect); 1605 m_scrollingContentsLayer->setNeedsDisplayInRect(layerDirtyRect);
1605 } 1606 }
1606 } 1607 }
1607 1608
1608 void RenderLayerBacking::paintIntoLayer(const GraphicsLayer* graphicsLayer, Grap hicsContext* context, 1609 void RenderLayerBacking::paintIntoLayer(const GraphicsLayer* graphicsLayer, Grap hicsContext* context,
1609 const IntRect& paintDirtyRect, // In the coords of rootLayer . 1610 const IntRect& paintDirtyRect, // In the coords of rootLayer .
1610 PaintBehavior paintBehavior, GraphicsLayerPaintingPhase pain tingPhase) 1611 PaintBehavior paintBehavior, GraphicsLayerPaintingPhase pain tingPhase)
1611 { 1612 {
1612 if (paintsIntoWindow() || paintsIntoCompositedAncestor()) { 1613 if (paintsIntoCompositedAncestor()) {
1613 ASSERT_NOT_REACHED(); 1614 ASSERT_NOT_REACHED();
1614 return; 1615 return;
1615 } 1616 }
1616 1617
1617 FontCachePurgePreventer fontCachePurgePreventer; 1618 FontCachePurgePreventer fontCachePurgePreventer;
1618 1619
1619 RenderLayer::PaintLayerFlags paintFlags = 0; 1620 RenderLayer::PaintLayerFlags paintFlags = 0;
1620 if (paintingPhase & GraphicsLayerPaintBackground) 1621 if (paintingPhase & GraphicsLayerPaintBackground)
1621 paintFlags |= RenderLayer::PaintLayerPaintingCompositingBackgroundPhase; 1622 paintFlags |= RenderLayer::PaintLayerPaintingCompositingBackgroundPhase;
1622 if (paintingPhase & GraphicsLayerPaintForeground) 1623 if (paintingPhase & GraphicsLayerPaintForeground)
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
1988 info.addMember(m_childContainmentLayer, "childContainmentLayer"); 1989 info.addMember(m_childContainmentLayer, "childContainmentLayer");
1989 info.addMember(m_maskLayer, "maskLayer"); 1990 info.addMember(m_maskLayer, "maskLayer");
1990 info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar") ; 1991 info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar") ;
1991 info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar"); 1992 info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar");
1992 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); 1993 info.addMember(m_layerForScrollCorner, "layerForScrollCorner");
1993 info.addMember(m_scrollingLayer, "scrollingLayer"); 1994 info.addMember(m_scrollingLayer, "scrollingLayer");
1994 info.addMember(m_scrollingContentsLayer, "scrollingContentsLayer"); 1995 info.addMember(m_scrollingContentsLayer, "scrollingContentsLayer");
1995 } 1996 }
1996 1997
1997 } // namespace WebCore 1998 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698