| 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/command_buffer/client/query_tracker.h" | 5 #include "gpu/command_buffer/client/query_tracker.h" |
| 6 | 6 |
| 7 #include <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
| 8 #include <GLES2/gl2ext.h> | 8 #include <GLES2/gl2ext.h> |
| 9 #include <GLES2/gl2extchromium.h> | 9 #include <GLES2/gl2extchromium.h> |
| 10 | 10 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 MarkAsPending(gl->helper()->InsertToken()); | 144 MarkAsPending(gl->helper()->InsertToken()); |
| 145 } | 145 } |
| 146 | 146 |
| 147 bool QueryTracker::Query::CheckResultsAvailable( | 147 bool QueryTracker::Query::CheckResultsAvailable( |
| 148 CommandBufferHelper* helper) { | 148 CommandBufferHelper* helper) { |
| 149 if (Pending()) { | 149 if (Pending()) { |
| 150 if (info_.sync->process_count == submit_count_ || | 150 if (info_.sync->process_count == submit_count_ || |
| 151 helper->IsContextLost()) { | 151 helper->IsContextLost()) { |
| 152 // Need a MemoryBarrier here so that sync->result read after | 152 // Need a MemoryBarrier here so that sync->result read after |
| 153 // sync->process_count. | 153 // sync->process_count. |
| 154 gpu::MemoryBarrier(); | 154 base::subtle::MemoryBarrier(); |
| 155 switch (target()) { | 155 switch (target()) { |
| 156 case GL_COMMANDS_ISSUED_CHROMIUM: | 156 case GL_COMMANDS_ISSUED_CHROMIUM: |
| 157 result_ = std::min(info_.sync->result, | 157 result_ = std::min(info_.sync->result, |
| 158 static_cast<uint64>(0xFFFFFFFFL)); | 158 static_cast<uint64>(0xFFFFFFFFL)); |
| 159 break; | 159 break; |
| 160 case GL_LATENCY_QUERY_CHROMIUM: | 160 case GL_LATENCY_QUERY_CHROMIUM: |
| 161 DCHECK(info_.sync->result >= client_begin_time_us_); | 161 DCHECK(info_.sync->result >= client_begin_time_us_); |
| 162 result_ = std::min(info_.sync->result - client_begin_time_us_, | 162 result_ = std::min(info_.sync->result - client_begin_time_us_, |
| 163 static_cast<uint64>(0xFFFFFFFFL)); | 163 static_cast<uint64>(0xFFFFFFFFL)); |
| 164 break; | 164 break; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 } | 256 } |
| 257 | 257 |
| 258 query_sync_manager_.Free(query->info_); | 258 query_sync_manager_.Free(query->info_); |
| 259 it = removed_queries_.erase(it); | 259 it = removed_queries_.erase(it); |
| 260 delete query; | 260 delete query; |
| 261 } | 261 } |
| 262 } | 262 } |
| 263 | 263 |
| 264 } // namespace gles2 | 264 } // namespace gles2 |
| 265 } // namespace gpu | 265 } // namespace gpu |
| OLD | NEW |