| 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.h" | 5 #include "content/renderer/pepper/pepper_platform_context_3d.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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 CommandBufferProxyImpl* share_buffer = NULL; | 89 CommandBufferProxyImpl* share_buffer = NULL; |
| 90 if (share_context) { | 90 if (share_context) { |
| 91 PlatformContext3D* share_impl = | 91 PlatformContext3D* share_impl = |
| 92 static_cast<PlatformContext3D*>(share_context); | 92 static_cast<PlatformContext3D*>(share_context); |
| 93 share_buffer = share_impl->command_buffer_; | 93 share_buffer = share_impl->command_buffer_; |
| 94 } | 94 } |
| 95 | 95 |
| 96 command_buffer_ = channel_->CreateOffscreenCommandBuffer( | 96 command_buffer_ = channel_->CreateOffscreenCommandBuffer( |
| 97 surface_size, | 97 surface_size, |
| 98 share_buffer, | 98 share_buffer, |
| 99 "*", | |
| 100 attribs, | 99 attribs, |
| 101 GURL::EmptyGURL(), | 100 GURL::EmptyGURL(), |
| 102 gpu_preference); | 101 gpu_preference); |
| 103 if (!command_buffer_) | 102 if (!command_buffer_) |
| 104 return false; | 103 return false; |
| 105 if (!command_buffer_->Initialize()) | 104 if (!command_buffer_->Initialize()) |
| 106 return false; | 105 return false; |
| 107 std::vector<gpu::Mailbox> names; | 106 std::vector<gpu::Mailbox> names; |
| 108 if (!command_buffer_->GenerateMailboxNames(1, &names)) | 107 if (!command_buffer_->GenerateMailboxNames(1, &names)) |
| 109 return false; | 108 return false; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 void PlatformContext3D::OnConsoleMessage(const std::string& msg, int id) { | 162 void PlatformContext3D::OnConsoleMessage(const std::string& msg, int id) { |
| 164 DCHECK(command_buffer_); | 163 DCHECK(command_buffer_); |
| 165 | 164 |
| 166 if (!console_message_callback_.is_null()) | 165 if (!console_message_callback_.is_null()) |
| 167 console_message_callback_.Run(msg, id); | 166 console_message_callback_.Run(msg, id); |
| 168 } | 167 } |
| 169 | 168 |
| 170 } // namespace content | 169 } // namespace content |
| 171 | 170 |
| 172 #endif // ENABLE_GPU | 171 #endif // ENABLE_GPU |
| OLD | NEW |