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 "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" | 5 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" |
6 | 6 |
7 #include <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
8 #ifndef GL_GLEXT_PROTOTYPES | 8 #ifndef GL_GLEXT_PROTOTYPES |
9 #define GL_GLEXT_PROTOTYPES 1 | 9 #define GL_GLEXT_PROTOTYPES 1 |
10 #endif | 10 #endif |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 context_.reset(GLInProcessContext::Create( | 115 context_.reset(GLInProcessContext::Create( |
116 NULL, /* service */ | 116 NULL, /* service */ |
117 NULL, /* surface */ | 117 NULL, /* surface */ |
118 is_offscreen_, | 118 is_offscreen_, |
119 window_, | 119 window_, |
120 gfx::Size(1, 1), | 120 gfx::Size(1, 1), |
121 NULL, /* share_context */ | 121 NULL, /* share_context */ |
122 share_resources_, | 122 share_resources_, |
123 attribs_, | 123 attribs_, |
124 gpu_preference, | 124 gpu_preference, |
125 ::gpu::GLInProcessContextSharedMemoryLimits())); | 125 ::gpu::GLInProcessContextSharedMemoryLimits(), |
| 126 nullptr, |
| 127 nullptr)); |
126 } | 128 } |
127 | 129 |
128 if (context_) { | 130 if (context_) { |
129 base::Closure context_lost_callback = base::Bind( | 131 base::Closure context_lost_callback = base::Bind( |
130 &WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost, | 132 &WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost, |
131 base::Unretained(this)); | 133 base::Unretained(this)); |
132 context_->SetContextLostCallback(context_lost_callback); | 134 context_->SetContextLostCallback(context_lost_callback); |
133 } else { | 135 } else { |
134 initialize_failed_ = true; | 136 initialize_failed_ = true; |
135 return false; | 137 return false; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 void WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost() { | 171 void WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost() { |
170 // TODO(kbr): improve the precision here. | 172 // TODO(kbr): improve the precision here. |
171 context_lost_reason_ = GL_UNKNOWN_CONTEXT_RESET_ARB; | 173 context_lost_reason_ = GL_UNKNOWN_CONTEXT_RESET_ARB; |
172 if (context_lost_callback_) { | 174 if (context_lost_callback_) { |
173 context_lost_callback_->onContextLost(); | 175 context_lost_callback_->onContextLost(); |
174 } | 176 } |
175 } | 177 } |
176 | 178 |
177 } // namespace gpu | 179 } // namespace gpu |
178 } // namespace webkit | 180 } // namespace webkit |
OLD | NEW |