OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef SERVICES_UI_PUBLIC_CPP_GLES2_CONTEXT_H_ | 5 #ifndef SERVICES_UI_PUBLIC_CPP_GLES2_CONTEXT_H_ |
6 #define SERVICES_UI_PUBLIC_CPP_GLES2_CONTEXT_H_ | 6 #define SERVICES_UI_PUBLIC_CPP_GLES2_CONTEXT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 class GLES2Context { | 30 class GLES2Context { |
31 public: | 31 public: |
32 ~GLES2Context(); | 32 ~GLES2Context(); |
33 gpu::gles2::GLES2Interface* interface() const { | 33 gpu::gles2::GLES2Interface* interface() const { |
34 return implementation_.get(); | 34 return implementation_.get(); |
35 } | 35 } |
36 gpu::ContextSupport* context_support() const { return implementation_.get(); } | 36 gpu::ContextSupport* context_support() const { return implementation_.get(); } |
37 | 37 |
38 static std::unique_ptr<GLES2Context> CreateOffscreenContext( | 38 static std::unique_ptr<GLES2Context> CreateOffscreenContext( |
39 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host); | 39 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, |
| 40 scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
40 | 41 |
41 private: | 42 private: |
42 GLES2Context(); | 43 GLES2Context(); |
43 bool Initialize(scoped_refptr<gpu::GpuChannelHost> gpu_channel_host); | 44 bool Initialize(scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, |
| 45 scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
44 | 46 |
45 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_proxy_impl_; | 47 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_proxy_impl_; |
46 std::unique_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; | 48 std::unique_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; |
47 std::unique_ptr<gpu::TransferBuffer> transfer_buffer_; | 49 std::unique_ptr<gpu::TransferBuffer> transfer_buffer_; |
48 std::unique_ptr<gpu::gles2::GLES2Implementation> implementation_; | 50 std::unique_ptr<gpu::gles2::GLES2Implementation> implementation_; |
49 | 51 |
50 DISALLOW_COPY_AND_ASSIGN(GLES2Context); | 52 DISALLOW_COPY_AND_ASSIGN(GLES2Context); |
51 }; | 53 }; |
52 | 54 |
53 } // namespace ui | 55 } // namespace ui |
54 | 56 |
55 #endif // SERVICES_UI_PUBLIC_CPP_GLES2_CONTEXT_H_ | 57 #endif // SERVICES_UI_PUBLIC_CPP_GLES2_CONTEXT_H_ |
OLD | NEW |