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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/atomicops.h" | 9 #include "base/atomicops.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 if (std::find(synthetic_errors_.begin(), synthetic_errors_.end(), error) == | 209 if (std::find(synthetic_errors_.begin(), synthetic_errors_.end(), error) == |
210 synthetic_errors_.end()) { | 210 synthetic_errors_.end()) { |
211 synthetic_errors_.push_back(error); | 211 synthetic_errors_.push_back(error); |
212 } | 212 } |
213 } | 213 } |
214 | 214 |
215 uint32_t WebGraphicsContext3DImpl::lastFlushID() { | 215 uint32_t WebGraphicsContext3DImpl::lastFlushID() { |
216 return flush_id_; | 216 return flush_id_; |
217 } | 217 } |
218 | 218 |
219 bool WebGraphicsContext3DImpl::insertSyncPoint(WGC3Dbyte* sync_token) { | |
220 const uint32_t sync_point = gl_->InsertSyncPointCHROMIUM(); | |
221 if (!sync_point) | |
222 return false; | |
223 | |
224 gpu::SyncToken sync_token_data(sync_point); | |
225 memcpy(sync_token, &sync_token_data, sizeof(sync_token_data)); | |
226 return true; | |
227 } | |
228 | |
229 DELEGATE_TO_GL_R(insertFenceSyncCHROMIUM, InsertFenceSyncCHROMIUM, WGC3Duint64) | 219 DELEGATE_TO_GL_R(insertFenceSyncCHROMIUM, InsertFenceSyncCHROMIUM, WGC3Duint64) |
230 | 220 |
231 bool WebGraphicsContext3DImpl::genSyncTokenCHROMIUM(WGC3Duint64 fenceSync, | 221 bool WebGraphicsContext3DImpl::genSyncTokenCHROMIUM(WGC3Duint64 fenceSync, |
232 WGC3Dbyte* syncToken) { | 222 WGC3Dbyte* syncToken) { |
233 gl_->GenSyncTokenCHROMIUM(fenceSync, syncToken); | 223 gl_->GenSyncTokenCHROMIUM(fenceSync, syncToken); |
234 return true; | 224 return true; |
235 } | 225 } |
236 | 226 |
237 DELEGATE_TO_GL_1(waitSyncTokenCHROMIUM, WaitSyncTokenCHROMIUM, const WGC3Dbyte*) | 227 DELEGATE_TO_GL_1(waitSyncTokenCHROMIUM, WaitSyncTokenCHROMIUM, const WGC3Dbyte*) |
238 | 228 |
(...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1296 output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_WEBGL2; | 1286 output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_WEBGL2; |
1297 break; | 1287 break; |
1298 default: | 1288 default: |
1299 NOTREACHED(); | 1289 NOTREACHED(); |
1300 output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_OPENGLES2; | 1290 output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_OPENGLES2; |
1301 break; | 1291 break; |
1302 } | 1292 } |
1303 } | 1293 } |
1304 | 1294 |
1305 } // namespace gpu_blink | 1295 } // namespace gpu_blink |
OLD | NEW |