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 #include "mojo/examples/aura_demo/demo_context_factory.h" | 5 #include "mojo/examples/aura_demo/demo_context_factory.h" |
6 | 6 |
7 #include "cc/output/context_provider.h" | 7 #include "cc/output/context_provider.h" |
8 #include "cc/output/output_surface.h" | 8 #include "cc/output/output_surface.h" |
9 #include "mojo/examples/aura_demo/root_window_host_mojo.h" | 9 #include "mojo/examples/aura_demo/root_window_host_mojo.h" |
10 #include "mojo/examples/compositor_app/gles2_client_impl.h" | 10 #include "mojo/examples/compositor_app/gles2_client_impl.h" |
11 #include "ui/compositor/reflector.h" | 11 #include "ui/compositor/reflector.h" |
12 #include "ui/gl/gl_implementation.h" | 12 #include "ui/gl/gl_implementation.h" |
13 #include "ui/gl/gl_surface.h" | 13 #include "ui/gl/gl_surface.h" |
14 #include "webkit/common/gpu/context_provider_in_process.h" | 14 #include "webkit/common/gpu/context_provider_in_process.h" |
15 #include "webkit/common/gpu/grcontext_for_webgraphicscontext3d.h" | 15 #include "webkit/common/gpu/grcontext_for_webgraphicscontext3d.h" |
16 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" | 16 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" |
17 | 17 |
18 namespace mojo { | 18 namespace mojo { |
19 namespace examples { | 19 namespace examples { |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 class MojoContextProvider : public cc::ContextProvider { | 23 class MojoContextProvider : public cc::ContextProvider { |
24 public: | 24 public: |
25 explicit MojoContextProvider(GLES2ClientImpl* gles2_client_impl) | 25 explicit MojoContextProvider(GLES2ClientImpl* gles2_client_impl) |
26 : gles2_client_impl_(gles2_client_impl) {} | 26 : gles2_client_impl_(gles2_client_impl) {} |
27 | 27 |
28 // cc::ContextProvider implementation. | 28 // cc::ContextProvider implementation. |
29 virtual bool BindToCurrentThread() OVERRIDE { return true; } | 29 virtual bool BindToCurrentThread() OVERRIDE { return true; } |
30 virtual blink::WebGraphicsContext3D* Context3d() OVERRIDE { return NULL; } | |
31 virtual gpu::gles2::GLES2Interface* ContextGL() OVERRIDE { | 30 virtual gpu::gles2::GLES2Interface* ContextGL() OVERRIDE { |
32 return gles2_client_impl_->Interface(); | 31 return gles2_client_impl_->Interface(); |
33 } | 32 } |
34 virtual gpu::ContextSupport* ContextSupport() OVERRIDE { | 33 virtual gpu::ContextSupport* ContextSupport() OVERRIDE { |
35 return gles2_client_impl_->Support(); | 34 return gles2_client_impl_->Support(); |
36 } | 35 } |
37 virtual class GrContext* GrContext() OVERRIDE { return NULL; } | 36 virtual class GrContext* GrContext() OVERRIDE { return NULL; } |
38 virtual void MakeGrContextCurrent() OVERRIDE {} | 37 virtual void MakeGrContextCurrent() OVERRIDE {} |
39 virtual Capabilities ContextCapabilities() OVERRIDE { return capabilities_; } | 38 virtual Capabilities ContextCapabilities() OVERRIDE { return capabilities_; } |
40 virtual bool IsContextLost() OVERRIDE { | 39 virtual bool IsContextLost() OVERRIDE { |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 } | 123 } |
125 | 124 |
126 void DemoContextFactory::RemoveCompositor(ui::Compositor* compositor) { | 125 void DemoContextFactory::RemoveCompositor(ui::Compositor* compositor) { |
127 } | 126 } |
128 | 127 |
129 bool DemoContextFactory::DoesCreateTestContexts() { return false; } | 128 bool DemoContextFactory::DoesCreateTestContexts() { return false; } |
130 | 129 |
131 } // namespace examples | 130 } // namespace examples |
132 } // namespace mojo | 131 } // namespace mojo |
133 | 132 |
OLD | NEW |