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

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

Issue 22955006: Chrome::client() should return a ChromeClient reference. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 bool showRepaintCounter = false; 263 bool showRepaintCounter = false;
264 bool forceCompositingMode = false; 264 bool forceCompositingMode = false;
265 265
266 if (Settings* settings = m_renderView->document()->settings()) { 266 if (Settings* settings = m_renderView->document()->settings()) {
267 hasAcceleratedCompositing = settings->acceleratedCompositingEnabled(); 267 hasAcceleratedCompositing = settings->acceleratedCompositingEnabled();
268 268
269 // We allow the chrome to override the settings, in case the page is ren dered 269 // We allow the chrome to override the settings, in case the page is ren dered
270 // on a chrome that doesn't allow accelerated compositing. 270 // on a chrome that doesn't allow accelerated compositing.
271 if (hasAcceleratedCompositing) { 271 if (hasAcceleratedCompositing) {
272 if (Page* page = this->page()) { 272 if (Page* page = this->page()) {
273 ChromeClient* chromeClient = page->chrome().client(); 273 m_compositingTriggers = page->chrome().client().allowedCompositi ngTriggers();
274 m_compositingTriggers = chromeClient->allowedCompositingTriggers ();
275 hasAcceleratedCompositing = m_compositingTriggers; 274 hasAcceleratedCompositing = m_compositingTriggers;
276 } 275 }
277 } 276 }
278 277
279 showRepaintCounter = settings->showRepaintCounter(); 278 showRepaintCounter = settings->showRepaintCounter();
280 forceCompositingMode = settings->forceCompositingMode() && hasAccelerate dCompositing; 279 forceCompositingMode = settings->forceCompositingMode() && hasAccelerate dCompositing;
281 280
282 if (forceCompositingMode && !isMainFrame()) 281 if (forceCompositingMode && !isMainFrame())
283 forceCompositingMode = requiresCompositingForScrollableFrame(); 282 forceCompositingMode = requiresCompositingForScrollableFrame();
284 } 283 }
(...skipping 23 matching lines...) Expand all
308 if (!rootLayer) 307 if (!rootLayer)
309 return; 308 return;
310 309
311 FrameView* frameView = m_renderView ? m_renderView->frameView() : 0; 310 FrameView* frameView = m_renderView ? m_renderView->frameView() : 0;
312 if (!frameView) 311 if (!frameView)
313 return; 312 return;
314 313
315 IntRect visibleRect = m_containerLayer ? IntRect(IntPoint(), frameView->cont entsSize()) : frameView->visibleContentRect(); 314 IntRect visibleRect = m_containerLayer ? IntRect(IntPoint(), frameView->cont entsSize()) : frameView->visibleContentRect();
316 if (rootLayer->visibleRectChangeRequiresFlush(visibleRect)) { 315 if (rootLayer->visibleRectChangeRequiresFlush(visibleRect)) {
317 if (Page* page = this->page()) 316 if (Page* page = this->page())
318 page->chrome().client()->scheduleCompositingLayerFlush(); 317 page->chrome().client().scheduleCompositingLayerFlush();
319 } 318 }
320 } 319 }
321 320
322 bool RenderLayerCompositor::hasAnyAdditionalCompositedLayers(const RenderLayer* rootLayer) const 321 bool RenderLayerCompositor::hasAnyAdditionalCompositedLayers(const RenderLayer* rootLayer) const
323 { 322 {
324 return m_compositedLayerCount > (rootLayer->isComposited() ? 1 : 0); 323 return m_compositedLayerCount > (rootLayer->isComposited() ? 1 : 0);
325 } 324 }
326 325
327 void RenderLayerCompositor::updateCompositingRequirementsState() 326 void RenderLayerCompositor::updateCompositingRequirementsState()
328 { 327 {
(...skipping 2033 matching lines...) Expand 10 before | Expand all | Expand 10 after
2362 2361
2363 switch (attachment) { 2362 switch (attachment) {
2364 case RootLayerUnattached: 2363 case RootLayerUnattached:
2365 ASSERT_NOT_REACHED(); 2364 ASSERT_NOT_REACHED();
2366 break; 2365 break;
2367 case RootLayerAttachedViaChromeClient: { 2366 case RootLayerAttachedViaChromeClient: {
2368 Frame* frame = m_renderView->frameView()->frame(); 2367 Frame* frame = m_renderView->frameView()->frame();
2369 Page* page = frame ? frame->page() : 0; 2368 Page* page = frame ? frame->page() : 0;
2370 if (!page) 2369 if (!page)
2371 return; 2370 return;
2372 2371 page->chrome().client().attachRootGraphicsLayer(frame, rootGraphicsL ayer());
2373 page->chrome().client()->attachRootGraphicsLayer(frame, rootGraphics Layer());
2374 break; 2372 break;
2375 } 2373 }
2376 case RootLayerAttachedViaEnclosingFrame: { 2374 case RootLayerAttachedViaEnclosingFrame: {
2377 // The layer will get hooked up via RenderLayerBacking::updateGraphi csLayerConfiguration() 2375 // The layer will get hooked up via RenderLayerBacking::updateGraphi csLayerConfiguration()
2378 // for the frame's renderer in the parent document. 2376 // for the frame's renderer in the parent document.
2379 m_renderView->document()->ownerElement()->scheduleLayerUpdate(); 2377 m_renderView->document()->ownerElement()->scheduleLayerUpdate();
2380 break; 2378 break;
2381 } 2379 }
2382 } 2380 }
2383 2381
(...skipping 16 matching lines...) Expand all
2400 2398
2401 if (HTMLFrameOwnerElement* ownerElement = m_renderView->document()->owne rElement()) 2399 if (HTMLFrameOwnerElement* ownerElement = m_renderView->document()->owne rElement())
2402 ownerElement->scheduleLayerUpdate(); 2400 ownerElement->scheduleLayerUpdate();
2403 break; 2401 break;
2404 } 2402 }
2405 case RootLayerAttachedViaChromeClient: { 2403 case RootLayerAttachedViaChromeClient: {
2406 Frame* frame = m_renderView->frameView()->frame(); 2404 Frame* frame = m_renderView->frameView()->frame();
2407 Page* page = frame ? frame->page() : 0; 2405 Page* page = frame ? frame->page() : 0;
2408 if (!page) 2406 if (!page)
2409 return; 2407 return;
2410 2408 page->chrome().client().attachRootGraphicsLayer(frame, 0);
2411 page->chrome().client()->attachRootGraphicsLayer(frame, 0);
2412 } 2409 }
2413 break; 2410 break;
2414 case RootLayerUnattached: 2411 case RootLayerUnattached:
2415 break; 2412 break;
2416 } 2413 }
2417 2414
2418 m_rootLayerAttachment = RootLayerUnattached; 2415 m_rootLayerAttachment = RootLayerUnattached;
2419 } 2416 }
2420 2417
2421 void RenderLayerCompositor::updateRootLayerAttachment() 2418 void RenderLayerCompositor::updateRootLayerAttachment()
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
2595 { 2592 {
2596 if (Page* page = this->page()) 2593 if (Page* page = this->page())
2597 return page->scrollingCoordinator(); 2594 return page->scrollingCoordinator();
2598 2595
2599 return 0; 2596 return 0;
2600 } 2597 }
2601 2598
2602 GraphicsLayerFactory* RenderLayerCompositor::graphicsLayerFactory() const 2599 GraphicsLayerFactory* RenderLayerCompositor::graphicsLayerFactory() const
2603 { 2600 {
2604 if (Page* page = this->page()) 2601 if (Page* page = this->page())
2605 return page->chrome().client()->graphicsLayerFactory(); 2602 return page->chrome().client().graphicsLayerFactory();
2606
2607 return 0; 2603 return 0;
2608 } 2604 }
2609 2605
2610 Page* RenderLayerCompositor::page() const 2606 Page* RenderLayerCompositor::page() const
2611 { 2607 {
2612 if (Frame* frame = m_renderView->frameView()->frame()) 2608 if (Frame* frame = m_renderView->frameView()->frame())
2613 return frame->page(); 2609 return frame->page();
2614 2610
2615 return 0; 2611 return 0;
2616 } 2612 }
(...skipping 20 matching lines...) Expand all
2637 } else if (graphicsLayer == m_scrollLayer.get()) { 2633 } else if (graphicsLayer == m_scrollLayer.get()) {
2638 name = "Frame Scrolling Layer"; 2634 name = "Frame Scrolling Layer";
2639 } else { 2635 } else {
2640 ASSERT_NOT_REACHED(); 2636 ASSERT_NOT_REACHED();
2641 } 2637 }
2642 2638
2643 return name; 2639 return name;
2644 } 2640 }
2645 2641
2646 } // namespace WebCore 2642 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayerBacking.cpp ('k') | Source/core/rendering/svg/RenderSVGRoot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698