| 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 <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } | 60 } |
| 61 | 61 |
| 62 void CommandBufferService::WaitForTokenInRange(int32 start, int32 end) { | 62 void CommandBufferService::WaitForTokenInRange(int32 start, int32 end) { |
| 63 DCHECK(error_ != error::kNoError || InRange(start, end, token_)); | 63 DCHECK(error_ != error::kNoError || InRange(start, end, token_)); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void CommandBufferService::WaitForGetOffsetInRange(int32 start, int32 end) { | 66 void CommandBufferService::WaitForGetOffsetInRange(int32 start, int32 end) { |
| 67 DCHECK(error_ != error::kNoError || InRange(start, end, get_offset_)); | 67 DCHECK(error_ != error::kNoError || InRange(start, end, get_offset_)); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void CommandBufferService::Flush(int32 put_offset) { | 70 void CommandBufferService::Flush(int32 put_offset, |
| 71 const std::vector<uint32>& sync_points) { |
| 71 if (put_offset < 0 || put_offset > num_entries_) { | 72 if (put_offset < 0 || put_offset > num_entries_) { |
| 72 error_ = gpu::error::kOutOfBounds; | 73 error_ = gpu::error::kOutOfBounds; |
| 73 return; | 74 return; |
| 74 } | 75 } |
| 75 | 76 |
| 76 put_offset_ = put_offset; | 77 put_offset_ = put_offset; |
| 77 | 78 |
| 78 if (!put_offset_change_callback_.is_null()) | 79 if (!put_offset_change_callback_.is_null()) |
| 79 put_offset_change_callback_.Run(); | 80 put_offset_change_callback_.Run(); |
| 80 } | 81 } |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 const GetBufferChangedCallback& callback) { | 186 const GetBufferChangedCallback& callback) { |
| 186 get_buffer_change_callback_ = callback; | 187 get_buffer_change_callback_ = callback; |
| 187 } | 188 } |
| 188 | 189 |
| 189 void CommandBufferService::SetParseErrorCallback( | 190 void CommandBufferService::SetParseErrorCallback( |
| 190 const base::Closure& callback) { | 191 const base::Closure& callback) { |
| 191 parse_error_callback_ = callback; | 192 parse_error_callback_ = callback; |
| 192 } | 193 } |
| 193 | 194 |
| 194 } // namespace gpu | 195 } // namespace gpu |
| OLD | NEW |