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

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

Issue 920443003: Android: SetCreateContextCallback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reduce the diff Created 5 years, 9 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/public/browser/android/synchronous_compositor.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 gpu { 16 namespace gpu {
16 class GLInProcessContext; 17 class GLInProcessContext;
17 } 18 }
18 19
19 namespace gpu_blink { 20 namespace gpu_blink {
20 class WebGraphicsContext3DInProcessCommandBufferImpl; 21 class WebGraphicsContext3DInProcessCommandBufferImpl;
(...skipping 23 matching lines...) Expand all
44 scoped_refptr<StreamTextureFactory> CreateStreamTextureFactory( 45 scoped_refptr<StreamTextureFactory> CreateStreamTextureFactory(
45 int view_id) override; 46 int view_id) override;
46 gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl* 47 gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl*
47 CreateOffscreenGraphicsContext3D( 48 CreateOffscreenGraphicsContext3D(
48 const blink::WebGraphicsContext3D::Attributes& attributes) override; 49 const blink::WebGraphicsContext3D::Attributes& attributes) override;
49 50
50 SynchronousInputEventFilter* synchronous_input_event_filter() { 51 SynchronousInputEventFilter* synchronous_input_event_filter() {
51 return &synchronous_input_event_filter_; 52 return &synchronous_input_event_filter_;
52 } 53 }
53 54
54 void SetDeferredGpuService( 55 void SetCreateContextCallback(
55 scoped_refptr<gpu::InProcessCommandBuffer::Service> service); 56 SynchronousCompositor::CreateContextCallback callback);
56 void SetRecordFullDocument(bool record_full_document); 57 void SetRecordFullDocument(bool record_full_document);
57 void CompositorInitializedHardwareDraw(); 58 void CompositorInitializedHardwareDraw();
58 void CompositorReleasedHardwareDraw(); 59 void CompositorReleasedHardwareDraw();
59 60
60 scoped_refptr<cc::ContextProvider> CreateContextProviderForCompositor(); 61 scoped_refptr<cc::ContextProvider> CreateContextProviderForCompositor();
61 62
62 private: 63 private:
63 bool CanCreateMainThreadContext(); 64 bool CanCreateMainThreadContext();
64 scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider> 65 scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider>
65 TryCreateStreamTextureFactory(); 66 TryCreateStreamTextureFactory();
66 void RestoreContextOnMainThread(); 67 void RestoreContextOnMainThread();
67 68
68 SynchronousInputEventFilter synchronous_input_event_filter_; 69 SynchronousInputEventFilter synchronous_input_event_filter_;
69 70
70 scoped_refptr<gpu::InProcessCommandBuffer::Service> service_; 71 SynchronousCompositor::CreateContextCallback callback_;
71 72
72 class VideoContextProvider; 73 class VideoContextProvider;
73 scoped_refptr<VideoContextProvider> video_context_provider_; 74 scoped_refptr<VideoContextProvider> video_context_provider_;
74 75
75 bool record_full_layer_; 76 bool record_full_layer_;
76 77
77 // |num_hardware_compositor_lock_| is updated on UI thread only but can be 78 // |num_hardware_compositor_lock_| is updated on UI thread only but can be
78 // read on renderer main thread. 79 // read on renderer main thread.
79 base::Lock num_hardware_compositor_lock_; 80 base::Lock num_hardware_compositor_lock_;
80 unsigned int num_hardware_compositors_; 81 unsigned int num_hardware_compositors_;
81 scoped_refptr<base::MessageLoopProxy> main_thread_proxy_; 82 scoped_refptr<base::MessageLoopProxy> main_thread_proxy_;
82 }; 83 };
83 84
84 } // namespace content 85 } // namespace content
85 86
86 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMP L_H_ 87 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMP L_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698