Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: content/browser/android/in_process/synchronous_compositor_factory_impl.h

Issue 1253553002: Add switch to use ipc command buffer in Android WebView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMPL_H _ 5 #ifndef CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMPL_H _
6 #define CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMPL_H _ 6 #define CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMPL_H _
7 7
8 #include "base/synchronization/lock.h" 8 #include "base/synchronization/lock.h"
9 #include "cc/blink/context_provider_web_context.h" 9 #include "cc/blink/context_provider_web_context.h"
10 #include "content/browser/android/in_process/synchronous_input_event_filter.h" 10 #include "content/browser/android/in_process/synchronous_input_event_filter.h"
11 #include "content/common/gpu/client/command_buffer_metrics.h"
11 #include "content/renderer/android/synchronous_compositor_factory.h" 12 #include "content/renderer/android/synchronous_compositor_factory.h"
12 #include "content/renderer/media/android/stream_texture_factory_synchronous_impl .h" 13 #include "content/renderer/media/android/stream_texture_factory_synchronous_impl .h"
13 #include "gpu/command_buffer/service/in_process_command_buffer.h" 14 #include "gpu/command_buffer/service/in_process_command_buffer.h"
14 15
15 namespace base { 16 namespace base {
16 class Thread; 17 class Thread;
17 } 18 }
18 19
19 namespace gpu { 20 namespace gpu {
20 class GLInProcessContext; 21 class GLInProcessContext;
(...skipping 16 matching lines...) Expand all
37 scoped_refptr<base::SingleThreadTaskRunner> GetCompositorTaskRunner() 38 scoped_refptr<base::SingleThreadTaskRunner> GetCompositorTaskRunner()
38 override; 39 override;
39 bool RecordFullLayer() override; 40 bool RecordFullLayer() override;
40 scoped_ptr<cc::OutputSurface> CreateOutputSurface( 41 scoped_ptr<cc::OutputSurface> CreateOutputSurface(
41 int routing_id, 42 int routing_id,
42 scoped_refptr<content::FrameSwapMessageQueue> frame_swap_message_queue) 43 scoped_refptr<content::FrameSwapMessageQueue> frame_swap_message_queue)
43 override; 44 override;
44 InputHandlerManagerClient* GetInputHandlerManagerClient() override; 45 InputHandlerManagerClient* GetInputHandlerManagerClient() override;
45 scoped_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource( 46 scoped_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource(
46 int routing_id) override; 47 int routing_id) override;
48 scoped_refptr<StreamTextureFactory> CreateStreamTextureFactory(
49 int view_id) override;
50 bool OverrideWithFactory() override;
47 scoped_refptr<cc_blink::ContextProviderWebContext> 51 scoped_refptr<cc_blink::ContextProviderWebContext>
48 CreateOffscreenContextProvider( 52 CreateOffscreenContextProvider(
49 const blink::WebGraphicsContext3D::Attributes& attributes, 53 const blink::WebGraphicsContext3D::Attributes& attributes,
50 const std::string& debug_name) override; 54 const std::string& debug_name) override;
51 scoped_refptr<StreamTextureFactory> CreateStreamTextureFactory(
52 int view_id) override;
53 gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl* 55 gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl*
54 CreateOffscreenGraphicsContext3D( 56 CreateOffscreenGraphicsContext3D(
55 const blink::WebGraphicsContext3D::Attributes& attributes) override; 57 const blink::WebGraphicsContext3D::Attributes& attributes) override;
56 gpu::GPUInfo GetGPUInfo() const override; 58 gpu::GPUInfo GetGPUInfo() const override;
57 59
58 SynchronousInputEventFilter* synchronous_input_event_filter() { 60 SynchronousInputEventFilter* synchronous_input_event_filter() {
59 return &synchronous_input_event_filter_; 61 return &synchronous_input_event_filter_;
60 } 62 }
61 63
62 void SetDeferredGpuService( 64 void SetDeferredGpuService(
63 scoped_refptr<gpu::InProcessCommandBuffer::Service> service); 65 scoped_refptr<gpu::InProcessCommandBuffer::Service> service);
64 base::Thread* CreateInProcessGpuThread( 66 base::Thread* CreateInProcessGpuThread(
65 const InProcessChildThreadParams& params); 67 const InProcessChildThreadParams& params);
66 void SetRecordFullDocument(bool record_full_document); 68 void SetRecordFullDocument(bool record_full_document);
69 void SetUseIpcCommandBuffer();
67 void CompositorInitializedHardwareDraw(); 70 void CompositorInitializedHardwareDraw();
68 void CompositorReleasedHardwareDraw(); 71 void CompositorReleasedHardwareDraw();
69 72
70 scoped_refptr<cc::ContextProvider> CreateContextProviderForCompositor();
71 73
72 private: 74 private:
75 scoped_refptr<cc::ContextProvider> CreateContextProviderForCompositor(
76 CommandBufferContextType type);
73 bool CanCreateMainThreadContext(); 77 bool CanCreateMainThreadContext();
74 scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider> 78 scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider>
75 TryCreateStreamTextureFactory(); 79 TryCreateStreamTextureFactory();
76 void RestoreContextOnMainThread(); 80 void RestoreContextOnMainThread();
77 scoped_refptr<gpu::InProcessCommandBuffer::Service> GpuThreadService(); 81 scoped_refptr<gpu::InProcessCommandBuffer::Service> GpuThreadService();
78 82
79 SynchronousInputEventFilter synchronous_input_event_filter_; 83 SynchronousInputEventFilter synchronous_input_event_filter_;
80 84
81 scoped_refptr<gpu::InProcessCommandBuffer::Service> android_view_service_; 85 scoped_refptr<gpu::InProcessCommandBuffer::Service> android_view_service_;
82 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_thread_service_; 86 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_thread_service_;
83 87
84 class VideoContextProvider; 88 class VideoContextProvider;
85 scoped_refptr<VideoContextProvider> video_context_provider_; 89 scoped_refptr<VideoContextProvider> video_context_provider_;
86 90
87 bool record_full_layer_; 91 bool record_full_layer_;
92 bool use_ipc_command_buffer_;
88 93
89 // |num_hardware_compositor_lock_| is updated on UI thread only but can be 94 // |num_hardware_compositor_lock_| is updated on UI thread only but can be
90 // read on renderer main thread. 95 // read on renderer main thread.
91 base::Lock num_hardware_compositor_lock_; 96 base::Lock num_hardware_compositor_lock_;
92 unsigned int num_hardware_compositors_; 97 unsigned int num_hardware_compositors_;
93 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; 98 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
94 }; 99 };
95 100
96 } // namespace content 101 } // namespace content
97 102
98 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMP L_H_ 103 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMP L_H_
OLDNEW
« no previous file with comments | « android_webview/common/aw_switches.cc ('k') | content/browser/android/in_process/synchronous_compositor_factory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698