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

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

Issue 1246173002: Throttle rendering pipeline for invisible iframes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Keep animation time consistent. Created 5 years, 3 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) 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 1858 matching lines...) Expand 10 before | Expand all | Expand 10 after
1869 mainFrameImpl()->frame()->eventHandler().handleGestureScrollEnd(endS crollEvent); 1869 mainFrameImpl()->frame()->eventHandler().handleGestureScrollEnd(endS crollEvent);
1870 } 1870 }
1871 } 1871 }
1872 1872
1873 if (!m_page) 1873 if (!m_page)
1874 return; 1874 return;
1875 1875
1876 // FIXME: This should probably be using the local root? 1876 // FIXME: This should probably be using the local root?
1877 if (m_page->mainFrame()->isLocalFrame()) 1877 if (m_page->mainFrame()->isLocalFrame())
1878 PageWidgetDelegate::animate(*m_page, validFrameTime.lastFrameTimeMonoton ic, *m_page->deprecatedLocalMainFrame()); 1878 PageWidgetDelegate::animate(*m_page, validFrameTime.lastFrameTimeMonoton ic, *m_page->deprecatedLocalMainFrame());
1879
1880 // HACK: simulate the commit signal for layout tests
1881 //Platform::current()->mainThread()->postTask(FROM_HERE, bind(&WebViewImpl:: didCommitCompositorFrame, this));
1879 } 1882 }
1880 1883
1881 void WebViewImpl::layout() 1884 void WebViewImpl::layout()
1882 { 1885 {
1883 TRACE_EVENT0("blink", "WebViewImpl::layout"); 1886 TRACE_EVENT0("blink", "WebViewImpl::layout");
1884 if (!mainFrameImpl()) 1887 if (!mainFrameImpl())
1885 return; 1888 return;
1886 1889
1887 PageWidgetDelegate::layout(*m_page, *mainFrameImpl()->frame()); 1890 PageWidgetDelegate::layout(*m_page, *mainFrameImpl()->frame());
1888 updateLayerTreeBackgroundColor(); 1891 updateLayerTreeBackgroundColor();
(...skipping 26 matching lines...) Expand all
1915 ASSERT(!isAcceleratedCompositingActive()); 1918 ASSERT(!isAcceleratedCompositingActive());
1916 1919
1917 double paintStart = currentTime(); 1920 double paintStart = currentTime();
1918 PageWidgetDelegate::paint(*m_page, canvas, rect, *m_page->deprecatedLocalMai nFrame()); 1921 PageWidgetDelegate::paint(*m_page, canvas, rect, *m_page->deprecatedLocalMai nFrame());
1919 double paintEnd = currentTime(); 1922 double paintEnd = currentTime();
1920 double pixelsPerSec = (rect.width * rect.height) / (paintEnd - paintStart); 1923 double pixelsPerSec = (rect.width * rect.height) / (paintEnd - paintStart);
1921 Platform::current()->histogramCustomCounts("Renderer4.SoftwarePaintDurationM S", (paintEnd - paintStart) * 1000, 0, 120, 30); 1924 Platform::current()->histogramCustomCounts("Renderer4.SoftwarePaintDurationM S", (paintEnd - paintStart) * 1000, 0, 120, 30);
1922 Platform::current()->histogramCustomCounts("Renderer4.SoftwarePaintMegapixPe rSecond", pixelsPerSec / 1000000, 10, 210, 30); 1925 Platform::current()->histogramCustomCounts("Renderer4.SoftwarePaintMegapixPe rSecond", pixelsPerSec / 1000000, 10, 210, 30);
1923 } 1926 }
1924 1927
1928 void WebViewImpl::didCommitCompositorFrame()
1929 {
1930 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
1931 return;
1932 FrameView* view = mainFrameImpl()->frameView();
1933 view->updateThrottling();
1934 }
1935
1925 #if OS(ANDROID) 1936 #if OS(ANDROID)
1926 void WebViewImpl::paintCompositedDeprecated(WebCanvas* canvas, const WebRect& re ct) 1937 void WebViewImpl::paintCompositedDeprecated(WebCanvas* canvas, const WebRect& re ct)
1927 { 1938 {
1928 // Note: This method exists on OS(ANDROID) and will hopefully be 1939 // Note: This method exists on OS(ANDROID) and will hopefully be
1929 // removed once the link disambiguation feature renders using 1940 // removed once the link disambiguation feature renders using
1930 // the compositor. 1941 // the compositor.
1931 ASSERT(isAcceleratedCompositingActive()); 1942 ASSERT(isAcceleratedCompositingActive());
1932 1943
1933 PageWidgetDelegate::paintIgnoringCompositing(*m_page, canvas, rect, *m_page- >deprecatedLocalMainFrame()); 1944 PageWidgetDelegate::paintIgnoringCompositing(*m_page, canvas, rect, *m_page- >deprecatedLocalMainFrame());
1934 } 1945 }
(...skipping 2474 matching lines...) Expand 10 before | Expand all | Expand 10 after
4409 if (m_pageColorOverlay) 4420 if (m_pageColorOverlay)
4410 m_pageColorOverlay->update(); 4421 m_pageColorOverlay->update();
4411 if (InspectorOverlayImpl* overlay = inspectorOverlay()) { 4422 if (InspectorOverlayImpl* overlay = inspectorOverlay()) {
4412 PageOverlay* inspectorPageOverlay = overlay->pageOverlay(); 4423 PageOverlay* inspectorPageOverlay = overlay->pageOverlay();
4413 if (inspectorPageOverlay) 4424 if (inspectorPageOverlay)
4414 inspectorPageOverlay->update(); 4425 inspectorPageOverlay->update();
4415 } 4426 }
4416 } 4427 }
4417 4428
4418 } // namespace blink 4429 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698