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

Side by Side Diff: webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc

Issue 19522006: GLInProcessContext: support async flushes and dedicated GPU thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 (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 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1156 shallowFlushCHROMIUM(); 1156 shallowFlushCHROMIUM();
1157 return 0; 1157 return 0;
1158 } 1158 }
1159 1159
1160 void WebGraphicsContext3DInProcessCommandBufferImpl::signalSyncPoint( 1160 void WebGraphicsContext3DInProcessCommandBufferImpl::signalSyncPoint(
1161 unsigned sync_point, 1161 unsigned sync_point,
1162 WebGraphicsSyncPointCallback* callback) { 1162 WebGraphicsSyncPointCallback* callback) {
1163 // Take ownership of the callback. 1163 // Take ownership of the callback.
1164 context_->SignalSyncPoint( 1164 context_->SignalSyncPoint(
1165 sync_point, base::Bind(&OnSignalSyncPoint, base::Owned(callback))); 1165 sync_point, base::Bind(&OnSignalSyncPoint, base::Owned(callback)));
1166 // Make sure we have something to flush, or shallowFlushCHROMIUM()
1167 // doesn't do anything.
1168 gl_->helper()->Noop(1);
1169 // This fill force PumpCommands() to run which is what triggers the signal.
1170 shallowFlushCHROMIUM();
1171 } 1166 }
1172 1167
1173 void WebGraphicsContext3DInProcessCommandBufferImpl::signalQuery( 1168 void WebGraphicsContext3DInProcessCommandBufferImpl::signalQuery(
1174 unsigned query, 1169 unsigned query,
1175 WebGraphicsSyncPointCallback* callback) { 1170 WebGraphicsSyncPointCallback* callback) {
1176 // Take ownership of the callback. 1171 // Take ownership of the callback.
1177 context_->SignalQuery(query, 1172 context_->SignalQuery(query,
1178 base::Bind(&OnSignalSyncPoint, base::Owned(callback))); 1173 base::Bind(&OnSignalSyncPoint, base::Owned(callback)));
1179 } 1174 }
1180 1175
1181 void WebGraphicsContext3DInProcessCommandBufferImpl::loseContextCHROMIUM( 1176 void WebGraphicsContext3DInProcessCommandBufferImpl::loseContextCHROMIUM(
1182 WGC3Denum current, WGC3Denum other) { 1177 WGC3Denum current, WGC3Denum other) {
1183 gl_->LoseContextCHROMIUM(current, other); 1178 gl_->LoseContextCHROMIUM(current, other);
1184 gl_->ShallowFlushCHROMIUM(); 1179 gl_->ShallowFlushCHROMIUM();
1185 DCHECK(isContextLost());
1186 } 1180 }
1187 1181
1188 DELEGATE_TO_GL_9(asyncTexImage2DCHROMIUM, AsyncTexImage2DCHROMIUM, 1182 DELEGATE_TO_GL_9(asyncTexImage2DCHROMIUM, AsyncTexImage2DCHROMIUM,
1189 WGC3Denum, WGC3Dint, WGC3Denum, WGC3Dsizei, WGC3Dsizei, WGC3Dint, 1183 WGC3Denum, WGC3Dint, WGC3Denum, WGC3Dsizei, WGC3Dsizei, WGC3Dint,
1190 WGC3Denum, WGC3Denum, const void*) 1184 WGC3Denum, WGC3Denum, const void*)
1191 1185
1192 DELEGATE_TO_GL_9(asyncTexSubImage2DCHROMIUM, AsyncTexSubImage2DCHROMIUM, 1186 DELEGATE_TO_GL_9(asyncTexSubImage2DCHROMIUM, AsyncTexSubImage2DCHROMIUM,
1193 WGC3Denum, WGC3Dint, WGC3Dint, WGC3Dint, WGC3Dsizei, WGC3Dsizei, 1187 WGC3Denum, WGC3Dint, WGC3Dint, WGC3Dint, WGC3Dsizei, WGC3Dsizei,
1194 WGC3Denum, WGC3Denum, const void*) 1188 WGC3Denum, WGC3Denum, const void*)
1195 1189
1196 DELEGATE_TO_GL_1(waitAsyncTexImage2DCHROMIUM, WaitAsyncTexImage2DCHROMIUM, 1190 DELEGATE_TO_GL_1(waitAsyncTexImage2DCHROMIUM, WaitAsyncTexImage2DCHROMIUM,
1197 WGC3Denum) 1191 WGC3Denum)
1198 1192
1199 } // namespace gpu 1193 } // namespace gpu
1200 } // namespace webkit 1194 } // namespace webkit
OLDNEW
« gpu/command_buffer/service/in_process_command_buffer.cc ('K') | « gpu/command_buffer_service.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698