| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_AURA_BROWSER_COMPOSITOR_OUTPUT_SURFACE_PROXY_H_ | 5 #ifndef CONTENT_BROWSER_AURA_BROWSER_COMPOSITOR_OUTPUT_SURFACE_PROXY_H_ |
| 6 #define CONTENT_BROWSER_AURA_BROWSER_COMPOSITOR_OUTPUT_SURFACE_PROXY_H_ | 6 #define CONTENT_BROWSER_AURA_BROWSER_COMPOSITOR_OUTPUT_SURFACE_PROXY_H_ |
| 7 | 7 |
| 8 #include "base/id_map.h" | 8 #include "base/id_map.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "content/common/content_export.h" |
| 11 | 12 |
| 12 namespace base { class SingleThreadTaskRunner; } | 13 namespace base { class SingleThreadTaskRunner; } |
| 13 | 14 |
| 14 namespace IPC { class Message; } | 15 namespace IPC { class Message; } |
| 15 | 16 |
| 16 namespace content { | 17 namespace content { |
| 17 class BrowserCompositorOutputSurface; | 18 class BrowserCompositorOutputSurface; |
| 18 | 19 |
| 19 // Directs vsync updates to the appropriate BrowserCompositorOutputSurface. | 20 // Directs vsync updates to the appropriate BrowserCompositorOutputSurface. |
| 20 class BrowserCompositorOutputSurfaceProxy | 21 class CONTENT_EXPORT BrowserCompositorOutputSurfaceProxy |
| 21 : public base::RefCountedThreadSafe<BrowserCompositorOutputSurfaceProxy> { | 22 : public base::RefCountedThreadSafe<BrowserCompositorOutputSurfaceProxy> { |
| 22 public: | 23 public: |
| 23 BrowserCompositorOutputSurfaceProxy( | 24 BrowserCompositorOutputSurfaceProxy( |
| 24 IDMap<BrowserCompositorOutputSurface>* surface_map); | 25 IDMap<BrowserCompositorOutputSurface>* surface_map); |
| 25 | 26 |
| 26 // Call this before each OutputSurface is created to ensure that the | 27 // Call this before each OutputSurface is created to ensure that the |
| 27 // proxy is connected to the current host. | 28 // proxy is connected to the current host. |
| 28 void ConnectToGpuProcessHost( | 29 void ConnectToGpuProcessHost( |
| 29 base::SingleThreadTaskRunner* compositor_thread_task_runner); | 30 base::SingleThreadTaskRunner* compositor_thread_task_runner); |
| 30 | 31 |
| 31 private: | 32 private: |
| 32 friend class base::RefCountedThreadSafe<BrowserCompositorOutputSurfaceProxy>; | 33 friend class base::RefCountedThreadSafe<BrowserCompositorOutputSurfaceProxy>; |
| 34 friend class SoftwareBrowserCompositorOutputSurface; |
| 33 ~BrowserCompositorOutputSurfaceProxy(); | 35 ~BrowserCompositorOutputSurfaceProxy(); |
| 34 | 36 |
| 35 void OnMessageReceivedOnCompositorThread(const IPC::Message& message); | 37 void OnMessageReceivedOnCompositorThread(const IPC::Message& message); |
| 36 | 38 |
| 37 void OnUpdateVSyncParametersOnCompositorThread(int surface_id, | 39 void OnUpdateVSyncParametersOnCompositorThread(int surface_id, |
| 38 base::TimeTicks timebase, | 40 base::TimeTicks timebase, |
| 39 base::TimeDelta interval); | 41 base::TimeDelta interval); |
| 40 | 42 |
| 41 IDMap<BrowserCompositorOutputSurface>* surface_map_; | 43 IDMap<BrowserCompositorOutputSurface>* surface_map_; |
| 42 int connected_to_gpu_process_host_id_; | 44 int connected_to_gpu_process_host_id_; |
| 43 | 45 |
| 44 DISALLOW_COPY_AND_ASSIGN(BrowserCompositorOutputSurfaceProxy); | 46 DISALLOW_COPY_AND_ASSIGN(BrowserCompositorOutputSurfaceProxy); |
| 45 }; | 47 }; |
| 46 | 48 |
| 47 } // namespace content | 49 } // namespace content |
| 48 | 50 |
| 49 #endif // CONTENT_BROWSER_AURA_BROWSER_COMPOSITOR_OUTPUT_SURFACE_PROXY_H_ | 51 #endif // CONTENT_BROWSER_AURA_BROWSER_COMPOSITOR_OUTPUT_SURFACE_PROXY_H_ |
| OLD | NEW |