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

Side by Side Diff: content/browser/compositor/browser_compositor_output_surface.h

Issue 138903025: Read compositor VSync information from platform, when possible (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 287efe04 Rebase, oshima@ nits. Created 6 years, 10 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 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_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ 5 #ifndef CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
6 #define CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ 6 #define CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
7 7
8 #include "base/id_map.h" 8 #include "base/id_map.h"
9 #include "base/memory/weak_ptr.h"
10 #include "base/threading/non_thread_safe.h" 9 #include "base/threading/non_thread_safe.h"
11 #include "cc/output/output_surface.h" 10 #include "cc/output/output_surface.h"
12 #include "content/common/content_export.h" 11 #include "content/common/content_export.h"
13 12 #include "ui/compositor/compositor_vsync_manager.h"
14 namespace base { class MessageLoopProxy; }
15 13
16 namespace cc { 14 namespace cc {
17 class SoftwareOutputDevice; 15 class SoftwareOutputDevice;
18 } 16 }
19 17
20 namespace ui { class Compositor; }
21
22 namespace content { 18 namespace content {
23 class ContextProviderCommandBuffer; 19 class ContextProviderCommandBuffer;
24 class ReflectorImpl; 20 class ReflectorImpl;
25 class WebGraphicsContext3DCommandBufferImpl; 21 class WebGraphicsContext3DCommandBufferImpl;
26 22
27 class CONTENT_EXPORT BrowserCompositorOutputSurface 23 class CONTENT_EXPORT BrowserCompositorOutputSurface
28 : public cc::OutputSurface, 24 : public cc::OutputSurface,
25 public ui::CompositorVSyncManager::Observer,
29 public base::NonThreadSafe { 26 public base::NonThreadSafe {
30 public: 27 public:
31 virtual ~BrowserCompositorOutputSurface(); 28 virtual ~BrowserCompositorOutputSurface();
32 29
33 // cc::OutputSurface implementation. 30 // cc::OutputSurface implementation.
34 virtual bool BindToClient(cc::OutputSurfaceClient* client) OVERRIDE; 31 virtual bool BindToClient(cc::OutputSurfaceClient* client) OVERRIDE;
35 virtual void Reshape(const gfx::Size& size, float scale_factor) OVERRIDE; 32 virtual void Reshape(const gfx::Size& size, float scale_factor) OVERRIDE;
36 33
37 void OnUpdateVSyncParameters(base::TimeTicks timebase, 34 // ui::CompositorOutputSurface::Observer implementation.
38 base::TimeDelta interval); 35 virtual void OnUpdateVSyncParameters(base::TimeTicks timebase,
36 base::TimeDelta interval) OVERRIDE;
37
38 void OnUpdateVSyncParametersFromGpu(base::TimeTicks tiembase,
39 base::TimeDelta interval);
39 40
40 void SetReflector(ReflectorImpl* reflector); 41 void SetReflector(ReflectorImpl* reflector);
41 42
42 protected: 43 protected:
43 // Constructor used by the accelerated implementation. 44 // Constructor used by the accelerated implementation.
44 BrowserCompositorOutputSurface( 45 BrowserCompositorOutputSurface(
45 const scoped_refptr<ContextProviderCommandBuffer>& context, 46 const scoped_refptr<ContextProviderCommandBuffer>& context,
46 int surface_id, 47 int surface_id,
47 IDMap<BrowserCompositorOutputSurface>* output_surface_map, 48 IDMap<BrowserCompositorOutputSurface>* output_surface_map,
48 base::MessageLoopProxy* compositor_message_loop, 49 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager);
49 base::WeakPtr<ui::Compositor> compositor);
50 50
51 // Constructor used by the software implementation. 51 // Constructor used by the software implementation.
52 BrowserCompositorOutputSurface( 52 BrowserCompositorOutputSurface(
53 scoped_ptr<cc::SoftwareOutputDevice> software_device, 53 scoped_ptr<cc::SoftwareOutputDevice> software_device,
54 int surface_id, 54 int surface_id,
55 IDMap<BrowserCompositorOutputSurface>* output_surface_map, 55 IDMap<BrowserCompositorOutputSurface>* output_surface_map,
56 base::MessageLoopProxy* compositor_message_loop, 56 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager);
57 base::WeakPtr<ui::Compositor> compositor);
58 57
59 int surface_id_; 58 int surface_id_;
60 IDMap<BrowserCompositorOutputSurface>* output_surface_map_; 59 IDMap<BrowserCompositorOutputSurface>* output_surface_map_;
61 60
62 scoped_refptr<base::MessageLoopProxy> compositor_message_loop_; 61 scoped_refptr<ui::CompositorVSyncManager> vsync_manager_;
63 base::WeakPtr<ui::Compositor> compositor_;
64 scoped_refptr<ReflectorImpl> reflector_; 62 scoped_refptr<ReflectorImpl> reflector_;
65 63
66 private: 64 private:
67 void Initialize(); 65 void Initialize();
68 66
69 DISALLOW_COPY_AND_ASSIGN(BrowserCompositorOutputSurface); 67 DISALLOW_COPY_AND_ASSIGN(BrowserCompositorOutputSurface);
70 }; 68 };
71 69
72 } // namespace content 70 } // namespace content
73 71
74 #endif // CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ 72 #endif // CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698