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" | 9 #include "cc/test/pixel_test_output_surface.h" |
10 #include "cc/test/test_shared_bitmap_manager.h" | 10 #include "cc/test/test_shared_bitmap_manager.h" |
11 #include "ui/compositor/compositor_switches.h" | 11 #include "ui/compositor/compositor_switches.h" |
12 #include "ui/compositor/reflector.h" | 12 #include "ui/compositor/reflector.h" |
13 #include "ui/gl/gl_implementation.h" | 13 #include "ui/gl/gl_implementation.h" |
14 #include "ui/gl/gl_surface.h" | 14 #include "ui/gl/gl_surface.h" |
15 #include "webkit/common/gpu/context_provider_in_process.h" | 15 #include "webkit/common/gpu/context_provider_in_process.h" |
16 #include "webkit/common/gpu/grcontext_for_webgraphicscontext3d.h" | 16 #include "webkit/common/gpu/grcontext_for_webgraphicscontext3d.h" |
17 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" | 17 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" |
18 | 18 |
19 namespace ui { | 19 namespace ui { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl; | 52 using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl; |
53 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d( | 53 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d( |
54 WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext( | 54 WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext( |
55 attrs, lose_context_when_out_of_memory, compositor->widget())); | 55 attrs, lose_context_when_out_of_memory, compositor->widget())); |
56 CHECK(context3d); | 56 CHECK(context3d); |
57 | 57 |
58 using webkit::gpu::ContextProviderInProcess; | 58 using webkit::gpu::ContextProviderInProcess; |
59 scoped_refptr<ContextProviderInProcess> context_provider = | 59 scoped_refptr<ContextProviderInProcess> context_provider = |
60 ContextProviderInProcess::Create(context3d.Pass(), "UICompositor"); | 60 ContextProviderInProcess::Create(context3d.Pass(), "UICompositor"); |
61 | 61 |
62 return make_scoped_ptr(new cc::OutputSurface(context_provider)); | 62 return make_scoped_ptr(new cc::PixelTestOutputSurface(context_provider)); |
63 } | 63 } |
64 | 64 |
65 scoped_refptr<Reflector> InProcessContextFactory::CreateReflector( | 65 scoped_refptr<Reflector> InProcessContextFactory::CreateReflector( |
66 Compositor* mirroed_compositor, | 66 Compositor* mirroed_compositor, |
67 Layer* mirroring_layer) { | 67 Layer* mirroring_layer) { |
68 return new Reflector(); | 68 return new Reflector(); |
69 } | 69 } |
70 | 70 |
71 void InProcessContextFactory::RemoveReflector( | 71 void InProcessContextFactory::RemoveReflector( |
72 scoped_refptr<Reflector> reflector) {} | 72 scoped_refptr<Reflector> reflector) {} |
(...skipping 23 matching lines...) Expand all Loading... |
96 return shared_bitmap_manager_.get(); | 96 return shared_bitmap_manager_.get(); |
97 } | 97 } |
98 | 98 |
99 base::MessageLoopProxy* InProcessContextFactory::GetCompositorMessageLoop() { | 99 base::MessageLoopProxy* InProcessContextFactory::GetCompositorMessageLoop() { |
100 if (!compositor_thread_) | 100 if (!compositor_thread_) |
101 return NULL; | 101 return NULL; |
102 return compositor_thread_->message_loop_proxy().get(); | 102 return compositor_thread_->message_loop_proxy().get(); |
103 } | 103 } |
104 | 104 |
105 } // namespace ui | 105 } // namespace ui |
OLD | NEW |