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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 126 |
127 switch (target()) { | 127 switch (target()) { |
128 case GL_GET_ERROR_QUERY_CHROMIUM: | 128 case GL_GET_ERROR_QUERY_CHROMIUM: |
129 // To nothing on begin for error queries. | 129 // To nothing on begin for error queries. |
130 break; | 130 break; |
131 case GL_LATENCY_QUERY_CHROMIUM: | 131 case GL_LATENCY_QUERY_CHROMIUM: |
132 client_begin_time_us_ = MicrosecondsSinceOriginOfTime(); | 132 client_begin_time_us_ = MicrosecondsSinceOriginOfTime(); |
133 // tell service about id, shared memory and count | 133 // tell service about id, shared memory and count |
134 gl->helper()->BeginQueryEXT(target(), id(), shm_id(), shm_offset()); | 134 gl->helper()->BeginQueryEXT(target(), id(), shm_id(), shm_offset()); |
135 break; | 135 break; |
136 case GL_ASYNC_PIXEL_UNPACK_COMPLETED_CHROMIUM: | |
137 case GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM: | 136 case GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM: |
138 default: | 137 default: |
139 // tell service about id, shared memory and count | 138 // tell service about id, shared memory and count |
140 gl->helper()->BeginQueryEXT(target(), id(), shm_id(), shm_offset()); | 139 gl->helper()->BeginQueryEXT(target(), id(), shm_id(), shm_offset()); |
141 break; | 140 break; |
142 } | 141 } |
143 } | 142 } |
144 | 143 |
145 void QueryTracker::Query::End(GLES2Implementation* gl) { | 144 void QueryTracker::Query::End(GLES2Implementation* gl) { |
146 switch (target()) { | 145 switch (target()) { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 helper->IsContextLost()) { | 181 helper->IsContextLost()) { |
183 switch (target()) { | 182 switch (target()) { |
184 case GL_COMMANDS_ISSUED_CHROMIUM: | 183 case GL_COMMANDS_ISSUED_CHROMIUM: |
185 result_ = info_.sync->result; | 184 result_ = info_.sync->result; |
186 break; | 185 break; |
187 case GL_LATENCY_QUERY_CHROMIUM: | 186 case GL_LATENCY_QUERY_CHROMIUM: |
188 // Disabled DCHECK because of http://crbug.com/419236. | 187 // Disabled DCHECK because of http://crbug.com/419236. |
189 //DCHECK(info_.sync->result >= client_begin_time_us_); | 188 //DCHECK(info_.sync->result >= client_begin_time_us_); |
190 result_ = info_.sync->result - client_begin_time_us_; | 189 result_ = info_.sync->result - client_begin_time_us_; |
191 break; | 190 break; |
192 case GL_ASYNC_PIXEL_UNPACK_COMPLETED_CHROMIUM: | |
193 case GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM: | 191 case GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM: |
194 default: | 192 default: |
195 result_ = info_.sync->result; | 193 result_ = info_.sync->result; |
196 break; | 194 break; |
197 } | 195 } |
198 state_ = kComplete; | 196 state_ = kComplete; |
199 } else { | 197 } else { |
200 if ((helper->flush_generation() - flush_count_ - 1) >= 0x80000000) { | 198 if ((helper->flush_generation() - flush_count_ - 1) >= 0x80000000) { |
201 helper->Flush(); | 199 helper->Flush(); |
202 } else { | 200 } else { |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 if (local_disjoint_count_ != disjoint_count) { | 386 if (local_disjoint_count_ != disjoint_count) { |
389 local_disjoint_count_ = disjoint_count; | 387 local_disjoint_count_ = disjoint_count; |
390 return true; | 388 return true; |
391 } | 389 } |
392 } | 390 } |
393 return false; | 391 return false; |
394 } | 392 } |
395 | 393 |
396 } // namespace gles2 | 394 } // namespace gles2 |
397 } // namespace gpu | 395 } // namespace gpu |
OLD | NEW |