| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/hash.h" | 9 #include "base/hash.h" |
| 10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 } // namespace | 102 } // namespace |
| 103 | 103 |
| 104 GpuCommandBufferStub::GpuCommandBufferStub( | 104 GpuCommandBufferStub::GpuCommandBufferStub( |
| 105 GpuChannel* channel, | 105 GpuChannel* channel, |
| 106 GpuCommandBufferStub* share_group, | 106 GpuCommandBufferStub* share_group, |
| 107 const gfx::GLSurfaceHandle& handle, | 107 const gfx::GLSurfaceHandle& handle, |
| 108 gpu::gles2::MailboxManager* mailbox_manager, | 108 gpu::gles2::MailboxManager* mailbox_manager, |
| 109 gpu::gles2::ImageManager* image_manager, | 109 gpu::gles2::ImageManager* image_manager, |
| 110 const gfx::Size& size, | 110 const gfx::Size& size, |
| 111 const gpu::gles2::DisallowedFeatures& disallowed_features, | 111 const gpu::gles2::DisallowedFeatures& disallowed_features, |
| 112 const std::string& allowed_extensions, | |
| 113 const std::vector<int32>& attribs, | 112 const std::vector<int32>& attribs, |
| 114 gfx::GpuPreference gpu_preference, | 113 gfx::GpuPreference gpu_preference, |
| 115 bool use_virtualized_gl_context, | 114 bool use_virtualized_gl_context, |
| 116 int32 route_id, | 115 int32 route_id, |
| 117 int32 surface_id, | 116 int32 surface_id, |
| 118 GpuWatchdog* watchdog, | 117 GpuWatchdog* watchdog, |
| 119 bool software, | 118 bool software, |
| 120 const GURL& active_url) | 119 const GURL& active_url) |
| 121 : channel_(channel), | 120 : channel_(channel), |
| 122 handle_(handle), | 121 handle_(handle), |
| 123 initial_size_(size), | 122 initial_size_(size), |
| 124 disallowed_features_(disallowed_features), | 123 disallowed_features_(disallowed_features), |
| 125 allowed_extensions_(allowed_extensions), | |
| 126 requested_attribs_(attribs), | 124 requested_attribs_(attribs), |
| 127 gpu_preference_(gpu_preference), | 125 gpu_preference_(gpu_preference), |
| 128 use_virtualized_gl_context_(use_virtualized_gl_context), | 126 use_virtualized_gl_context_(use_virtualized_gl_context), |
| 129 route_id_(route_id), | 127 route_id_(route_id), |
| 130 surface_id_(surface_id), | 128 surface_id_(surface_id), |
| 131 software_(software), | 129 software_(software), |
| 132 last_flush_count_(0), | 130 last_flush_count_(0), |
| 133 last_memory_allocation_valid_(false), | 131 last_memory_allocation_valid_(false), |
| 134 watchdog_(watchdog), | 132 watchdog_(watchdog), |
| 135 sync_point_wait_count_(0), | 133 sync_point_wait_count_(0), |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 context_group_->set_program_cache( | 494 context_group_->set_program_cache( |
| 497 channel_->gpu_channel_manager()->program_cache()); | 495 channel_->gpu_channel_manager()->program_cache()); |
| 498 } | 496 } |
| 499 | 497 |
| 500 // Initialize the decoder with either the view or pbuffer GLContext. | 498 // Initialize the decoder with either the view or pbuffer GLContext. |
| 501 if (!decoder_->Initialize(surface_, | 499 if (!decoder_->Initialize(surface_, |
| 502 context, | 500 context, |
| 503 !surface_id(), | 501 !surface_id(), |
| 504 initial_size_, | 502 initial_size_, |
| 505 disallowed_features_, | 503 disallowed_features_, |
| 506 allowed_extensions_.c_str(), | |
| 507 requested_attribs_)) { | 504 requested_attribs_)) { |
| 508 DLOG(ERROR) << "Failed to initialize decoder."; | 505 DLOG(ERROR) << "Failed to initialize decoder."; |
| 509 OnInitializeFailed(reply_message); | 506 OnInitializeFailed(reply_message); |
| 510 return; | 507 return; |
| 511 } | 508 } |
| 512 | 509 |
| 513 if (CommandLine::ForCurrentProcess()->HasSwitch( | 510 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 514 switches::kEnableGPUServiceLogging)) { | 511 switches::kEnableGPUServiceLogging)) { |
| 515 decoder_->set_log_commands(true); | 512 decoder_->set_log_commands(true); |
| 516 } | 513 } |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 command_buffer_->GetState().error == gpu::error::kLostContext) | 953 command_buffer_->GetState().error == gpu::error::kLostContext) |
| 957 return; | 954 return; |
| 958 | 955 |
| 959 command_buffer_->SetContextLostReason(gpu::error::kUnknown); | 956 command_buffer_->SetContextLostReason(gpu::error::kUnknown); |
| 960 if (decoder_) | 957 if (decoder_) |
| 961 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); | 958 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); |
| 962 command_buffer_->SetParseError(gpu::error::kLostContext); | 959 command_buffer_->SetParseError(gpu::error::kLostContext); |
| 963 } | 960 } |
| 964 | 961 |
| 965 } // namespace content | 962 } // namespace content |
| OLD | NEW |