OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/renderer/pepper_platform_context_3d_impl.h" | 5 #include "chrome/renderer/pepper_platform_context_3d_impl.h" |
6 | 6 |
7 #include "chrome/renderer/ggl/ggl.h" | 7 #include "chrome/renderer/ggl/ggl.h" |
8 #include "chrome/renderer/gpu_channel_host.h" | 8 #include "chrome/renderer/gpu_channel_host.h" |
9 #include "chrome/renderer/render_thread.h" | 9 #include "chrome/renderer/render_thread.h" |
10 | 10 |
11 #ifdef ENABLE_GPU | 11 #ifdef ENABLE_GPU |
12 PlatformContext3DImpl::PlatformContext3DImpl(ggl::Context* parent_context) | 12 PlatformContext3DImpl::PlatformContext3DImpl(ggl::Context* parent_context) |
13 : parent_context_(parent_context), | 13 : parent_context_(parent_context), |
14 context_(NULL) { | 14 context_(NULL) { |
15 } | 15 } |
16 | 16 |
17 PlatformContext3DImpl::~PlatformContext3DImpl() { | 17 PlatformContext3DImpl::~PlatformContext3DImpl() { |
18 if (context_) { | 18 if (context_) { |
19 ggl::DestroyContext(context_); | 19 ggl::DestroyContext(context_); |
20 context_ = NULL; | 20 context_ = NULL; |
21 } | 21 } |
22 } | 22 } |
23 | 23 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 } | 85 } |
86 | 86 |
87 gpu::gles2::GLES2Implementation* | 87 gpu::gles2::GLES2Implementation* |
88 PlatformContext3DImpl::GetGLES2Implementation() { | 88 PlatformContext3DImpl::GetGLES2Implementation() { |
89 DCHECK(context_); | 89 DCHECK(context_); |
90 return ggl::GetImplementation(context_); | 90 return ggl::GetImplementation(context_); |
91 } | 91 } |
92 | 92 |
93 #endif // ENABLE_GPU | 93 #endif // ENABLE_GPU |
94 | 94 |
OLD | NEW |