| 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/blink/webgraphicscontext3d_in_process_command_buffer_impl.h" | 5 #include "gpu/blink/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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 window_(window), | 86 window_(window), |
| 87 context_(context.Pass()) { | 87 context_(context.Pass()) { |
| 88 ConvertAttributes(attributes, &attribs_); | 88 ConvertAttributes(attributes, &attribs_); |
| 89 attribs_.lose_context_when_out_of_memory = lose_context_when_out_of_memory; | 89 attribs_.lose_context_when_out_of_memory = lose_context_when_out_of_memory; |
| 90 } | 90 } |
| 91 | 91 |
| 92 WebGraphicsContext3DInProcessCommandBufferImpl:: | 92 WebGraphicsContext3DInProcessCommandBufferImpl:: |
| 93 ~WebGraphicsContext3DInProcessCommandBufferImpl() { | 93 ~WebGraphicsContext3DInProcessCommandBufferImpl() { |
| 94 } | 94 } |
| 95 | 95 |
| 96 size_t WebGraphicsContext3DInProcessCommandBufferImpl::GetMappedMemoryLimit() { | |
| 97 return context_->GetMappedMemoryLimit(); | |
| 98 } | |
| 99 | |
| 100 bool WebGraphicsContext3DInProcessCommandBufferImpl::MaybeInitializeGL() { | 96 bool WebGraphicsContext3DInProcessCommandBufferImpl::MaybeInitializeGL() { |
| 101 if (initialized_) | 97 if (initialized_) |
| 102 return true; | 98 return true; |
| 103 | 99 |
| 104 if (initialize_failed_) | 100 if (initialize_failed_) |
| 105 return false; | 101 return false; |
| 106 | 102 |
| 107 if (!context_) { | 103 if (!context_) { |
| 108 // TODO(kbr): More work will be needed in this implementation to | 104 // TODO(kbr): More work will be needed in this implementation to |
| 109 // properly support GPU switching. Like in the out-of-process | 105 // properly support GPU switching. Like in the out-of-process |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 return real_gl_; | 155 return real_gl_; |
| 160 } | 156 } |
| 161 | 157 |
| 162 void WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost() { | 158 void WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost() { |
| 163 if (context_lost_callback_) { | 159 if (context_lost_callback_) { |
| 164 context_lost_callback_->onContextLost(); | 160 context_lost_callback_->onContextLost(); |
| 165 } | 161 } |
| 166 } | 162 } |
| 167 | 163 |
| 168 } // namespace gpu_blink | 164 } // namespace gpu_blink |
| OLD | NEW |