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 "gpu/blink/webgraphicscontext3d_impl.h" | 5 #include "gpu/blink/webgraphicscontext3d_impl.h" |
6 | 6 |
7 #include "base/atomicops.h" | 7 #include "base/atomicops.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "gpu/GLES2/gl2extchromium.h" | 10 #include "gpu/GLES2/gl2extchromium.h" |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 if (std::find(synthetic_errors_.begin(), synthetic_errors_.end(), error) == | 206 if (std::find(synthetic_errors_.begin(), synthetic_errors_.end(), error) == |
207 synthetic_errors_.end()) { | 207 synthetic_errors_.end()) { |
208 synthetic_errors_.push_back(error); | 208 synthetic_errors_.push_back(error); |
209 } | 209 } |
210 } | 210 } |
211 | 211 |
212 uint32_t WebGraphicsContext3DImpl::lastFlushID() { | 212 uint32_t WebGraphicsContext3DImpl::lastFlushID() { |
213 return flush_id_; | 213 return flush_id_; |
214 } | 214 } |
215 | 215 |
216 DELEGATE_TO_GL_R(insertFenceSyncCHROMIUM, InsertFenceSyncCHROMIUM, WGC3Duint64) | 216 bool WebGraphicsContext3DImpl::insertSyncPoint(WGC3Dbyte* sync_token) { |
| 217 const uint32_t sync_point = gl_->InsertSyncPointCHROMIUM(); |
| 218 if (!sync_point) |
| 219 return false; |
217 | 220 |
218 bool WebGraphicsContext3DImpl::genSyncTokenCHROMIUM(WGC3Duint64 fenceSync, | 221 gpu::SyncToken sync_token_data(sync_point); |
219 WGC3Dbyte* syncToken) { | 222 memcpy(sync_token, &sync_token_data, sizeof(sync_token_data)); |
220 gl_->GenSyncTokenCHROMIUM(fenceSync, syncToken); | |
221 return true; | 223 return true; |
222 } | 224 } |
223 | 225 |
224 DELEGATE_TO_GL_1(waitSyncTokenCHROMIUM, WaitSyncTokenCHROMIUM, const WGC3Dbyte*) | |
225 | |
226 DELEGATE_TO_GL_3(reshapeWithScaleFactor, ResizeCHROMIUM, int, int, float) | 226 DELEGATE_TO_GL_3(reshapeWithScaleFactor, ResizeCHROMIUM, int, int, float) |
227 | 227 |
228 DELEGATE_TO_GL_4R(mapBufferSubDataCHROMIUM, MapBufferSubDataCHROMIUM, WGC3Denum, | 228 DELEGATE_TO_GL_4R(mapBufferSubDataCHROMIUM, MapBufferSubDataCHROMIUM, WGC3Denum, |
229 WGC3Dintptr, WGC3Dsizeiptr, WGC3Denum, void*) | 229 WGC3Dintptr, WGC3Dsizeiptr, WGC3Denum, void*) |
230 | 230 |
231 DELEGATE_TO_GL_1(unmapBufferSubDataCHROMIUM, UnmapBufferSubDataCHROMIUM, | 231 DELEGATE_TO_GL_1(unmapBufferSubDataCHROMIUM, UnmapBufferSubDataCHROMIUM, |
232 const void*) | 232 const void*) |
233 | 233 |
234 DELEGATE_TO_GL_9R(mapTexSubImage2DCHROMIUM, MapTexSubImage2DCHROMIUM, WGC3Denum, | 234 DELEGATE_TO_GL_9R(mapTexSubImage2DCHROMIUM, MapTexSubImage2DCHROMIUM, WGC3Denum, |
235 WGC3Dint, WGC3Dint, WGC3Dint, WGC3Dsizei, WGC3Dsizei, | 235 WGC3Dint, WGC3Dint, WGC3Dint, WGC3Dsizei, WGC3Dsizei, |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 void WebGraphicsContext3DImpl::shallowFlushCHROMIUM() { | 881 void WebGraphicsContext3DImpl::shallowFlushCHROMIUM() { |
882 flush_id_ = GenFlushID(); | 882 flush_id_ = GenFlushID(); |
883 gl_->ShallowFlushCHROMIUM(); | 883 gl_->ShallowFlushCHROMIUM(); |
884 } | 884 } |
885 | 885 |
886 void WebGraphicsContext3DImpl::shallowFinishCHROMIUM() { | 886 void WebGraphicsContext3DImpl::shallowFinishCHROMIUM() { |
887 flush_id_ = GenFlushID(); | 887 flush_id_ = GenFlushID(); |
888 gl_->ShallowFinishCHROMIUM(); | 888 gl_->ShallowFinishCHROMIUM(); |
889 } | 889 } |
890 | 890 |
| 891 DELEGATE_TO_GL_1(waitSyncToken, WaitSyncTokenCHROMIUM, const WGC3Dbyte*) |
| 892 |
891 void WebGraphicsContext3DImpl::loseContextCHROMIUM( | 893 void WebGraphicsContext3DImpl::loseContextCHROMIUM( |
892 WGC3Denum current, WGC3Denum other) { | 894 WGC3Denum current, WGC3Denum other) { |
893 gl_->LoseContextCHROMIUM(current, other); | 895 gl_->LoseContextCHROMIUM(current, other); |
894 gl_->Flush(); | 896 gl_->Flush(); |
895 } | 897 } |
896 | 898 |
897 DELEGATE_TO_GL_1(genMailboxCHROMIUM, GenMailboxCHROMIUM, WGC3Dbyte*) | 899 DELEGATE_TO_GL_1(genMailboxCHROMIUM, GenMailboxCHROMIUM, WGC3Dbyte*) |
898 DELEGATE_TO_GL_2(produceTextureCHROMIUM, ProduceTextureCHROMIUM, | 900 DELEGATE_TO_GL_2(produceTextureCHROMIUM, ProduceTextureCHROMIUM, |
899 WGC3Denum, const WGC3Dbyte*) | 901 WGC3Denum, const WGC3Dbyte*) |
900 DELEGATE_TO_GL_3(produceTextureDirectCHROMIUM, ProduceTextureDirectCHROMIUM, | 902 DELEGATE_TO_GL_3(produceTextureDirectCHROMIUM, ProduceTextureDirectCHROMIUM, |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1272 output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_WEBGL2; | 1274 output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_WEBGL2; |
1273 break; | 1275 break; |
1274 default: | 1276 default: |
1275 NOTREACHED(); | 1277 NOTREACHED(); |
1276 output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_OPENGLES2; | 1278 output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_OPENGLES2; |
1277 break; | 1279 break; |
1278 } | 1280 } |
1279 } | 1281 } |
1280 | 1282 |
1281 } // namespace gpu_blink | 1283 } // namespace gpu_blink |
OLD | NEW |