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

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

Issue 15820002: Page::chrome() should return a reference. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase 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
« no previous file with comments | « Source/core/rendering/RenderLayerBacking.cpp ('k') | Source/core/rendering/RenderMenuList.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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 bool showRepaintCounter = false; 255 bool showRepaintCounter = false;
256 bool forceCompositingMode = false; 256 bool forceCompositingMode = false;
257 257
258 if (Settings* settings = m_renderView->document()->settings()) { 258 if (Settings* settings = m_renderView->document()->settings()) {
259 hasAcceleratedCompositing = settings->acceleratedCompositingEnabled(); 259 hasAcceleratedCompositing = settings->acceleratedCompositingEnabled();
260 260
261 // We allow the chrome to override the settings, in case the page is ren dered 261 // We allow the chrome to override the settings, in case the page is ren dered
262 // on a chrome that doesn't allow accelerated compositing. 262 // on a chrome that doesn't allow accelerated compositing.
263 if (hasAcceleratedCompositing) { 263 if (hasAcceleratedCompositing) {
264 if (Page* page = this->page()) { 264 if (Page* page = this->page()) {
265 ChromeClient* chromeClient = page->chrome()->client(); 265 ChromeClient* chromeClient = page->chrome().client();
266 m_compositingTriggers = chromeClient->allowedCompositingTriggers (); 266 m_compositingTriggers = chromeClient->allowedCompositingTriggers ();
267 hasAcceleratedCompositing = m_compositingTriggers; 267 hasAcceleratedCompositing = m_compositingTriggers;
268 } 268 }
269 } 269 }
270 270
271 showDebugBorders = settings->showDebugBorders(); 271 showDebugBorders = settings->showDebugBorders();
272 showRepaintCounter = settings->showRepaintCounter(); 272 showRepaintCounter = settings->showRepaintCounter();
273 forceCompositingMode = settings->forceCompositingMode() && hasAccelerate dCompositing; 273 forceCompositingMode = settings->forceCompositingMode() && hasAccelerate dCompositing;
274 274
275 if (forceCompositingMode && !isMainFrame()) 275 if (forceCompositingMode && !isMainFrame())
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 if (!rootLayer) 314 if (!rootLayer)
315 return; 315 return;
316 316
317 FrameView* frameView = m_renderView ? m_renderView->frameView() : 0; 317 FrameView* frameView = m_renderView ? m_renderView->frameView() : 0;
318 if (!frameView) 318 if (!frameView)
319 return; 319 return;
320 320
321 IntRect visibleRect = m_clipLayer ? IntRect(IntPoint(), frameView->contentsS ize()) : frameView->visibleContentRect(); 321 IntRect visibleRect = m_clipLayer ? IntRect(IntPoint(), frameView->contentsS ize()) : frameView->visibleContentRect();
322 if (rootLayer->visibleRectChangeRequiresFlush(visibleRect)) { 322 if (rootLayer->visibleRectChangeRequiresFlush(visibleRect)) {
323 if (Page* page = this->page()) 323 if (Page* page = this->page())
324 page->chrome()->client()->scheduleCompositingLayerFlush(); 324 page->chrome().client()->scheduleCompositingLayerFlush();
325 } 325 }
326 } 326 }
327 327
328 bool RenderLayerCompositor::hasAnyAdditionalCompositedLayers(const RenderLayer* rootLayer) const 328 bool RenderLayerCompositor::hasAnyAdditionalCompositedLayers(const RenderLayer* rootLayer) const
329 { 329 {
330 return m_compositedLayerCount > (rootLayer->isComposited() ? 1 : 0); 330 return m_compositedLayerCount > (rootLayer->isComposited() ? 1 : 0);
331 } 331 }
332 332
333 void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update Type, RenderLayer* updateRoot) 333 void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update Type, RenderLayer* updateRoot)
334 { 334 {
(...skipping 2129 matching lines...) Expand 10 before | Expand all | Expand 10 after
2464 switch (attachment) { 2464 switch (attachment) {
2465 case RootLayerUnattached: 2465 case RootLayerUnattached:
2466 ASSERT_NOT_REACHED(); 2466 ASSERT_NOT_REACHED();
2467 break; 2467 break;
2468 case RootLayerAttachedViaChromeClient: { 2468 case RootLayerAttachedViaChromeClient: {
2469 Frame* frame = m_renderView->frameView()->frame(); 2469 Frame* frame = m_renderView->frameView()->frame();
2470 Page* page = frame ? frame->page() : 0; 2470 Page* page = frame ? frame->page() : 0;
2471 if (!page) 2471 if (!page)
2472 return; 2472 return;
2473 2473
2474 page->chrome()->client()->attachRootGraphicsLayer(frame, rootGraphic sLayer()); 2474 page->chrome().client()->attachRootGraphicsLayer(frame, rootGraphics Layer());
2475 break; 2475 break;
2476 } 2476 }
2477 case RootLayerAttachedViaEnclosingFrame: { 2477 case RootLayerAttachedViaEnclosingFrame: {
2478 // The layer will get hooked up via RenderLayerBacking::updateGraphi csLayerConfiguration() 2478 // The layer will get hooked up via RenderLayerBacking::updateGraphi csLayerConfiguration()
2479 // for the frame's renderer in the parent document. 2479 // for the frame's renderer in the parent document.
2480 m_renderView->document()->ownerElement()->scheduleSyntheticStyleChan ge(); 2480 m_renderView->document()->ownerElement()->scheduleSyntheticStyleChan ge();
2481 break; 2481 break;
2482 } 2482 }
2483 } 2483 }
2484 2484
(...skipping 18 matching lines...) Expand all
2503 if (HTMLFrameOwnerElement* ownerElement = m_renderView->document()->owne rElement()) 2503 if (HTMLFrameOwnerElement* ownerElement = m_renderView->document()->owne rElement())
2504 ownerElement->scheduleSyntheticStyleChange(); 2504 ownerElement->scheduleSyntheticStyleChange();
2505 break; 2505 break;
2506 } 2506 }
2507 case RootLayerAttachedViaChromeClient: { 2507 case RootLayerAttachedViaChromeClient: {
2508 Frame* frame = m_renderView->frameView()->frame(); 2508 Frame* frame = m_renderView->frameView()->frame();
2509 Page* page = frame ? frame->page() : 0; 2509 Page* page = frame ? frame->page() : 0;
2510 if (!page) 2510 if (!page)
2511 return; 2511 return;
2512 2512
2513 page->chrome()->client()->attachRootGraphicsLayer(frame, 0); 2513 page->chrome().client()->attachRootGraphicsLayer(frame, 0);
2514 } 2514 }
2515 break; 2515 break;
2516 case RootLayerUnattached: 2516 case RootLayerUnattached:
2517 break; 2517 break;
2518 } 2518 }
2519 2519
2520 m_rootLayerAttachment = RootLayerUnattached; 2520 m_rootLayerAttachment = RootLayerUnattached;
2521 rootLayerAttachmentChanged(); 2521 rootLayerAttachmentChanged();
2522 } 2522 }
2523 2523
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
2707 { 2707 {
2708 if (Page* page = this->page()) 2708 if (Page* page = this->page())
2709 return page->scrollingCoordinator(); 2709 return page->scrollingCoordinator();
2710 2710
2711 return 0; 2711 return 0;
2712 } 2712 }
2713 2713
2714 GraphicsLayerFactory* RenderLayerCompositor::graphicsLayerFactory() const 2714 GraphicsLayerFactory* RenderLayerCompositor::graphicsLayerFactory() const
2715 { 2715 {
2716 if (Page* page = this->page()) 2716 if (Page* page = this->page())
2717 return page->chrome()->client()->graphicsLayerFactory(); 2717 return page->chrome().client()->graphicsLayerFactory();
2718 2718
2719 return 0; 2719 return 0;
2720 } 2720 }
2721 2721
2722 Page* RenderLayerCompositor::page() const 2722 Page* RenderLayerCompositor::page() const
2723 { 2723 {
2724 if (Frame* frame = m_renderView->frameView()->frame()) 2724 if (Frame* frame = m_renderView->frameView()->frame())
2725 return frame->page(); 2725 return frame->page();
2726 2726
2727 return 0; 2727 return 0;
(...skipping 13 matching lines...) Expand all
2741 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); 2741 info.addMember(m_layerForScrollCorner, "layerForScrollCorner");
2742 #if ENABLE(RUBBER_BANDING) 2742 #if ENABLE(RUBBER_BANDING)
2743 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas"); 2743 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas");
2744 info.addMember(m_contentShadowLayer, "contentShadowLayer"); 2744 info.addMember(m_contentShadowLayer, "contentShadowLayer");
2745 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea"); 2745 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea");
2746 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea"); 2746 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea");
2747 #endif 2747 #endif
2748 } 2748 }
2749 2749
2750 } // namespace WebCore 2750 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayerBacking.cpp ('k') | Source/core/rendering/RenderMenuList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698