| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 void* mem = mapped_memory_->Alloc( | 60 void* mem = mapped_memory_->Alloc( |
| 61 kSyncsPerBucket * sizeof(QuerySync), &shm_id, &shm_offset); | 61 kSyncsPerBucket * sizeof(QuerySync), &shm_id, &shm_offset); |
| 62 if (!mem) { | 62 if (!mem) { |
| 63 return false; | 63 return false; |
| 64 } | 64 } |
| 65 QuerySync* syncs = static_cast<QuerySync*>(mem); | 65 QuerySync* syncs = static_cast<QuerySync*>(mem); |
| 66 bucket = new Bucket(syncs, shm_id, shm_offset); | 66 bucket = new Bucket(syncs, shm_id, shm_offset); |
| 67 buckets_.push_back(bucket); | 67 buckets_.push_back(bucket); |
| 68 } | 68 } |
| 69 | 69 |
| 70 unsigned short index_in_bucket = 0; | 70 size_t index_in_bucket = 0; |
| 71 for (size_t i = 0; i < kSyncsPerBucket; i++) { | 71 for (size_t i = 0; i < kSyncsPerBucket; i++) { |
| 72 if (!bucket->in_use_queries[i]) { | 72 if (!bucket->in_use_queries[i]) { |
| 73 index_in_bucket = i; | 73 index_in_bucket = i; |
| 74 break; | 74 break; |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 | 77 |
| 78 uint32 shm_offset = | 78 uint32 shm_offset = |
| 79 bucket->base_shm_offset + index_in_bucket * sizeof(QuerySync); | 79 bucket->base_shm_offset + index_in_bucket * sizeof(QuerySync); |
| 80 QuerySync* sync = bucket->syncs + index_in_bucket; | 80 QuerySync* sync = bucket->syncs + index_in_bucket; |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 if (local_disjoint_count_ != disjoint_count) { | 386 if (local_disjoint_count_ != disjoint_count) { |
| 387 local_disjoint_count_ = disjoint_count; | 387 local_disjoint_count_ = disjoint_count; |
| 388 return true; | 388 return true; |
| 389 } | 389 } |
| 390 } | 390 } |
| 391 return false; | 391 return false; |
| 392 } | 392 } |
| 393 | 393 |
| 394 } // namespace gles2 | 394 } // namespace gles2 |
| 395 } // namespace gpu | 395 } // namespace gpu |
| OLD | NEW |