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/services/view_manager/context_factory_impl.h" | 5 #include "mojo/services/view_manager/context_factory_impl.h" |
6 | 6 |
7 #include "cc/output/output_surface.h" | 7 #include "cc/output/output_surface.h" |
| 8 #include "cc/surfaces/surface_id_allocator.h" |
8 #include "mojo/cc/context_provider_mojo.h" | 9 #include "mojo/cc/context_provider_mojo.h" |
9 #include "ui/compositor/reflector.h" | 10 #include "ui/compositor/reflector.h" |
10 #include "ui/gl/gl_implementation.h" | 11 #include "ui/gl/gl_implementation.h" |
11 #include "ui/gl/gl_surface.h" | 12 #include "ui/gl/gl_surface.h" |
12 #include "webkit/common/gpu/context_provider_in_process.h" | 13 #include "webkit/common/gpu/context_provider_in_process.h" |
13 #include "webkit/common/gpu/grcontext_for_webgraphicscontext3d.h" | 14 #include "webkit/common/gpu/grcontext_for_webgraphicscontext3d.h" |
14 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" | 15 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" |
15 | 16 |
16 namespace mojo { | 17 namespace mojo { |
17 namespace service { | 18 namespace service { |
18 | 19 |
19 ContextFactoryImpl::ContextFactoryImpl( | 20 ContextFactoryImpl::ContextFactoryImpl( |
20 ScopedMessagePipeHandle command_buffer_handle) | 21 ScopedMessagePipeHandle command_buffer_handle) |
21 : command_buffer_handle_(command_buffer_handle.Pass()), | 22 : command_buffer_handle_(command_buffer_handle.Pass()), |
| 23 next_surface_id_namespace_(0), |
22 did_create_(false) { | 24 did_create_(false) { |
23 DCHECK(command_buffer_handle_.is_valid()); | 25 DCHECK(command_buffer_handle_.is_valid()); |
24 } | 26 } |
25 | 27 |
26 ContextFactoryImpl::~ContextFactoryImpl() { | 28 ContextFactoryImpl::~ContextFactoryImpl() { |
27 } | 29 } |
28 | 30 |
29 scoped_ptr<cc::OutputSurface> ContextFactoryImpl::CreateOutputSurface( | 31 scoped_ptr<cc::OutputSurface> ContextFactoryImpl::CreateOutputSurface( |
30 ui::Compositor* compositor, bool software_fallback) { | 32 ui::Compositor* compositor, bool software_fallback) { |
31 DCHECK(!did_create_); | 33 DCHECK(!did_create_); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 bool ContextFactoryImpl::DoesCreateTestContexts() { return false; } | 69 bool ContextFactoryImpl::DoesCreateTestContexts() { return false; } |
68 | 70 |
69 cc::SharedBitmapManager* ContextFactoryImpl::GetSharedBitmapManager() { | 71 cc::SharedBitmapManager* ContextFactoryImpl::GetSharedBitmapManager() { |
70 return NULL; | 72 return NULL; |
71 } | 73 } |
72 | 74 |
73 base::MessageLoopProxy* ContextFactoryImpl::GetCompositorMessageLoop() { | 75 base::MessageLoopProxy* ContextFactoryImpl::GetCompositorMessageLoop() { |
74 return NULL; | 76 return NULL; |
75 } | 77 } |
76 | 78 |
| 79 scoped_ptr<cc::SurfaceIdAllocator> |
| 80 ContextFactoryImpl::CreateSurfaceIdAllocator() { |
| 81 return make_scoped_ptr( |
| 82 new cc::SurfaceIdAllocator(next_surface_id_namespace_++)); |
| 83 } |
| 84 |
77 } // namespace service | 85 } // namespace service |
78 } // namespace mojo | 86 } // namespace mojo |
OLD | NEW |