Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Side by Side Diff: gpu/command_buffer/client/query_tracker.cc

Issue 9836098: Move gpu hash_tables and atomicops stuff (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add hash tables to gyp Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gpu/command_buffer/client/query_tracker.h ('k') | gpu/command_buffer_client.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "../client/query_tracker.h" 5 #include "../client/query_tracker.h"
6 6
7 #if !defined(__native_client__) 7 #include "../client/atomicops.h"
8 #include "base/atomicops.h"
9 #endif
10 #include "../client/cmd_buffer_helper.h" 8 #include "../client/cmd_buffer_helper.h"
11 #include "../client/mapped_memory.h" 9 #include "../client/mapped_memory.h"
12 10
13 namespace gpu { 11 namespace gpu {
14 namespace gles2 { 12 namespace gles2 {
15 13
16 QuerySyncManager::QuerySyncManager(MappedMemoryManager* manager) 14 QuerySyncManager::QuerySyncManager(MappedMemoryManager* manager)
17 : mapped_memory_(manager) { 15 : mapped_memory_(manager) {
18 GPU_DCHECK(manager); 16 GPU_DCHECK(manager);
19 } 17 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 void QuerySyncManager::Free(const QuerySyncManager::QueryInfo& info) { 50 void QuerySyncManager::Free(const QuerySyncManager::QueryInfo& info) {
53 free_queries_.push(info); 51 free_queries_.push(info);
54 } 52 }
55 53
56 bool QueryTracker::Query::CheckResultsAvailable( 54 bool QueryTracker::Query::CheckResultsAvailable(
57 CommandBufferHelper* helper) { 55 CommandBufferHelper* helper) {
58 if (Pending()) { 56 if (Pending()) {
59 if (info_.sync->process_count == submit_count_) { 57 if (info_.sync->process_count == submit_count_) {
60 // Need a MemoryBarrier here so that sync->result read after 58 // Need a MemoryBarrier here so that sync->result read after
61 // sync->process_count. 59 // sync->process_count.
62 #if defined(__native_client__) 60 gpu::MemoryBarrier();
63 __sync_synchronize();
64 #else
65 base::subtle::MemoryBarrier();
66 #endif
67 result_ = info_.sync->result; 61 result_ = info_.sync->result;
68 state_ = kComplete; 62 state_ = kComplete;
69 } else { 63 } else {
70 if (!flushed_) { 64 if (!flushed_) {
71 // TODO(gman): We could reduce the number of flushes by having a 65 // TODO(gman): We could reduce the number of flushes by having a
72 // flush count, recording that count at the time we insert the 66 // flush count, recording that count at the time we insert the
73 // EndQuery command and then only flushing here if we've have not 67 // EndQuery command and then only flushing here if we've have not
74 // passed that count yet. 68 // passed that count yet.
75 flushed_ = true; 69 flushed_ = true;
76 helper->Flush(); 70 helper->Flush();
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 GPU_DCHECK(!query->Pending()); 116 GPU_DCHECK(!query->Pending());
123 query_sync_manager_.Free(query->info_); 117 query_sync_manager_.Free(query->info_);
124 queries_.erase(it); 118 queries_.erase(it);
125 delete query; 119 delete query;
126 } 120 }
127 } 121 }
128 122
129 } // namespace gles2 123 } // namespace gles2
130 } // namespace gpu 124 } // namespace gpu
131 125
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/query_tracker.h ('k') | gpu/command_buffer_client.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698