OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/command_buffer/service/mailbox_manager_sync.h" | 5 #include "gpu/command_buffer/service/mailbox_manager_sync.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <queue> | 10 #include <queue> |
(...skipping 20 matching lines...) Expand all Loading... |
31 typedef std::map<SyncToken, std::unique_ptr<gl::GLFence>> SyncTokenToFenceMap; | 31 typedef std::map<SyncToken, std::unique_ptr<gl::GLFence>> SyncTokenToFenceMap; |
32 base::LazyInstance<SyncTokenToFenceMap> g_sync_point_to_fence = | 32 base::LazyInstance<SyncTokenToFenceMap> g_sync_point_to_fence = |
33 LAZY_INSTANCE_INITIALIZER; | 33 LAZY_INSTANCE_INITIALIZER; |
34 base::LazyInstance<std::queue<SyncTokenToFenceMap::iterator>> g_sync_points = | 34 base::LazyInstance<std::queue<SyncTokenToFenceMap::iterator>> g_sync_points = |
35 LAZY_INSTANCE_INITIALIZER; | 35 LAZY_INSTANCE_INITIALIZER; |
36 #endif | 36 #endif |
37 | 37 |
38 void CreateFenceLocked(const SyncToken& sync_token) { | 38 void CreateFenceLocked(const SyncToken& sync_token) { |
39 #if !defined(OS_MACOSX) | 39 #if !defined(OS_MACOSX) |
40 g_lock.Get().AssertAcquired(); | 40 g_lock.Get().AssertAcquired(); |
41 if (gl::GetGLImplementation() == gl::kGLImplementationMockGL) | 41 if (gl::GetGLImplementation() == gl::kGLImplementationMockGL || |
| 42 gl::GetGLImplementation() == gl::kGLImplementationStubGL) |
42 return; | 43 return; |
43 | 44 |
44 std::queue<SyncTokenToFenceMap::iterator>& sync_points = g_sync_points.Get(); | 45 std::queue<SyncTokenToFenceMap::iterator>& sync_points = g_sync_points.Get(); |
45 SyncTokenToFenceMap& sync_point_to_fence = g_sync_point_to_fence.Get(); | 46 SyncTokenToFenceMap& sync_point_to_fence = g_sync_point_to_fence.Get(); |
46 if (sync_token.release_count()) { | 47 if (sync_token.release_count()) { |
47 while (!sync_points.empty() && | 48 while (!sync_points.empty() && |
48 sync_points.front()->second->HasCompleted()) { | 49 sync_points.front()->second->HasCompleted()) { |
49 sync_point_to_fence.erase(sync_points.front()); | 50 sync_point_to_fence.erase(sync_points.front()); |
50 sync_points.pop(); | 51 sync_points.pop(); |
51 } | 52 } |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 | 345 |
345 if (!needs_update.empty()) { | 346 if (!needs_update.empty()) { |
346 for (const TextureUpdatePair& pair : needs_update) { | 347 for (const TextureUpdatePair& pair : needs_update) { |
347 pair.second.UpdateTexture(pair.first); | 348 pair.second.UpdateTexture(pair.first); |
348 } | 349 } |
349 } | 350 } |
350 } | 351 } |
351 | 352 |
352 } // namespace gles2 | 353 } // namespace gles2 |
353 } // namespace gpu | 354 } // namespace gpu |
OLD | NEW |