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

Unified Diff: content/common/gpu/image_transport_surface.cc

Issue 11195011: Send vsync timebase updates to the browser compositor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased again. Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/image_transport_surface.h ('k') | ui/compositor/compositor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/image_transport_surface.cc
diff --git a/content/common/gpu/image_transport_surface.cc b/content/common/gpu/image_transport_surface.cc
index d5c1affed3d9d7bbd0385ac8c0fad46f87164900..fe909139c785ccb02367cd5f16d003b1be945795 100644
--- a/content/common/gpu/image_transport_surface.cc
+++ b/content/common/gpu/image_transport_surface.cc
@@ -157,6 +157,13 @@ void ImageTransportHelper::SendResizeView(const gfx::Size& size) {
size));
}
+void ImageTransportHelper::SendUpdateVSyncParameters(
+ base::TimeTicks timebase, base::TimeDelta interval) {
+ manager_->Send(new GpuHostMsg_UpdateVSyncParameters(stub_->surface_id(),
+ timebase,
+ interval));
+}
+
void ImageTransportHelper::SetScheduled(bool is_scheduled) {
gpu::GpuScheduler* scheduler = Scheduler();
if (!scheduler)
@@ -271,6 +278,7 @@ void PassThroughImageTransportSurface::Destroy() {
bool PassThroughImageTransportSurface::SwapBuffers() {
bool result = gfx::GLSurfaceAdapter::SwapBuffers();
+ SendVSyncUpdateIfAvailable();
if (transport_) {
// Round trip to the browser UI thread, for throttling, by sending a dummy
@@ -287,6 +295,7 @@ bool PassThroughImageTransportSurface::SwapBuffers() {
bool PassThroughImageTransportSurface::PostSubBuffer(
int x, int y, int width, int height) {
bool result = gfx::GLSurfaceAdapter::PostSubBuffer(x, y, width, height);
+ SendVSyncUpdateIfAvailable();
if (transport_) {
// Round trip to the browser UI thread, for throttling, by sending a dummy
@@ -343,6 +352,14 @@ gfx::Size PassThroughImageTransportSurface::GetSize() {
PassThroughImageTransportSurface::~PassThroughImageTransportSurface() {}
+void PassThroughImageTransportSurface::SendVSyncUpdateIfAvailable() {
+ base::TimeTicks timebase;
+ base::TimeDelta interval;
+ if (GetVSyncParameters(&timebase, &interval)) {
+ helper_->SendUpdateVSyncParameters(timebase, interval);
+ }
+}
+
} // namespace content
#endif // defined(ENABLE_GPU)
« no previous file with comments | « content/common/gpu/image_transport_surface.h ('k') | ui/compositor/compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698