| 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 "content/renderer/pepper/pepper_platform_context_3d_impl.h" | 5 #include "content/renderer/pepper/pepper_platform_context_3d_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "content/common/gpu/client/context_provider_command_buffer.h" | 8 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 9 #include "content/common/gpu/client/gpu_channel_host.h" | 9 #include "content/common/gpu/client/gpu_channel_host.h" |
| 10 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 10 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 static_cast<PlatformContext3DImpl*>(share_context); | 96 static_cast<PlatformContext3DImpl*>(share_context); |
| 97 share_buffer = share_impl->command_buffer_; | 97 share_buffer = share_impl->command_buffer_; |
| 98 } | 98 } |
| 99 | 99 |
| 100 command_buffer_ = channel_->CreateOffscreenCommandBuffer( | 100 command_buffer_ = channel_->CreateOffscreenCommandBuffer( |
| 101 surface_size, | 101 surface_size, |
| 102 share_buffer, | 102 share_buffer, |
| 103 "*", | 103 "*", |
| 104 attribs, | 104 attribs, |
| 105 GURL::EmptyGURL(), | 105 GURL::EmptyGURL(), |
| 106 false, |
| 106 gpu_preference); | 107 gpu_preference); |
| 107 if (!command_buffer_) | 108 if (!command_buffer_) |
| 108 return false; | 109 return false; |
| 109 | 110 |
| 110 command_buffer_->SetChannelErrorCallback( | 111 command_buffer_->SetChannelErrorCallback( |
| 111 base::Bind(&PlatformContext3DImpl::OnContextLost, | 112 base::Bind(&PlatformContext3DImpl::OnContextLost, |
| 112 weak_ptr_factory_.GetWeakPtr())); | 113 weak_ptr_factory_.GetWeakPtr())); |
| 113 command_buffer_->SetOnConsoleMessageCallback( | 114 command_buffer_->SetOnConsoleMessageCallback( |
| 114 base::Bind(&PlatformContext3DImpl::OnConsoleMessage, | 115 base::Bind(&PlatformContext3DImpl::OnConsoleMessage, |
| 115 weak_ptr_factory_.GetWeakPtr())); | 116 weak_ptr_factory_.GetWeakPtr())); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 void PlatformContext3DImpl::OnConsoleMessage(const std::string& msg, int id) { | 210 void PlatformContext3DImpl::OnConsoleMessage(const std::string& msg, int id) { |
| 210 DCHECK(command_buffer_); | 211 DCHECK(command_buffer_); |
| 211 | 212 |
| 212 if (!console_message_callback_.is_null()) | 213 if (!console_message_callback_.is_null()) |
| 213 console_message_callback_.Run(msg, id); | 214 console_message_callback_.Run(msg, id); |
| 214 } | 215 } |
| 215 | 216 |
| 216 } // namespace content | 217 } // namespace content |
| 217 | 218 |
| 218 #endif // ENABLE_GPU | 219 #endif // ENABLE_GPU |
| OLD | NEW |