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

Side by Side Diff: Source/core/rendering/compositing/CompositedLayerMapping.cpp

Issue 310503002: Highlighting on UAOS - alternate approach (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/compositing/CompositedLayerMapping.h ('k') | public/platform/WebLayer.h » ('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, 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 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 void CompositedLayerMapping::updateDrawsContent() 1054 void CompositedLayerMapping::updateDrawsContent()
1055 { 1055 {
1056 if (m_scrollingLayer) { 1056 if (m_scrollingLayer) {
1057 // We don't have to consider overflow controls, because we know that the scrollbars are drawn elsewhere. 1057 // We don't have to consider overflow controls, because we know that the scrollbars are drawn elsewhere.
1058 // m_graphicsLayer only needs backing store if the non-scrolling parts ( background, outlines, borders, shadows etc) need to paint. 1058 // m_graphicsLayer only needs backing store if the non-scrolling parts ( background, outlines, borders, shadows etc) need to paint.
1059 // m_scrollingLayer never has backing store. 1059 // m_scrollingLayer never has backing store.
1060 // m_scrollingContentsLayer only needs backing store if the scrolled con tents need to paint. 1060 // m_scrollingContentsLayer only needs backing store if the scrolled con tents need to paint.
1061 bool hasNonScrollingPaintedContent = m_owningLayer.hasVisibleContent() & & m_owningLayer.hasBoxDecorationsOrBackground(); 1061 bool hasNonScrollingPaintedContent = m_owningLayer.hasVisibleContent() & & m_owningLayer.hasBoxDecorationsOrBackground();
1062 m_graphicsLayer->setDrawsContent(hasNonScrollingPaintedContent); 1062 m_graphicsLayer->setDrawsContent(hasNonScrollingPaintedContent);
1063 1063
1064 bool hasScrollingPaintedContent = m_owningLayer.hasVisibleContent() && ( renderer()->hasBackground() || paintsChildren()); 1064 bool hasScrollingPaintedContent = m_owningLayer.hasVisibleContent() && ( renderer()->hasBackground() || paintsChildren() || hasScrollChildren());
1065 m_scrollingContentsLayer->setDrawsContent(hasScrollingPaintedContent); 1065 m_scrollingContentsLayer->setDrawsContent(hasScrollingPaintedContent);
1066 return; 1066 return;
1067 } 1067 }
1068 1068
1069 bool hasPaintedContent = containsPaintedContent(); 1069 bool hasPaintedContent = containsPaintedContent();
1070 if (hasPaintedContent && isAcceleratedCanvas(renderer())) { 1070 if (hasPaintedContent && isAcceleratedCanvas(renderer())) {
1071 CanvasRenderingContext* context = toHTMLCanvasElement(renderer()->node() )->renderingContext(); 1071 CanvasRenderingContext* context = toHTMLCanvasElement(renderer()->node() )->renderingContext();
1072 // Content layer may be null if context is lost. 1072 // Content layer may be null if context is lost.
1073 if (blink::WebLayer* contentLayer = context->platformLayer()) { 1073 if (blink::WebLayer* contentLayer = context->platformLayer()) {
1074 Color bgColor(Color::transparent); 1074 Color bgColor(Color::transparent);
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
1475 void CompositedLayerMapping::updateScrollParent(RenderLayer* scrollParent) 1475 void CompositedLayerMapping::updateScrollParent(RenderLayer* scrollParent)
1476 { 1476 {
1477 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay er(m_owningLayer)) { 1477 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay er(m_owningLayer)) {
1478 GraphicsLayer* topmostLayer = childForSuperlayers(); 1478 GraphicsLayer* topmostLayer = childForSuperlayers();
1479 updateScrollParentForGraphicsLayer(m_squashingContainmentLayer.get(), to pmostLayer, scrollParent, scrollingCoordinator); 1479 updateScrollParentForGraphicsLayer(m_squashingContainmentLayer.get(), to pmostLayer, scrollParent, scrollingCoordinator);
1480 updateScrollParentForGraphicsLayer(m_ancestorClippingLayer.get(), topmos tLayer, scrollParent, scrollingCoordinator); 1480 updateScrollParentForGraphicsLayer(m_ancestorClippingLayer.get(), topmos tLayer, scrollParent, scrollingCoordinator);
1481 updateScrollParentForGraphicsLayer(m_graphicsLayer.get(), topmostLayer, scrollParent, scrollingCoordinator); 1481 updateScrollParentForGraphicsLayer(m_graphicsLayer.get(), topmostLayer, scrollParent, scrollingCoordinator);
1482 } 1482 }
1483 } 1483 }
1484 1484
1485 bool CompositedLayerMapping::hasScrollChildren()
1486 {
1487 ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLayer(m _owningLayer);
1488 if (!scrollingCoordinator)
1489 return false;
1490 return scrollingCoordinator->hasScrollChildren(parentForSublayers());
1491 }
1492
1485 void CompositedLayerMapping::updateClipParent(RenderLayer* clipParent) 1493 void CompositedLayerMapping::updateClipParent(RenderLayer* clipParent)
1486 { 1494 {
1487 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay er(m_owningLayer)) 1495 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay er(m_owningLayer))
1488 scrollingCoordinator->updateClipParentForGraphicsLayer(m_graphicsLayer.g et(), clipParent); 1496 scrollingCoordinator->updateClipParentForGraphicsLayer(m_graphicsLayer.g et(), clipParent);
1489 } 1497 }
1490 1498
1491 bool CompositedLayerMapping::updateSquashingLayers(bool needsSquashingLayers) 1499 bool CompositedLayerMapping::updateSquashingLayers(bool needsSquashingLayers)
1492 { 1500 {
1493 bool layersChanged = false; 1501 bool layersChanged = false;
1494 1502
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
2246 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 2254 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
2247 name = "Scrolling Contents Layer"; 2255 name = "Scrolling Contents Layer";
2248 } else { 2256 } else {
2249 ASSERT_NOT_REACHED(); 2257 ASSERT_NOT_REACHED();
2250 } 2258 }
2251 2259
2252 return name; 2260 return name;
2253 } 2261 }
2254 2262
2255 } // namespace WebCore 2263 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/compositing/CompositedLayerMapping.h ('k') | public/platform/WebLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698