| 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/service/command_buffer_service.h" | 5 #include "gpu/command_buffer/service/command_buffer_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 void CommandBufferService::WaitForTokenInRange(int32_t start, int32_t end) { | 81 void CommandBufferService::WaitForTokenInRange(int32_t start, int32_t end) { |
| 82 DCHECK(error_ != error::kNoError || InRange(start, end, token_)); | 82 DCHECK(error_ != error::kNoError || InRange(start, end, token_)); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void CommandBufferService::WaitForGetOffsetInRange(int32_t start, int32_t end) { | 85 void CommandBufferService::WaitForGetOffsetInRange(int32_t start, int32_t end) { |
| 86 DCHECK(error_ != error::kNoError || InRange(start, end, get_offset_)); | 86 DCHECK(error_ != error::kNoError || InRange(start, end, get_offset_)); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void CommandBufferService::Flush(int32_t put_offset) { | 89 void CommandBufferService::Flush(int32_t put_offset) { |
| 90 if (put_offset < 0 || put_offset > num_entries_) { | 90 if (put_offset < 0 || put_offset >= num_entries_) { |
| 91 error_ = gpu::error::kOutOfBounds; | 91 error_ = gpu::error::kOutOfBounds; |
| 92 return; | 92 return; |
| 93 } | 93 } |
| 94 | 94 |
| 95 put_offset_ = put_offset; | 95 put_offset_ = put_offset; |
| 96 | 96 |
| 97 if (!put_offset_change_callback_.is_null()) | 97 if (!put_offset_change_callback_.is_null()) |
| 98 put_offset_change_callback_.Run(); | 98 put_offset_change_callback_.Run(); |
| 99 } | 99 } |
| 100 | 100 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 const GetBufferChangedCallback& callback) { | 213 const GetBufferChangedCallback& callback) { |
| 214 get_buffer_change_callback_ = callback; | 214 get_buffer_change_callback_ = callback; |
| 215 } | 215 } |
| 216 | 216 |
| 217 void CommandBufferService::SetParseErrorCallback( | 217 void CommandBufferService::SetParseErrorCallback( |
| 218 const base::Closure& callback) { | 218 const base::Closure& callback) { |
| 219 parse_error_callback_ = callback; | 219 parse_error_callback_ = callback; |
| 220 } | 220 } |
| 221 | 221 |
| 222 } // namespace gpu | 222 } // namespace gpu |
| OLD | NEW |