| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #if !defined(OS_MACOSX) | 52 #if !defined(OS_MACOSX) |
| 53 std::queue<SyncPointToFenceMap::iterator>& sync_points = g_sync_points.Get(); | 53 std::queue<SyncPointToFenceMap::iterator>& sync_points = g_sync_points.Get(); |
| 54 SyncPointToFenceMap& sync_point_to_fence = g_sync_point_to_fence.Get(); | 54 SyncPointToFenceMap& sync_point_to_fence = g_sync_point_to_fence.Get(); |
| 55 if (sync_point) { | 55 if (sync_point) { |
| 56 while (!sync_points.empty() && | 56 while (!sync_points.empty() && |
| 57 sync_points.front()->second->HasCompleted()) { | 57 sync_points.front()->second->HasCompleted()) { |
| 58 sync_point_to_fence.erase(sync_points.front()); | 58 sync_point_to_fence.erase(sync_points.front()); |
| 59 sync_points.pop(); | 59 sync_points.pop(); |
| 60 } | 60 } |
| 61 // Need to use EGL fences since we are likely not in a single share group. | 61 // Need to use EGL fences since we are likely not in a single share group. |
| 62 linked_ptr<gfx::GLFence> fence(make_linked_ptr(new gfx::GLFenceEGL(true))); | 62 linked_ptr<gfx::GLFence> fence(make_linked_ptr(new gfx::GLFenceEGL)); |
| 63 if (fence.get()) { | 63 if (fence.get()) { |
| 64 std::pair<SyncPointToFenceMap::iterator, bool> result = | 64 std::pair<SyncPointToFenceMap::iterator, bool> result = |
| 65 sync_point_to_fence.insert(std::make_pair(sync_point, fence)); | 65 sync_point_to_fence.insert(std::make_pair(sync_point, fence)); |
| 66 DCHECK(result.second); | 66 DCHECK(result.second); |
| 67 sync_points.push(result.first); | 67 sync_points.push(result.first); |
| 68 } | 68 } |
| 69 DCHECK(sync_points.size() == sync_point_to_fence.size()); | 69 DCHECK(sync_points.size() == sync_point_to_fence.size()); |
| 70 } | 70 } |
| 71 #endif | 71 #endif |
| 72 } | 72 } |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 if (texture_version == definition.version() || | 325 if (texture_version == definition.version() || |
| 326 definition.IsOlderThan(texture_version)) | 326 definition.IsOlderThan(texture_version)) |
| 327 continue; | 327 continue; |
| 328 texture_version = definition.version(); | 328 texture_version = definition.version(); |
| 329 definition.UpdateTexture(texture); | 329 definition.UpdateTexture(texture); |
| 330 } | 330 } |
| 331 } | 331 } |
| 332 | 332 |
| 333 } // namespace gles2 | 333 } // namespace gles2 |
| 334 } // namespace gpu | 334 } // namespace gpu |
| OLD | NEW |