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

Side by Side Diff: content/renderer/gpu/compositor_output_surface.h

Issue 12614013: Plumb cc::LatencyInfo through command buffer and output surface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
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 11 matching lines...) Expand all
22 class ForwardingMessageFilter; 22 class ForwardingMessageFilter;
23 class Message; 23 class Message;
24 } 24 }
25 25
26 namespace cc { 26 namespace cc {
27 class CompositorFrameAck; 27 class CompositorFrameAck;
28 } 28 }
29 29
30 namespace content { 30 namespace content {
31 31
32 class CommandBufferProxyImpl;
33
32 // This class can be created only on the main thread, but then becomes pinned 34 // This class can be created only on the main thread, but then becomes pinned
33 // to a fixed thread when bindToClient is called. 35 // to a fixed thread when bindToClient is called.
34 class CompositorOutputSurface 36 class CompositorOutputSurface
35 : NON_EXPORTED_BASE(public cc::OutputSurface), 37 : NON_EXPORTED_BASE(public cc::OutputSurface),
36 NON_EXPORTED_BASE(public base::NonThreadSafe) { 38 NON_EXPORTED_BASE(public base::NonThreadSafe) {
37 public: 39 public:
38 static IPC::ForwardingMessageFilter* CreateFilter( 40 static IPC::ForwardingMessageFilter* CreateFilter(
39 base::TaskRunner* target_task_runner); 41 base::TaskRunner* target_task_runner);
40 42
41 CompositorOutputSurface(int32 routing_id, 43 CompositorOutputSurface(int32 routing_id,
42 WebKit::WebGraphicsContext3D* context3d, 44 WebKit::WebGraphicsContext3D* context3d,
45 CommandBufferProxyImpl* command_buffer_proxy,
43 cc::SoftwareOutputDevice* software); 46 cc::SoftwareOutputDevice* software);
44 virtual ~CompositorOutputSurface(); 47 virtual ~CompositorOutputSurface();
45 48
46 // cc::OutputSurface implementation. 49 // cc::OutputSurface implementation.
47 virtual bool BindToClient(cc::OutputSurfaceClient* client) OVERRIDE; 50 virtual bool BindToClient(cc::OutputSurfaceClient* client) OVERRIDE;
48 virtual void SendFrameToParentCompositor(cc::CompositorFrame*) OVERRIDE; 51 virtual void SendFrameToParentCompositor(cc::CompositorFrame*) OVERRIDE;
52 virtual void SetLatencyInfo(const cc::LatencyInfo&) OVERRIDE;
49 53
50 // TODO(epenner): This seems out of place here and would be a better fit 54 // TODO(epenner): This seems out of place here and would be a better fit
51 // int CompositorThread after it is fully refactored (http://crbug/170828) 55 // int CompositorThread after it is fully refactored (http://crbug/170828)
52 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) OVERRIDE; 56 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) OVERRIDE;
53 57
54 protected: 58 protected:
55 virtual void OnSwapAck(const cc::CompositorFrameAck& ack); 59 virtual void OnSwapAck(const cc::CompositorFrameAck& ack);
56 60
57 private: 61 private:
58 class CompositorOutputSurfaceProxy : 62 class CompositorOutputSurfaceProxy :
(...skipping 12 matching lines...) Expand all
71 friend class base::RefCountedThreadSafe<CompositorOutputSurfaceProxy>; 75 friend class base::RefCountedThreadSafe<CompositorOutputSurfaceProxy>;
72 ~CompositorOutputSurfaceProxy() {} 76 ~CompositorOutputSurfaceProxy() {}
73 CompositorOutputSurface* output_surface_; 77 CompositorOutputSurface* output_surface_;
74 78
75 DISALLOW_COPY_AND_ASSIGN(CompositorOutputSurfaceProxy); 79 DISALLOW_COPY_AND_ASSIGN(CompositorOutputSurfaceProxy);
76 }; 80 };
77 81
78 void OnMessageReceived(const IPC::Message& message); 82 void OnMessageReceived(const IPC::Message& message);
79 void OnUpdateVSyncParameters( 83 void OnUpdateVSyncParameters(
80 base::TimeTicks timebase, base::TimeDelta interval); 84 base::TimeTicks timebase, base::TimeDelta interval);
85 void OnReceivedLatencyInfo(const cc::LatencyInfo&);
81 bool Send(IPC::Message* message); 86 bool Send(IPC::Message* message);
82 87
83 scoped_refptr<IPC::ForwardingMessageFilter> output_surface_filter_; 88 scoped_refptr<IPC::ForwardingMessageFilter> output_surface_filter_;
84 scoped_refptr<CompositorOutputSurfaceProxy> output_surface_proxy_; 89 scoped_refptr<CompositorOutputSurfaceProxy> output_surface_proxy_;
85 int routing_id_; 90 int routing_id_;
86 bool prefers_smoothness_; 91 bool prefers_smoothness_;
87 base::PlatformThreadId main_thread_id_; 92 base::PlatformThreadId main_thread_id_;
93 CommandBufferProxyImpl* command_buffer_proxy_;
88 }; 94 };
89 95
90 } // namespace content 96 } // namespace content
91 97
92 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_ 98 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698