https://bugs.webkit.org/show_bug.cgi?id=71040
Patch by Iain Merrick <husky@google.com> on 2011-11-16
Reviewed by Tony Gentilcore.
Source/WebCore:
* platform/PlatformScreen.h:
* platform/chromium/PlatformScreenChromium.cpp:
(WebCore::screenRefreshRate):
* platform/chromium/PlatformSupport.h:
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(WebCore::CCSettings::CCSettings):
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::initializeImplOnImplThread):
Source/WebKit/chromium:
* public/WebScreenInfo.h:
(WebKit::WebScreenInfo::WebScreenInfo):
* src/PlatformSupport.cpp:
(WebCore::PlatformSupport::screenRefreshRate):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@100438
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-11-16 Iain Merrick <husky@google.com>
+
+ [chromium] Pass screen refresh rate into compositor.
+ https://bugs.webkit.org/show_bug.cgi?id=71040
+
+ Reviewed by Tony Gentilcore.
+
+ * platform/PlatformScreen.h:
+ * platform/chromium/PlatformScreenChromium.cpp:
+ (WebCore::screenRefreshRate):
+ * platform/chromium/PlatformSupport.h:
+ * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+ (WebCore::CCSettings::CCSettings):
+ * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+ (WebCore::CCThreadProxy::initializeImplOnImplThread):
+
2011-11-15 Andrey Kosyakov <caseq@chromium.org>
Web Inspector: [Extensions API] drop ExtensionSidebarPane.onUpdated, use callbacks instead
FloatRect screenRect(Widget*);
FloatRect screenAvailableRect(Widget*);
+#if PLATFORM(CHROMIUM)
+ // Measured in frames per second. 0 if the refresh rate is unknown, or not applicable.
+ double screenRefreshRate(Widget*);
+#endif
+
#if PLATFORM(MAC)
NSScreen *screenForWindow(NSWindow *);
return PlatformSupport::screenAvailableRect(widget);
}
+double screenRefreshRate(Widget* widget)
+{
+ return PlatformSupport::screenRefreshRate(widget);
+}
+
} // namespace WebCore
static bool screenIsMonochrome(Widget*);
static IntRect screenRect(Widget*);
static IntRect screenAvailableRect(Widget*);
+ static double screenRefreshRate(Widget*);
// SharedTimers -------------------------------------------------------
static void setSharedTimerFiredFunction(void (*func)());
, compositeOffscreen(false)
, enableCompositorThread(false)
, showFPSCounter(false)
- , showPlatformLayerTree(false) { }
+ , showPlatformLayerTree(false)
+ , refreshRate(0) { }
bool acceleratePainting;
bool compositeOffscreen;
bool enableCompositorThread;
bool showFPSCounter;
bool showPlatformLayerTree;
+ double refreshRate;
};
// Provides information on an Impl's rendering capabilities back to the CCLayerTreeHost
TRACE_EVENT("CCThreadProxy::initializeImplOnImplThread", this, 0);
ASSERT(isImplThread());
m_layerTreeHostImpl = m_layerTreeHost->createLayerTreeHostImpl(this);
- const double displayRefreshIntervalMs = 1000.0 / 60.0;
+ ASSERT(m_layerTreeHostImpl->settings().refreshRate > 0);
+ const double displayRefreshIntervalMs = 1000.0 / m_layerTreeHostImpl->settings().refreshRate;
OwnPtr<CCFrameRateController> frameRateController = adoptPtr(new CCFrameRateController(CCDelayBasedTimeSource::create(displayRefreshIntervalMs, CCProxy::implThread())));
m_schedulerOnImplThread = CCScheduler::create(this, frameRateController.release());
m_schedulerOnImplThread->setVisible(m_layerTreeHostImpl->visible());
+2011-11-16 Iain Merrick <husky@google.com>
+
+ [chromium] Pass screen refresh rate into compositor.
+ https://bugs.webkit.org/show_bug.cgi?id=71040
+
+ Reviewed by Tony Gentilcore.
+
+ * public/WebScreenInfo.h:
+ (WebKit::WebScreenInfo::WebScreenInfo):
+ * src/PlatformSupport.cpp:
+ (WebCore::PlatformSupport::screenRefreshRate):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
+
2011-11-15 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r100340.
// some of the rectangle's coordinates may be negative values".
WebRect availableRect;
+ // Measured in frames per second. 0 if the rate is unknown or not applicable.
+ double refreshRate;
+
WebScreenInfo()
: depth(0)
, depthPerComponent(0)
- , isMonochrome(false) { }
+ , isMonochrome(false)
+ , refreshRate(0) { }
};
} // namespace WebKit
return client->screenInfo().availableRect;
}
+double PlatformSupport::screenRefreshRate(Widget* widget)
+{
+ WebWidgetClient* client = toWebWidgetClient(widget);
+ if (!client)
+ return 0;
+ return client->screenInfo().refreshRate;
+}
+
bool PlatformSupport::popupsAllowed(NPP npp)
{
// FIXME: Give the embedder a way to control this.
#include "PlatformContextSkia.h"
#include "PlatformKeyboardEvent.h"
#include "PlatformMouseEvent.h"
+#include "PlatformScreen.h"
#include "PlatformThemeChromiumLinux.h"
#include "PlatformWheelEvent.h"
#include "PopupContainer.h"
} else {
TRACE_EVENT("WebViewImpl::setIsAcceleratedCompositingActive(true)", this, 0);
+ static const double defaultRefreshRate = 60.0;
+
WebCore::CCSettings ccSettings;
ccSettings.acceleratePainting = page()->settings()->acceleratedDrawingEnabled();
ccSettings.compositeOffscreen = settings()->compositeToTextureEnabled();
ccSettings.enableCompositorThread = settings()->useThreadedCompositor();
ccSettings.showFPSCounter = settings()->showFPSCounter();
ccSettings.showPlatformLayerTree = settings()->showPlatformLayerTree();
+ ccSettings.refreshRate = screenRefreshRate(page()->mainFrame()->view());
+ ASSERT(ccSettings.refreshRate >= 0);
+ if (!ccSettings.refreshRate)
+ ccSettings.refreshRate = defaultRefreshRate;
m_nonCompositedContentHost = NonCompositedContentHost::create(WebViewImplContentPainter::create(this));
m_layerTreeHost = CCLayerTreeHost::create(this, ccSettings);