OLD | NEW |
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/threading/non_thread_safe.h" | 8 #include "base/threading/non_thread_safe.h" |
9 #include "cc/output/output_surface.h" | 9 #include "cc/output/output_surface.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 #include "ui/compositor/compositor_vsync_manager.h" | |
12 | 11 |
13 namespace cc { | 12 namespace cc { |
14 class SoftwareOutputDevice; | 13 class SoftwareOutputDevice; |
15 } | 14 } |
16 | 15 |
17 namespace content { | 16 namespace content { |
18 class ContextProviderCommandBuffer; | 17 class ContextProviderCommandBuffer; |
19 class ReflectorImpl; | 18 class ReflectorImpl; |
20 class WebGraphicsContext3DCommandBufferImpl; | 19 class WebGraphicsContext3DCommandBufferImpl; |
21 | 20 |
22 class CONTENT_EXPORT BrowserCompositorOutputSurface | 21 class CONTENT_EXPORT BrowserCompositorOutputSurface |
23 : public cc::OutputSurface, | 22 : public cc::OutputSurface { |
24 public ui::CompositorVSyncManager::Observer { | |
25 public: | 23 public: |
26 ~BrowserCompositorOutputSurface() override; | 24 ~BrowserCompositorOutputSurface() override; |
27 | 25 |
28 // cc::OutputSurface implementation. | |
29 bool BindToClient(cc::OutputSurfaceClient* client) override; | |
30 | |
31 // ui::CompositorOutputSurface::Observer implementation. | |
32 void OnUpdateVSyncParameters(base::TimeTicks timebase, | |
33 base::TimeDelta interval) override; | |
34 | |
35 void OnUpdateVSyncParametersFromGpu(base::TimeTicks tiembase, | 26 void OnUpdateVSyncParametersFromGpu(base::TimeTicks tiembase, |
36 base::TimeDelta interval); | 27 base::TimeDelta interval); |
37 | 28 |
38 void SetReflector(ReflectorImpl* reflector); | 29 void SetReflector(ReflectorImpl* reflector); |
39 | 30 |
40 #if defined(OS_MACOSX) | 31 #if defined(OS_MACOSX) |
41 virtual void OnSurfaceDisplayed() = 0; | 32 virtual void OnSurfaceDisplayed() = 0; |
42 virtual void OnSurfaceRecycled() = 0; | 33 virtual void OnSurfaceRecycled() = 0; |
43 virtual bool ShouldNotShowFramesAfterRecycle() const = 0; | 34 virtual bool ShouldNotShowFramesAfterRecycle() const = 0; |
44 #endif | 35 #endif |
45 | 36 |
46 protected: | 37 protected: |
47 // Constructor used by the accelerated implementation. | 38 // Constructor used by the accelerated implementation. |
48 BrowserCompositorOutputSurface( | 39 explicit BrowserCompositorOutputSurface( |
49 const scoped_refptr<cc::ContextProvider>& context, | 40 const scoped_refptr<cc::ContextProvider>& context); |
50 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager); | |
51 | 41 |
52 // Constructor used by the software implementation. | 42 // Constructor used by the software implementation. |
53 BrowserCompositorOutputSurface( | 43 explicit BrowserCompositorOutputSurface( |
54 scoped_ptr<cc::SoftwareOutputDevice> software_device, | 44 scoped_ptr<cc::SoftwareOutputDevice> software_device); |
55 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager); | |
56 | 45 |
57 scoped_refptr<ui::CompositorVSyncManager> vsync_manager_; | |
58 ReflectorImpl* reflector_; | 46 ReflectorImpl* reflector_; |
59 | 47 |
60 private: | 48 private: |
61 void Initialize(); | 49 void Initialize(); |
62 | 50 |
63 DISALLOW_COPY_AND_ASSIGN(BrowserCompositorOutputSurface); | 51 DISALLOW_COPY_AND_ASSIGN(BrowserCompositorOutputSurface); |
64 }; | 52 }; |
65 | 53 |
66 } // namespace content | 54 } // namespace content |
67 | 55 |
68 #endif // CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ | 56 #endif // CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ |
OLD | NEW |