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/ipc/service/gpu_command_buffer_stub.h" | 5 #include "gpu/ipc/service/gpu_command_buffer_stub.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
824 if (!shared_state_shm->Map(kSharedStateSize)) { | 824 if (!shared_state_shm->Map(kSharedStateSize)) { |
825 DLOG(ERROR) << "Failed to map shared state buffer."; | 825 DLOG(ERROR) << "Failed to map shared state buffer."; |
826 return false; | 826 return false; |
827 } | 827 } |
828 command_buffer_->SetSharedStateBuffer(MakeBackingFromSharedMemory( | 828 command_buffer_->SetSharedStateBuffer(MakeBackingFromSharedMemory( |
829 std::move(shared_state_shm), kSharedStateSize)); | 829 std::move(shared_state_shm), kSharedStateSize)); |
830 | 830 |
831 if (offscreen && !active_url_.is_empty()) | 831 if (offscreen && !active_url_.is_empty()) |
832 manager->delegate()->DidCreateOffscreenContext(active_url_); | 832 manager->delegate()->DidCreateOffscreenContext(active_url_); |
833 | 833 |
834 if (use_virtualized_gl_context_) { | |
835 // If virtualized GL contexts are in use, then real GL context state | |
836 // is in an indeterminate state, since the GLStateRestorer was not | |
837 // initialized at the time the GLContextVirtual was made current. In | |
838 // the case that this command decoder is the next one to be | |
839 // processed, force a "full" MakeCurrent to be performed. Note that | |
840 // GpuChannel's initialization of the gpu::Capabilities expects the | |
841 // context to be left current. | |
842 context->ReleaseCurrent(surface_.get()); | |
843 if (!context->MakeCurrent(surface_.get())) { | |
jbauman
2017/05/03 00:53:03
I think this has to go after "initialized_ = true"
| |
844 LOG(ERROR) << "Failed to make context current after initialization."; | |
845 return false; | |
846 } | |
847 } | |
848 | |
834 initialized_ = true; | 849 initialized_ = true; |
835 return true; | 850 return true; |
836 } | 851 } |
837 | 852 |
838 void GpuCommandBufferStub::OnCreateStreamTexture(uint32_t texture_id, | 853 void GpuCommandBufferStub::OnCreateStreamTexture(uint32_t texture_id, |
839 int32_t stream_id, | 854 int32_t stream_id, |
840 bool* succeeded) { | 855 bool* succeeded) { |
841 #if defined(OS_ANDROID) | 856 #if defined(OS_ANDROID) |
842 *succeeded = StreamTexture::Create(this, texture_id, stream_id); | 857 *succeeded = StreamTexture::Create(this, texture_id, stream_id); |
843 #else | 858 #else |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1238 command_buffer_->GetLastState().error == error::kLostContext) | 1253 command_buffer_->GetLastState().error == error::kLostContext) |
1239 return; | 1254 return; |
1240 | 1255 |
1241 command_buffer_->SetContextLostReason(error::kUnknown); | 1256 command_buffer_->SetContextLostReason(error::kUnknown); |
1242 if (decoder_) | 1257 if (decoder_) |
1243 decoder_->MarkContextLost(error::kUnknown); | 1258 decoder_->MarkContextLost(error::kUnknown); |
1244 command_buffer_->SetParseError(error::kLostContext); | 1259 command_buffer_->SetParseError(error::kLostContext); |
1245 } | 1260 } |
1246 | 1261 |
1247 } // namespace gpu | 1262 } // namespace gpu |
OLD | NEW |