| 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
| 10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
| 11 #include "cc/output/context_provider.h" | 11 #include "cc/output/context_provider.h" |
| 12 #include "cc/output/output_surface_client.h" | 12 #include "cc/output/output_surface_client.h" |
| 13 #include "cc/surfaces/surface_id_allocator.h" | 13 #include "cc/surfaces/surface_id_allocator.h" |
| 14 #include "cc/test/pixel_test_output_surface.h" | 14 #include "cc/test/pixel_test_output_surface.h" |
| 15 #include "cc/test/test_shared_bitmap_manager.h" | 15 #include "cc/test/test_shared_bitmap_manager.h" |
| 16 #include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h" |
| 16 #include "gpu/command_buffer/client/context_support.h" | 17 #include "gpu/command_buffer/client/context_support.h" |
| 17 #include "gpu/command_buffer/client/gles2_interface.h" | 18 #include "gpu/command_buffer/client/gles2_interface.h" |
| 18 #include "ui/compositor/compositor_switches.h" | 19 #include "ui/compositor/compositor_switches.h" |
| 19 #include "ui/compositor/reflector.h" | 20 #include "ui/compositor/reflector.h" |
| 20 #include "ui/gl/gl_implementation.h" | 21 #include "ui/gl/gl_implementation.h" |
| 21 #include "ui/gl/gl_surface.h" | 22 #include "ui/gl/gl_surface.h" |
| 22 #include "webkit/common/gpu/context_provider_in_process.h" | 23 #include "webkit/common/gpu/context_provider_in_process.h" |
| 23 #include "webkit/common/gpu/grcontext_for_webgraphicscontext3d.h" | 24 #include "webkit/common/gpu/grcontext_for_webgraphicscontext3d.h" |
| 24 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" | |
| 25 | 25 |
| 26 namespace ui { | 26 namespace ui { |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 // An OutputSurface implementation that directly draws and swaps to an actual | 29 // An OutputSurface implementation that directly draws and swaps to an actual |
| 30 // GL surface. | 30 // GL surface. |
| 31 class DirectOutputSurface : public cc::OutputSurface { | 31 class DirectOutputSurface : public cc::OutputSurface { |
| 32 public: | 32 public: |
| 33 explicit DirectOutputSurface( | 33 explicit DirectOutputSurface( |
| 34 const scoped_refptr<cc::ContextProvider>& context_provider) | 34 const scoped_refptr<cc::ContextProvider>& context_provider) |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 base::WeakPtr<Compositor> compositor, | 87 base::WeakPtr<Compositor> compositor, |
| 88 bool software_fallback) { | 88 bool software_fallback) { |
| 89 DCHECK(!software_fallback); | 89 DCHECK(!software_fallback); |
| 90 blink::WebGraphicsContext3D::Attributes attrs; | 90 blink::WebGraphicsContext3D::Attributes attrs; |
| 91 attrs.depth = false; | 91 attrs.depth = false; |
| 92 attrs.stencil = false; | 92 attrs.stencil = false; |
| 93 attrs.antialias = false; | 93 attrs.antialias = false; |
| 94 attrs.shareResources = true; | 94 attrs.shareResources = true; |
| 95 bool lose_context_when_out_of_memory = true; | 95 bool lose_context_when_out_of_memory = true; |
| 96 | 96 |
| 97 using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl; | 97 using gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl; |
| 98 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d( | 98 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d( |
| 99 WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext( | 99 WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext( |
| 100 attrs, lose_context_when_out_of_memory, compositor->widget())); | 100 attrs, lose_context_when_out_of_memory, compositor->widget())); |
| 101 CHECK(context3d); | 101 CHECK(context3d); |
| 102 | 102 |
| 103 using webkit::gpu::ContextProviderInProcess; | 103 using webkit::gpu::ContextProviderInProcess; |
| 104 scoped_refptr<ContextProviderInProcess> context_provider = | 104 scoped_refptr<ContextProviderInProcess> context_provider = |
| 105 ContextProviderInProcess::Create(context3d.Pass(), "UICompositor"); | 105 ContextProviderInProcess::Create(context3d.Pass(), "UICompositor"); |
| 106 | 106 |
| 107 if (use_test_surface_) { | 107 if (use_test_surface_) { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 InProcessContextFactory::CreateSurfaceIdAllocator() { | 163 InProcessContextFactory::CreateSurfaceIdAllocator() { |
| 164 return make_scoped_ptr( | 164 return make_scoped_ptr( |
| 165 new cc::SurfaceIdAllocator(next_surface_id_namespace_++)); | 165 new cc::SurfaceIdAllocator(next_surface_id_namespace_++)); |
| 166 } | 166 } |
| 167 | 167 |
| 168 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor, | 168 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor, |
| 169 const gfx::Size& size) { | 169 const gfx::Size& size) { |
| 170 } | 170 } |
| 171 | 171 |
| 172 } // namespace ui | 172 } // namespace ui |
| OLD | NEW |