OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ |
6 #define CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ | 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/time/time.h" |
13 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
14 #include "gpu/command_buffer/service/in_process_command_buffer.h" | |
15 #include "ui/gfx/geometry/rect.h" | 15 #include "ui/gfx/geometry/rect.h" |
16 #include "ui/gfx/geometry/size.h" | 16 #include "ui/gfx/geometry/size.h" |
17 | 17 |
18 class SkCanvas; | 18 class SkCanvas; |
19 | 19 |
20 namespace cc { | 20 namespace cc { |
21 class CompositorFrame; | 21 class CompositorFrame; |
22 class CompositorFrameAck; | 22 class CompositorFrameAck; |
23 } | 23 } |
24 | 24 |
25 namespace gfx { | 25 namespace gfx { |
26 class Point; | 26 class Point; |
27 class ScrollOffset; | 27 class ScrollOffset; |
28 class Transform; | 28 class Transform; |
29 }; | 29 }; |
30 | 30 |
31 namespace gpu { | |
32 class GLInProcessContext; | |
33 } | |
34 | |
35 namespace content { | 31 namespace content { |
36 | 32 |
37 class SynchronousCompositorClient; | 33 class SynchronousCompositorClient; |
38 class WebContents; | 34 class WebContents; |
39 | 35 |
40 // Interface for embedders that wish to direct compositing operations | 36 // Interface for embedders that wish to direct compositing operations |
41 // synchronously under their own control. Only meaningful when the | 37 // synchronously under their own control. Only meaningful when the |
42 // kEnableSyncrhonousRendererCompositor flag is specified. | 38 // kEnableSyncrhonousRendererCompositor flag is specified. |
43 class CONTENT_EXPORT SynchronousCompositor { | 39 class CONTENT_EXPORT SynchronousCompositor { |
44 public: | 40 public: |
45 // Must be called once per WebContents instance. Will create the compositor | 41 // Must be called once per WebContents instance. Will create the compositor |
46 // instance as needed, but only if |client| is non-nullptr. | 42 // instance as needed, but only if |client| is non-nullptr. |
47 static void SetClientForWebContents(WebContents* contents, | 43 static void SetClientForWebContents(WebContents* contents, |
48 SynchronousCompositorClient* client); | 44 SynchronousCompositorClient* client); |
49 | 45 |
50 static void SetGpuService( | |
51 scoped_refptr<gpu::InProcessCommandBuffer::Service> service); | |
52 | |
53 struct Frame { | 46 struct Frame { |
54 Frame(); | 47 Frame(); |
55 ~Frame(); | 48 ~Frame(); |
56 | 49 |
57 // Movable type. | 50 // Movable type. |
58 Frame(Frame&& rhs); | 51 Frame(Frame&& rhs); |
59 Frame& operator=(Frame&& rhs); | 52 Frame& operator=(Frame&& rhs); |
60 | 53 |
61 uint32_t output_surface_id; | 54 uint32_t output_surface_id; |
62 std::unique_ptr<cc::CompositorFrame> frame; | 55 std::unique_ptr<cc::CompositorFrame> frame; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // and if any input animation is active, it should tick now. | 99 // and if any input animation is active, it should tick now. |
107 virtual void OnComputeScroll(base::TimeTicks animation_time) = 0; | 100 virtual void OnComputeScroll(base::TimeTicks animation_time) = 0; |
108 | 101 |
109 protected: | 102 protected: |
110 virtual ~SynchronousCompositor() {} | 103 virtual ~SynchronousCompositor() {} |
111 }; | 104 }; |
112 | 105 |
113 } // namespace content | 106 } // namespace content |
114 | 107 |
115 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ | 108 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ |
OLD | NEW |