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

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 362403003: Prevent spinning up a layer tree view after closing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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/web/WebViewImpl.h ('k') | no next file » | 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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 , m_dragOperation(WebDragOperationNone) 379 , m_dragOperation(WebDragOperationNone)
380 , m_isTransparent(false) 380 , m_isTransparent(false)
381 , m_tabsToLinks(false) 381 , m_tabsToLinks(false)
382 , m_layerTreeView(0) 382 , m_layerTreeView(0)
383 , m_rootLayer(0) 383 , m_rootLayer(0)
384 , m_rootGraphicsLayer(0) 384 , m_rootGraphicsLayer(0)
385 , m_rootTransformLayer(0) 385 , m_rootTransformLayer(0)
386 , m_graphicsLayerFactory(adoptPtr(new GraphicsLayerFactoryChromium(this))) 386 , m_graphicsLayerFactory(adoptPtr(new GraphicsLayerFactoryChromium(this)))
387 , m_isAcceleratedCompositingActive(false) 387 , m_isAcceleratedCompositingActive(false)
388 , m_layerTreeViewCommitsDeferred(false) 388 , m_layerTreeViewCommitsDeferred(false)
389 , m_layerTreeViewClosed(false)
389 , m_matchesHeuristicsForGpuRasterization(false) 390 , m_matchesHeuristicsForGpuRasterization(false)
390 , m_recreatingGraphicsContext(false) 391 , m_recreatingGraphicsContext(false)
391 , m_flingModifier(0) 392 , m_flingModifier(0)
392 , m_flingSourceDevice(false) 393 , m_flingSourceDevice(false)
393 , m_fullscreenController(FullscreenController::create(this)) 394 , m_fullscreenController(FullscreenController::create(this))
394 , m_showFPSCounter(false) 395 , m_showFPSCounter(false)
395 , m_showPaintRects(false) 396 , m_showPaintRects(false)
396 , m_showDebugBorders(false) 397 , m_showDebugBorders(false)
397 , m_continuousPaintingEnabled(false) 398 , m_continuousPaintingEnabled(false)
398 , m_showScrollBottleneckRects(false) 399 , m_showScrollBottleneckRects(false)
(...skipping 2028 matching lines...) Expand 10 before | Expand all | Expand 10 after
2427 2428
2428 bool WebViewImpl::isAcceleratedCompositingActive() const 2429 bool WebViewImpl::isAcceleratedCompositingActive() const
2429 { 2430 {
2430 return m_isAcceleratedCompositingActive; 2431 return m_isAcceleratedCompositingActive;
2431 } 2432 }
2432 2433
2433 void WebViewImpl::willCloseLayerTreeView() 2434 void WebViewImpl::willCloseLayerTreeView()
2434 { 2435 {
2435 setIsAcceleratedCompositingActive(false); 2436 setIsAcceleratedCompositingActive(false);
2436 m_layerTreeView = 0; 2437 m_layerTreeView = 0;
2438 m_layerTreeViewClosed = true;
2437 } 2439 }
2438 2440
2439 void WebViewImpl::didAcquirePointerLock() 2441 void WebViewImpl::didAcquirePointerLock()
2440 { 2442 {
2441 if (page()) 2443 if (page())
2442 page()->pointerLockController().didAcquirePointerLock(); 2444 page()->pointerLockController().didAcquirePointerLock();
2443 } 2445 }
2444 2446
2445 void WebViewImpl::didNotAcquirePointerLock() 2447 void WebViewImpl::didNotAcquirePointerLock()
2446 { 2448 {
(...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after
3900 void WebViewImpl::setIsAcceleratedCompositingActive(bool active) 3902 void WebViewImpl::setIsAcceleratedCompositingActive(bool active)
3901 { 3903 {
3902 blink::Platform::current()->histogramEnumeration("GPU.setIsAcceleratedCompos itingActive", active * 2 + m_isAcceleratedCompositingActive, 4); 3904 blink::Platform::current()->histogramEnumeration("GPU.setIsAcceleratedCompos itingActive", active * 2 + m_isAcceleratedCompositingActive, 4);
3903 3905
3904 if (m_isAcceleratedCompositingActive == active) 3906 if (m_isAcceleratedCompositingActive == active)
3905 return; 3907 return;
3906 3908
3907 if (!m_client) 3909 if (!m_client)
3908 return; 3910 return;
3909 3911
3912 // In the middle of shutting down; don't try to spin back up a compositor.
3913 if (m_layerTreeViewClosed)
3914 return;
3915
3910 if (!active) { 3916 if (!active) {
3911 m_isAcceleratedCompositingActive = false; 3917 m_isAcceleratedCompositingActive = false;
3912 if (!m_layerTreeViewCommitsDeferred 3918 if (!m_layerTreeViewCommitsDeferred
3913 && blink::Platform::current()->isThreadedCompositingEnabled()) { 3919 && blink::Platform::current()->isThreadedCompositingEnabled()) {
3914 ASSERT(m_layerTreeView); 3920 ASSERT(m_layerTreeView);
3915 // In threaded compositing mode, force compositing mode is always on so setIsAcceleratedCompositingActive(false) 3921 // In threaded compositing mode, force compositing mode is always on so setIsAcceleratedCompositingActive(false)
3916 // means that we're transitioning to a new page. Suppress commits un til WebKit generates invalidations so 3922 // means that we're transitioning to a new page. Suppress commits un til WebKit generates invalidations so
3917 // we don't attempt to paint too early in the next page load. 3923 // we don't attempt to paint too early in the next page load.
3918 m_layerTreeView->setDeferCommits(true); 3924 m_layerTreeView->setDeferCommits(true);
3919 m_layerTreeViewCommitsDeferred = true; 3925 m_layerTreeViewCommitsDeferred = true;
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
4159 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4165 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4160 4166
4161 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4167 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4162 return false; 4168 return false;
4163 4169
4164 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4170 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4165 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4171 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4166 } 4172 }
4167 4173
4168 } // namespace blink 4174 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698