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 "ui/compositor/test/in_process_context_factory.h" | 5 #include "ui/compositor/test/in_process_context_factory.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/threading/thread.h" | 8 #include "base/threading/thread.h" |
9 #include "cc/output/output_surface.h" | |
10 #include "cc/surfaces/surface_id_allocator.h" | 9 #include "cc/surfaces/surface_id_allocator.h" |
| 10 #include "cc/test/pixel_test_output_surface.h" |
11 #include "cc/test/test_shared_bitmap_manager.h" | 11 #include "cc/test/test_shared_bitmap_manager.h" |
12 #include "ui/compositor/compositor_switches.h" | 12 #include "ui/compositor/compositor_switches.h" |
13 #include "ui/compositor/reflector.h" | 13 #include "ui/compositor/reflector.h" |
14 #include "ui/gl/gl_implementation.h" | 14 #include "ui/gl/gl_implementation.h" |
15 #include "ui/gl/gl_surface.h" | 15 #include "ui/gl/gl_surface.h" |
16 #include "webkit/common/gpu/context_provider_in_process.h" | 16 #include "webkit/common/gpu/context_provider_in_process.h" |
17 #include "webkit/common/gpu/grcontext_for_webgraphicscontext3d.h" | 17 #include "webkit/common/gpu/grcontext_for_webgraphicscontext3d.h" |
18 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" | 18 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" |
19 | 19 |
20 namespace ui { | 20 namespace ui { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl; | 54 using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl; |
55 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d( | 55 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d( |
56 WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext( | 56 WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext( |
57 attrs, lose_context_when_out_of_memory, compositor->widget())); | 57 attrs, lose_context_when_out_of_memory, compositor->widget())); |
58 CHECK(context3d); | 58 CHECK(context3d); |
59 | 59 |
60 using webkit::gpu::ContextProviderInProcess; | 60 using webkit::gpu::ContextProviderInProcess; |
61 scoped_refptr<ContextProviderInProcess> context_provider = | 61 scoped_refptr<ContextProviderInProcess> context_provider = |
62 ContextProviderInProcess::Create(context3d.Pass(), "UICompositor"); | 62 ContextProviderInProcess::Create(context3d.Pass(), "UICompositor"); |
63 | 63 |
64 return make_scoped_ptr(new cc::OutputSurface(context_provider)); | 64 return make_scoped_ptr(new cc::PixelTestOutputSurface(context_provider)); |
65 } | 65 } |
66 | 66 |
67 scoped_refptr<Reflector> InProcessContextFactory::CreateReflector( | 67 scoped_refptr<Reflector> InProcessContextFactory::CreateReflector( |
68 Compositor* mirroed_compositor, | 68 Compositor* mirroed_compositor, |
69 Layer* mirroring_layer) { | 69 Layer* mirroring_layer) { |
70 return new Reflector(); | 70 return new Reflector(); |
71 } | 71 } |
72 | 72 |
73 void InProcessContextFactory::RemoveReflector( | 73 void InProcessContextFactory::RemoveReflector( |
74 scoped_refptr<Reflector> reflector) {} | 74 scoped_refptr<Reflector> reflector) {} |
(...skipping 29 matching lines...) Expand all Loading... |
104 return compositor_thread_->message_loop_proxy().get(); | 104 return compositor_thread_->message_loop_proxy().get(); |
105 } | 105 } |
106 | 106 |
107 scoped_ptr<cc::SurfaceIdAllocator> | 107 scoped_ptr<cc::SurfaceIdAllocator> |
108 InProcessContextFactory::CreateSurfaceIdAllocator() { | 108 InProcessContextFactory::CreateSurfaceIdAllocator() { |
109 return make_scoped_ptr( | 109 return make_scoped_ptr( |
110 new cc::SurfaceIdAllocator(next_surface_id_namespace_++)); | 110 new cc::SurfaceIdAllocator(next_surface_id_namespace_++)); |
111 } | 111 } |
112 | 112 |
113 } // namespace ui | 113 } // namespace ui |
OLD | NEW |