OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" | 5 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" |
6 | 6 |
7 #include <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
8 #ifndef GL_GLEXT_PROTOTYPES | 8 #ifndef GL_GLEXT_PROTOTYPES |
9 #define GL_GLEXT_PROTOTYPES 1 | 9 #define GL_GLEXT_PROTOTYPES 1 |
10 #endif | 10 #endif |
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1230 shallowFlushCHROMIUM(); | 1230 shallowFlushCHROMIUM(); |
1231 return 0; | 1231 return 0; |
1232 } | 1232 } |
1233 | 1233 |
1234 void WebGraphicsContext3DInProcessCommandBufferImpl::signalSyncPoint( | 1234 void WebGraphicsContext3DInProcessCommandBufferImpl::signalSyncPoint( |
1235 unsigned sync_point, | 1235 unsigned sync_point, |
1236 WebGraphicsSyncPointCallback* callback) { | 1236 WebGraphicsSyncPointCallback* callback) { |
1237 // Take ownership of the callback. | 1237 // Take ownership of the callback. |
1238 context_->SignalSyncPoint( | 1238 context_->SignalSyncPoint( |
1239 sync_point, base::Bind(&OnSignalSyncPoint, base::Owned(callback))); | 1239 sync_point, base::Bind(&OnSignalSyncPoint, base::Owned(callback))); |
1240 // Stick something in the command buffer. | 1240 // Make sure we have something to flush, or shallowFlushCHROMIUM() |
| 1241 // doesn't do anything. |
| 1242 gl_->helper()->Noop(1); |
| 1243 // This fill force PumpCommands() to run which is what triggers the signal. |
1241 shallowFlushCHROMIUM(); | 1244 shallowFlushCHROMIUM(); |
1242 } | 1245 } |
1243 | 1246 |
1244 void WebGraphicsContext3DInProcessCommandBufferImpl::signalQuery( | 1247 void WebGraphicsContext3DInProcessCommandBufferImpl::signalQuery( |
1245 unsigned query, | 1248 unsigned query, |
1246 WebGraphicsSyncPointCallback* callback) { | 1249 WebGraphicsSyncPointCallback* callback) { |
1247 // Take ownership of the callback. | 1250 // Take ownership of the callback. |
1248 context_->SignalQuery(query, | 1251 context_->SignalQuery(query, |
1249 base::Bind(&OnSignalSyncPoint, base::Owned(callback))); | 1252 base::Bind(&OnSignalSyncPoint, base::Owned(callback))); |
1250 } | 1253 } |
(...skipping 11 matching lines...) Expand all Loading... |
1262 | 1265 |
1263 DELEGATE_TO_GL_9(asyncTexSubImage2DCHROMIUM, AsyncTexSubImage2DCHROMIUM, | 1266 DELEGATE_TO_GL_9(asyncTexSubImage2DCHROMIUM, AsyncTexSubImage2DCHROMIUM, |
1264 WGC3Denum, WGC3Dint, WGC3Dint, WGC3Dint, WGC3Dsizei, WGC3Dsizei, | 1267 WGC3Denum, WGC3Dint, WGC3Dint, WGC3Dint, WGC3Dsizei, WGC3Dsizei, |
1265 WGC3Denum, WGC3Denum, const void*) | 1268 WGC3Denum, WGC3Denum, const void*) |
1266 | 1269 |
1267 DELEGATE_TO_GL_1(waitAsyncTexImage2DCHROMIUM, WaitAsyncTexImage2DCHROMIUM, | 1270 DELEGATE_TO_GL_1(waitAsyncTexImage2DCHROMIUM, WaitAsyncTexImage2DCHROMIUM, |
1268 WGC3Denum) | 1271 WGC3Denum) |
1269 | 1272 |
1270 } // namespace gpu | 1273 } // namespace gpu |
1271 } // namespace webkit | 1274 } // namespace webkit |
OLD | NEW |