OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_NATIVE_VIEWPORT_ONSCREEN_CONTEXT_PROVIDER_H_ | 5 #ifndef SERVICES_NATIVE_VIEWPORT_ONSCREEN_CONTEXT_PROVIDER_H_ |
6 #define SERVICES_NATIVE_VIEWPORT_ONSCREEN_CONTEXT_PROVIDER_H_ | 6 #define SERVICES_NATIVE_VIEWPORT_ONSCREEN_CONTEXT_PROVIDER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "mojo/services/gpu/public/interfaces/context_provider.mojom.h" | 9 #include "mojo/services/gpu/public/interfaces/context_provider.mojom.h" |
10 #include "mojo/services/gpu/public/interfaces/viewport_parameter_listener.mojom. h" | 10 #include "mojo/services/gpu/public/interfaces/viewport_parameter_listener.mojom. h" |
11 #include "services/gles2/command_buffer_impl.h" | 11 #include "services/gles2/command_buffer_impl.h" |
12 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
13 #include "ui/gl/gl_surface.h" | |
13 | 14 |
14 namespace gles2 { | 15 namespace gles2 { |
15 class GpuState; | 16 class GpuState; |
16 } | 17 } |
17 | 18 |
18 namespace native_viewport { | 19 namespace native_viewport { |
19 | 20 |
20 class OnscreenContextProvider : public mojo::ContextProvider, | 21 class OnscreenContextProvider : public mojo::ContextProvider, |
21 public gles2::CommandBufferImpl::Observer { | 22 public gles2::CommandBufferImpl::Observer { |
22 public: | 23 public: |
23 explicit OnscreenContextProvider(const scoped_refptr<gles2::GpuState>& state); | 24 explicit OnscreenContextProvider(const scoped_refptr<gles2::GpuState>& state); |
24 ~OnscreenContextProvider() override; | 25 ~OnscreenContextProvider() override; |
25 | 26 |
26 void Bind(mojo::InterfaceRequest<mojo::ContextProvider> request); | 27 void Bind(mojo::InterfaceRequest<mojo::ContextProvider> request); |
27 | 28 |
28 void SetAcceleratedWidget(gfx::AcceleratedWidget widget); | 29 void SetAcceleratedWidget(gfx::AcceleratedWidget widget); |
30 void SetSurfaceConfiguration( | |
31 gfx::SurfaceConfiguration requested_configuration); | |
abarth-chromium
2015/06/09 00:30:21
const gfx::SurfaceConfiguration&
iansf
2015/06/09 01:52:04
Done.
| |
29 | 32 |
30 private: | 33 private: |
31 // mojo::ContextProvider implementation: | 34 // mojo::ContextProvider implementation: |
32 void Create(mojo::ViewportParameterListenerPtr viewport_parameter_listener, | 35 void Create(mojo::ViewportParameterListenerPtr viewport_parameter_listener, |
33 const CreateCallback& callback) override; | 36 const CreateCallback& callback) override; |
34 | 37 |
35 // gles2::CommandBufferImpl::Observer implementation: | 38 // gles2::CommandBufferImpl::Observer implementation: |
36 void OnCommandBufferImplDestroyed() override; | 39 void OnCommandBufferImplDestroyed() override; |
37 | 40 |
38 void CreateAndReturnCommandBuffer(); | 41 void CreateAndReturnCommandBuffer(); |
39 | 42 |
43 gfx::SurfaceConfiguration requested_configuration_; | |
40 gles2::CommandBufferImpl* command_buffer_impl_; | 44 gles2::CommandBufferImpl* command_buffer_impl_; |
41 scoped_refptr<gles2::GpuState> state_; | 45 scoped_refptr<gles2::GpuState> state_; |
42 gfx::AcceleratedWidget widget_; | 46 gfx::AcceleratedWidget widget_; |
43 mojo::ViewportParameterListenerPtr pending_listener_; | 47 mojo::ViewportParameterListenerPtr pending_listener_; |
44 CreateCallback pending_create_callback_; | 48 CreateCallback pending_create_callback_; |
45 mojo::Binding<mojo::ContextProvider> binding_; | 49 mojo::Binding<mojo::ContextProvider> binding_; |
46 | 50 |
47 DISALLOW_COPY_AND_ASSIGN(OnscreenContextProvider); | 51 DISALLOW_COPY_AND_ASSIGN(OnscreenContextProvider); |
48 }; | 52 }; |
49 | 53 |
50 } // namespace mojo | 54 } // namespace mojo |
51 | 55 |
52 #endif // SERVICES_NATIVE_VIEWPORT_ONSCREEN_CONTEXT_PROVIDER_H_ | 56 #endif // SERVICES_NATIVE_VIEWPORT_ONSCREEN_CONTEXT_PROVIDER_H_ |
OLD | NEW |