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 "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 |
11 #include <GLES2/gl2ext.h> | 11 #include <GLES2/gl2ext.h> |
12 #include <GLES2/gl2extchromium.h> | 12 #include <GLES2/gl2extchromium.h> |
13 | 13 |
14 #include <string> | 14 #include <string> |
15 | 15 |
16 #include "base/atomicops.h" | 16 #include "base/atomicops.h" |
17 #include "base/bind.h" | 17 #include "base/bind.h" |
18 #include "base/bind_helpers.h" | 18 #include "base/bind_helpers.h" |
19 #include "base/callback.h" | 19 #include "base/callback.h" |
20 #include "base/logging.h" | 20 #include "base/logging.h" |
21 #include "gpu/command_buffer/client/gles2_implementation.h" | 21 #include "gpu/command_buffer/client/gles2_implementation.h" |
22 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 22 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
23 #include "gpu/skia_bindings/gl_bindings_skia_cmd_buffer.h" | 23 #include "gpu/skia_bindings/gl_bindings_skia_cmd_buffer.h" |
24 #include "ui/gfx/geometry/size.h" | 24 #include "ui/gfx/geometry/size.h" |
25 #include "ui/gl/gl_implementation.h" | 25 #include "ui/gl/gl_implementation.h" |
26 | 26 |
27 using gpu::gles2::GLES2Implementation; | 27 using gpu::gles2::GLES2Implementation; |
28 using gpu::GLInProcessContext; | 28 using gpu::GLInProcessContext; |
29 | 29 |
30 namespace webkit { | 30 namespace gpu_blink { |
31 namespace gpu { | |
32 | 31 |
33 // static | 32 // static |
34 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> | 33 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> |
35 WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext( | 34 WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext( |
36 const blink::WebGraphicsContext3D::Attributes& attributes, | 35 const blink::WebGraphicsContext3D::Attributes& attributes, |
37 bool lose_context_when_out_of_memory, | 36 bool lose_context_when_out_of_memory, |
38 gfx::AcceleratedWidget window) { | 37 gfx::AcceleratedWidget window) { |
39 DCHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone); | 38 DCHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone); |
40 bool is_offscreen = false; | 39 bool is_offscreen = false; |
41 return make_scoped_ptr(new WebGraphicsContext3DInProcessCommandBufferImpl( | 40 return make_scoped_ptr(new WebGraphicsContext3DInProcessCommandBufferImpl( |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 } | 168 } |
170 | 169 |
171 void WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost() { | 170 void WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost() { |
172 // TODO(kbr): improve the precision here. | 171 // TODO(kbr): improve the precision here. |
173 context_lost_reason_ = GL_UNKNOWN_CONTEXT_RESET_ARB; | 172 context_lost_reason_ = GL_UNKNOWN_CONTEXT_RESET_ARB; |
174 if (context_lost_callback_) { | 173 if (context_lost_callback_) { |
175 context_lost_callback_->onContextLost(); | 174 context_lost_callback_->onContextLost(); |
176 } | 175 } |
177 } | 176 } |
178 | 177 |
179 } // namespace gpu | 178 } // namespace gpu_blink |
180 } // namespace webkit | |
OLD | NEW |