| 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/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 13778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13789 return error::kNoError; | 13789 return error::kNoError; |
| 13790 } | 13790 } |
| 13791 | 13791 |
| 13792 deschedule_until_finished_fence_.reset(gl::GLFence::Create()); | 13792 deschedule_until_finished_fence_.reset(gl::GLFence::Create()); |
| 13793 DCHECK(deschedule_until_finished_fence_); | 13793 DCHECK(deschedule_until_finished_fence_); |
| 13794 if (deschedule_until_finished_fence_->HasCompleted()) { | 13794 if (deschedule_until_finished_fence_->HasCompleted()) { |
| 13795 deschedule_until_finished_fence_.reset(); | 13795 deschedule_until_finished_fence_.reset(); |
| 13796 return error::kNoError; | 13796 return error::kNoError; |
| 13797 } | 13797 } |
| 13798 | 13798 |
| 13799 TRACE_EVENT_ASYNC_BEGIN0("cc", "GLES2DecoderImpl::DescheduleUntilFinished", |
| 13800 this); |
| 13799 deschedule_until_finished_callback_.Run(); | 13801 deschedule_until_finished_callback_.Run(); |
| 13800 return error::kDeferLaterCommands; | 13802 return error::kDeferLaterCommands; |
| 13801 } | 13803 } |
| 13802 | 13804 |
| 13803 error::Error GLES2DecoderImpl::HandleInsertFenceSyncCHROMIUM( | 13805 error::Error GLES2DecoderImpl::HandleInsertFenceSyncCHROMIUM( |
| 13804 uint32_t immediate_data_size, | 13806 uint32_t immediate_data_size, |
| 13805 const void* cmd_data) { | 13807 const void* cmd_data) { |
| 13806 const gles2::cmds::InsertFenceSyncCHROMIUM& c = | 13808 const gles2::cmds::InsertFenceSyncCHROMIUM& c = |
| 13807 *static_cast<const gles2::cmds::InsertFenceSyncCHROMIUM*>(cmd_data); | 13809 *static_cast<const gles2::cmds::InsertFenceSyncCHROMIUM*>(cmd_data); |
| 13808 | 13810 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13926 } | 13928 } |
| 13927 } | 13929 } |
| 13928 | 13930 |
| 13929 void GLES2DecoderImpl::ProcessDescheduleUntilFinished() { | 13931 void GLES2DecoderImpl::ProcessDescheduleUntilFinished() { |
| 13930 if (!deschedule_until_finished_fence_) | 13932 if (!deschedule_until_finished_fence_) |
| 13931 return; | 13933 return; |
| 13932 | 13934 |
| 13933 if (!deschedule_until_finished_fence_->HasCompleted()) | 13935 if (!deschedule_until_finished_fence_->HasCompleted()) |
| 13934 return; | 13936 return; |
| 13935 | 13937 |
| 13938 TRACE_EVENT_ASYNC_END0("cc", "GLES2DecoderImpl::DescheduleUntilFinished", |
| 13939 this); |
| 13936 deschedule_until_finished_fence_.reset(); | 13940 deschedule_until_finished_fence_.reset(); |
| 13937 reschedule_after_finished_callback_.Run(); | 13941 reschedule_after_finished_callback_.Run(); |
| 13938 } | 13942 } |
| 13939 | 13943 |
| 13940 bool GLES2DecoderImpl::HasMoreIdleWork() const { | 13944 bool GLES2DecoderImpl::HasMoreIdleWork() const { |
| 13941 return deschedule_until_finished_fence_ || | 13945 return deschedule_until_finished_fence_ || |
| 13942 !pending_readpixel_fences_.empty() || | 13946 !pending_readpixel_fences_.empty() || |
| 13943 gpu_tracer_->HasTracesToProcess(); | 13947 gpu_tracer_->HasTracesToProcess(); |
| 13944 } | 13948 } |
| 13945 | 13949 |
| (...skipping 2929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16875 } | 16879 } |
| 16876 | 16880 |
| 16877 // Include the auto-generated part of this file. We split this because it means | 16881 // Include the auto-generated part of this file. We split this because it means |
| 16878 // we can easily edit the non-auto generated parts right here in this file | 16882 // we can easily edit the non-auto generated parts right here in this file |
| 16879 // instead of having to edit some template or the code generator. | 16883 // instead of having to edit some template or the code generator. |
| 16880 #include "base/macros.h" | 16884 #include "base/macros.h" |
| 16881 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 16885 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 16882 | 16886 |
| 16883 } // namespace gles2 | 16887 } // namespace gles2 |
| 16884 } // namespace gpu | 16888 } // namespace gpu |
| OLD | NEW |