OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/compositor_app/compositor_host.h" | 5 #include "mojo/examples/compositor_app/compositor_host.h" |
6 | 6 |
7 #include "cc/layers/layer.h" | 7 #include "cc/layers/layer.h" |
8 #include "cc/layers/solid_color_layer.h" | 8 #include "cc/layers/solid_color_layer.h" |
9 #include "cc/output/context_provider.h" | 9 #include "cc/output/context_provider.h" |
10 #include "cc/output/output_surface.h" | 10 #include "cc/output/output_surface.h" |
11 #include "cc/trees/layer_tree_host.h" | 11 #include "cc/trees/layer_tree_host.h" |
12 #include "gpu/command_buffer/client/context_support.h" | 12 #include "gpu/command_buffer/client/context_support.h" |
13 #include "mojo/examples/compositor_app/gles2_client_impl.h" | 13 #include "mojo/examples/compositor_app/gles2_client_impl.h" |
14 | 14 |
15 namespace mojo { | 15 namespace mojo { |
16 namespace examples { | 16 namespace examples { |
17 | 17 |
18 class MojoContextProvider : public cc::ContextProvider { | 18 class MojoContextProvider : public cc::ContextProvider { |
19 public: | 19 public: |
20 explicit MojoContextProvider(GLES2ClientImpl* gles2_client_impl) | 20 explicit MojoContextProvider(GLES2ClientImpl* gles2_client_impl) |
21 : gles2_client_impl_(gles2_client_impl) {} | 21 : gles2_client_impl_(gles2_client_impl) {} |
22 | 22 |
23 // cc::ContextProvider implementation. | 23 // cc::ContextProvider implementation. |
24 virtual bool BindToCurrentThread() OVERRIDE { return true; } | 24 virtual bool BindToCurrentThread() OVERRIDE { return true; } |
25 virtual blink::WebGraphicsContext3D* Context3d() OVERRIDE { return NULL; } | |
26 virtual gpu::gles2::GLES2Interface* ContextGL() OVERRIDE { | 25 virtual gpu::gles2::GLES2Interface* ContextGL() OVERRIDE { |
27 return gles2_client_impl_->Interface(); | 26 return gles2_client_impl_->Interface(); |
28 } | 27 } |
29 virtual gpu::ContextSupport* ContextSupport() OVERRIDE { | 28 virtual gpu::ContextSupport* ContextSupport() OVERRIDE { |
30 return gles2_client_impl_->Support(); | 29 return gles2_client_impl_->Support(); |
31 } | 30 } |
32 virtual class GrContext* GrContext() OVERRIDE { return NULL; } | 31 virtual class GrContext* GrContext() OVERRIDE { return NULL; } |
33 virtual void MakeGrContextCurrent() OVERRIDE {} | 32 virtual void MakeGrContextCurrent() OVERRIDE {} |
34 virtual Capabilities ContextCapabilities() OVERRIDE { return capabilities_; } | 33 virtual Capabilities ContextCapabilities() OVERRIDE { return capabilities_; } |
35 virtual bool IsContextLost() OVERRIDE { | 34 virtual bool IsContextLost() OVERRIDE { |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 void CompositorHost::DidCommit() {} | 121 void CompositorHost::DidCommit() {} |
123 void CompositorHost::DidCommitAndDrawFrame() {} | 122 void CompositorHost::DidCommitAndDrawFrame() {} |
124 void CompositorHost::DidCompleteSwapBuffers() {} | 123 void CompositorHost::DidCompleteSwapBuffers() {} |
125 | 124 |
126 scoped_refptr<cc::ContextProvider> CompositorHost::OffscreenContextProvider() { | 125 scoped_refptr<cc::ContextProvider> CompositorHost::OffscreenContextProvider() { |
127 return NULL; | 126 return NULL; |
128 } | 127 } |
129 | 128 |
130 } // namespace examples | 129 } // namespace examples |
131 } // namespace mojo | 130 } // namespace mojo |
OLD | NEW |