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

Side by Side Diff: cc/gl_renderer.cc

Issue 11195011: Send vsync timebase updates to the browser compositor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Send vsync timebase updates to the browser compositor Created 8 years, 2 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 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 6
7 #include "CCRendererGL.h" 7 #include "CCRendererGL.h"
8 8
9 #include "CCDamageTracker.h" 9 #include "CCDamageTracker.h"
10 #include "CCLayerQuad.h" 10 #include "CCLayerQuad.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 m_capabilities.usingAcceleratedPainting = true; 100 m_capabilities.usingAcceleratedPainting = true;
101 else 101 else
102 m_capabilities.usingAcceleratedPainting = false; 102 m_capabilities.usingAcceleratedPainting = false;
103 103
104 104
105 m_capabilities.contextHasCachedFrontBuffer = extensions.count("GL_CHROMIUM_f ront_buffer_cached"); 105 m_capabilities.contextHasCachedFrontBuffer = extensions.count("GL_CHROMIUM_f ront_buffer_cached");
106 106
107 m_capabilities.usingPartialSwap = CCSettings::partialSwapEnabled() && extens ions.count("GL_CHROMIUM_post_sub_buffer"); 107 m_capabilities.usingPartialSwap = CCSettings::partialSwapEnabled() && extens ions.count("GL_CHROMIUM_post_sub_buffer");
108 108
109 // Use the swapBuffers callback only with the threaded proxy. 109 // Use the swapBuffers callback only with the threaded proxy.
110 if (CCProxy::hasImplThread()) 110 if (CCProxy::hasImplThread()) {
111 m_capabilities.usingSwapCompleteCallback = extensions.count("GL_CHROMIUM _swapbuffers_complete_callback"); 111 m_capabilities.usingSwapCompleteCallback = extensions.count("GL_CHROMIUM _swapbuffers_complete_callback");
112 m_context->setUpdateVSyncTimeCallbackCHROMIUM(this);
113 }
112 if (m_capabilities.usingSwapCompleteCallback) 114 if (m_capabilities.usingSwapCompleteCallback)
113 m_context->setSwapBuffersCompleteCallbackCHROMIUM(this); 115 m_context->setSwapBuffersCompleteCallbackCHROMIUM(this);
114 116
115 m_capabilities.usingSetVisibility = extensions.count("GL_CHROMIUM_set_visibi lity"); 117 m_capabilities.usingSetVisibility = extensions.count("GL_CHROMIUM_set_visibi lity");
116 118
117 if (extensions.count("GL_CHROMIUM_iosurface")) 119 if (extensions.count("GL_CHROMIUM_iosurface"))
118 ASSERT(extensions.count("GL_ARB_texture_rectangle")); 120 ASSERT(extensions.count("GL_ARB_texture_rectangle"));
119 121
120 m_capabilities.usingGpuMemoryManager = extensions.count("GL_CHROMIUM_gpu_mem ory_manager"); 122 m_capabilities.usingGpuMemoryManager = extensions.count("GL_CHROMIUM_gpu_mem ory_manager");
121 if (m_capabilities.usingGpuMemoryManager) 123 if (m_capabilities.usingGpuMemoryManager)
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 if (!m_isFramebufferDiscarded) 1104 if (!m_isFramebufferDiscarded)
1103 return; 1105 return;
1104 1106
1105 if (!m_capabilities.usingDiscardFramebuffer) 1107 if (!m_capabilities.usingDiscardFramebuffer)
1106 return; 1108 return;
1107 1109
1108 m_context->ensureFramebufferCHROMIUM(); 1110 m_context->ensureFramebufferCHROMIUM();
1109 m_isFramebufferDiscarded = false; 1111 m_isFramebufferDiscarded = false;
1110 } 1112 }
1111 1113
1114 void CCRendererGL::onUpdateVSyncTime(int64 time)
1115 {
1116 m_client->onUpdateVSyncTime(time);
1117 }
1118
1112 void CCRendererGL::onContextLost() 1119 void CCRendererGL::onContextLost()
1113 { 1120 {
1114 m_client->didLoseContext(); 1121 m_client->didLoseContext();
1115 } 1122 }
1116 1123
1117 1124
1118 void CCRendererGL::getFramebufferPixels(void *pixels, const IntRect& rect) 1125 void CCRendererGL::getFramebufferPixels(void *pixels, const IntRect& rect)
1119 { 1126 {
1120 ASSERT(rect.maxX() <= viewportWidth() && rect.maxY() <= viewportHeight()); 1127 ASSERT(rect.maxX() <= viewportWidth() && rect.maxY() <= viewportHeight());
1121 1128
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 1521
1515 releaseRenderPassTextures(); 1522 releaseRenderPassTextures();
1516 } 1523 }
1517 1524
1518 bool CCRendererGL::isContextLost() 1525 bool CCRendererGL::isContextLost()
1519 { 1526 {
1520 return (m_context->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERRO R); 1527 return (m_context->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERRO R);
1521 } 1528 }
1522 1529
1523 } // namespace cc 1530 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698