OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_ | 5 #ifndef CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_ |
6 #define CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_ | 6 #define CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 namespace cc { | 29 namespace cc { |
30 class CompositorFrame; | 30 class CompositorFrame; |
31 class CompositorFrameAck; | 31 class CompositorFrameAck; |
32 class GLFrameData; | 32 class GLFrameData; |
33 class SoftwareFrameData; | 33 class SoftwareFrameData; |
34 } | 34 } |
35 | 35 |
36 namespace content { | 36 namespace content { |
37 class ContextProviderCommandBuffer; | 37 class ContextProviderCommandBuffer; |
| 38 class FrameSwapMessageQueue; |
38 | 39 |
39 // This class can be created only on the main thread, but then becomes pinned | 40 // This class can be created only on the main thread, but then becomes pinned |
40 // to a fixed thread when bindToClient is called. | 41 // to a fixed thread when bindToClient is called. |
41 class CompositorOutputSurface | 42 class CompositorOutputSurface |
42 : NON_EXPORTED_BASE(public cc::OutputSurface), | 43 : NON_EXPORTED_BASE(public cc::OutputSurface), |
43 NON_EXPORTED_BASE(public base::NonThreadSafe) { | 44 NON_EXPORTED_BASE(public base::NonThreadSafe) { |
44 public: | 45 public: |
45 static IPC::ForwardingMessageFilter* CreateFilter( | 46 static IPC::ForwardingMessageFilter* CreateFilter( |
46 base::TaskRunner* target_task_runner); | 47 base::TaskRunner* target_task_runner); |
47 | 48 |
48 CompositorOutputSurface( | 49 CompositorOutputSurface( |
49 int32 routing_id, | 50 int32 routing_id, |
50 uint32 output_surface_id, | 51 uint32 output_surface_id, |
51 const scoped_refptr<ContextProviderCommandBuffer>& context_provider, | 52 const scoped_refptr<ContextProviderCommandBuffer>& context_provider, |
52 scoped_ptr<cc::SoftwareOutputDevice> software, | 53 scoped_ptr<cc::SoftwareOutputDevice> software, |
| 54 scoped_refptr<FrameSwapMessageQueue> swap_frame_message_queue, |
53 bool use_swap_compositor_frame_message); | 55 bool use_swap_compositor_frame_message); |
54 virtual ~CompositorOutputSurface(); | 56 virtual ~CompositorOutputSurface(); |
55 | 57 |
56 // cc::OutputSurface implementation. | 58 // cc::OutputSurface implementation. |
57 virtual bool BindToClient(cc::OutputSurfaceClient* client) OVERRIDE; | 59 virtual bool BindToClient(cc::OutputSurfaceClient* client) OVERRIDE; |
58 virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE; | 60 virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE; |
59 #if defined(OS_ANDROID) | 61 #if defined(OS_ANDROID) |
60 virtual void SetNeedsBeginFrame(bool enable) OVERRIDE; | 62 virtual void SetNeedsBeginFrame(bool enable) OVERRIDE; |
61 #endif | 63 #endif |
62 | 64 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 #if defined(OS_ANDROID) | 103 #if defined(OS_ANDROID) |
102 void OnBeginFrame(const cc::BeginFrameArgs& args); | 104 void OnBeginFrame(const cc::BeginFrameArgs& args); |
103 #endif | 105 #endif |
104 bool Send(IPC::Message* message); | 106 bool Send(IPC::Message* message); |
105 | 107 |
106 bool use_swap_compositor_frame_message_; | 108 bool use_swap_compositor_frame_message_; |
107 | 109 |
108 scoped_refptr<IPC::ForwardingMessageFilter> output_surface_filter_; | 110 scoped_refptr<IPC::ForwardingMessageFilter> output_surface_filter_; |
109 scoped_refptr<CompositorOutputSurfaceProxy> output_surface_proxy_; | 111 scoped_refptr<CompositorOutputSurfaceProxy> output_surface_proxy_; |
110 scoped_refptr<IPC::SyncMessageFilter> message_sender_; | 112 scoped_refptr<IPC::SyncMessageFilter> message_sender_; |
| 113 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue_; |
111 int routing_id_; | 114 int routing_id_; |
112 bool prefers_smoothness_; | 115 bool prefers_smoothness_; |
113 base::PlatformThreadHandle main_thread_handle_; | 116 base::PlatformThreadHandle main_thread_handle_; |
114 | 117 |
115 // TODO(danakj): Remove this when crbug.com/311404 | 118 // TODO(danakj): Remove this when crbug.com/311404 |
116 bool layout_test_mode_; | 119 bool layout_test_mode_; |
117 scoped_ptr<cc::CompositorFrameAck> layout_test_previous_frame_ack_; | 120 scoped_ptr<cc::CompositorFrameAck> layout_test_previous_frame_ack_; |
118 base::WeakPtrFactory<CompositorOutputSurface> weak_ptrs_; | 121 base::WeakPtrFactory<CompositorOutputSurface> weak_ptrs_; |
119 }; | 122 }; |
120 | 123 |
121 } // namespace content | 124 } // namespace content |
122 | 125 |
123 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_ | 126 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_ |
OLD | NEW |