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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/ref_counted.h" | 8 #include "base/ref_counted.h" |
9 #include "base/weak_ptr.h" | 9 #include "base/weak_ptr.h" |
10 #include "chrome/renderer/command_buffer_proxy.h" | 10 #include "chrome/renderer/command_buffer_proxy.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 void SetError(Error error); | 116 void SetError(Error error); |
117 | 117 |
118 bool IsCommandBufferContextLost(); | 118 bool IsCommandBufferContextLost(); |
119 | 119 |
120 // TODO(gman): Remove this. | 120 // TODO(gman): Remove this. |
121 void DisableShaderTranslation(); | 121 void DisableShaderTranslation(); |
122 | 122 |
123 gpu::gles2::GLES2Implementation* gles2_implementation() const { | 123 gpu::gles2::GLES2Implementation* gles2_implementation() const { |
124 return gles2_implementation_; | 124 return gles2_implementation_; |
125 } | 125 } |
| 126 |
| 127 CommandBufferProxy* command_buffer() const { |
| 128 return command_buffer_; |
| 129 } |
| 130 |
126 private: | 131 private: |
127 void OnSwapBuffers(); | 132 void OnSwapBuffers(); |
128 | 133 |
129 scoped_refptr<GpuChannelHost> channel_; | 134 scoped_refptr<GpuChannelHost> channel_; |
130 base::WeakPtr<Context> parent_; | 135 base::WeakPtr<Context> parent_; |
131 scoped_ptr<Callback0::Type> swap_buffers_callback_; | 136 scoped_ptr<Callback0::Type> swap_buffers_callback_; |
132 uint32 parent_texture_id_; | 137 uint32 parent_texture_id_; |
133 CommandBufferProxy* command_buffer_; | 138 CommandBufferProxy* command_buffer_; |
134 gpu::gles2::GLES2CmdHelper* gles2_helper_; | 139 gpu::gles2::GLES2CmdHelper* gles2_helper_; |
135 int32 transfer_buffer_id_; | 140 int32 transfer_buffer_id_; |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 #endif | 573 #endif |
569 } | 574 } |
570 | 575 |
571 gpu::gles2::GLES2Implementation* GetImplementation(Context* context) { | 576 gpu::gles2::GLES2Implementation* GetImplementation(Context* context) { |
572 if (!context) | 577 if (!context) |
573 return NULL; | 578 return NULL; |
574 | 579 |
575 return context->gles2_implementation(); | 580 return context->gles2_implementation(); |
576 } | 581 } |
577 | 582 |
| 583 CommandBufferProxy* GetCommandBufferProxy(Context* context) { |
| 584 DCHECK(context); |
| 585 return context->command_buffer(); |
| 586 } |
| 587 |
578 } // namespace ggl | 588 } // namespace ggl |
OLD | NEW |