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_RENDERER_HOST_BROWSER_COMPOSITOR_VIEW_MAC_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_BROWSER_COMPOSITOR_VIEW_MAC_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_COMPOSITOR_VIEW_MAC_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_COMPOSITOR_VIEW_MAC_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "cc/output/begin_frame_args.h" |
11 #include "cc/scheduler/begin_frame_source.h" | 12 #include "cc/scheduler/begin_frame_source.h" |
12 #include "content/browser/renderer_host/delegated_frame_host.h" | 13 #include "content/browser/renderer_host/delegated_frame_host.h" |
13 #include "ui/compositor/compositor.h" | 14 #include "ui/compositor/compositor.h" |
14 #include "ui/compositor/compositor_observer.h" | 15 #include "ui/compositor/compositor_observer.h" |
15 | 16 |
16 namespace ui { | 17 namespace ui { |
17 class AcceleratedWidgetMac; | 18 class AcceleratedWidgetMac; |
18 class AcceleratedWidgetMacNSView; | 19 class AcceleratedWidgetMacNSView; |
19 } | 20 } |
20 | 21 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 56 |
56 // These will not return nullptr until Destroy is called. | 57 // These will not return nullptr until Destroy is called. |
57 DelegatedFrameHost* GetDelegatedFrameHost(); | 58 DelegatedFrameHost* GetDelegatedFrameHost(); |
58 | 59 |
59 // This may return nullptr, if this has detached itself from its | 60 // This may return nullptr, if this has detached itself from its |
60 // ui::Compositor. | 61 // ui::Compositor. |
61 ui::AcceleratedWidgetMac* GetAcceleratedWidgetMac(); | 62 ui::AcceleratedWidgetMac* GetAcceleratedWidgetMac(); |
62 | 63 |
63 void SwapCompositorFrame(uint32_t compositor_frame_sink_id, | 64 void SwapCompositorFrame(uint32_t compositor_frame_sink_id, |
64 cc::CompositorFrame frame); | 65 cc::CompositorFrame frame); |
| 66 void OnBeginFrameDidNotDraw(const cc::BeginFrameAck& ack); |
65 void SetHasTransparentBackground(bool transparent); | 67 void SetHasTransparentBackground(bool transparent); |
66 void SetDisplayColorSpace(const gfx::ColorSpace& color_space); | 68 void SetDisplayColorSpace(const gfx::ColorSpace& color_space); |
67 void UpdateVSyncParameters(const base::TimeTicks& timebase, | 69 void UpdateVSyncParameters(const base::TimeTicks& timebase, |
68 const base::TimeDelta& interval); | 70 const base::TimeDelta& interval); |
69 void SetNeedsBeginFrames(bool needs_begin_frames); | 71 void SetNeedsBeginFrames(bool needs_begin_frames); |
70 | 72 |
71 // This is used to ensure that the ui::Compositor be attached to the | 73 // This is used to ensure that the ui::Compositor be attached to the |
72 // DelegatedFrameHost while the RWHImpl is visible. | 74 // DelegatedFrameHost while the RWHImpl is visible. |
73 // Note: This should be called before the RWHImpl is made visible and after | 75 // Note: This should be called before the RWHImpl is made visible and after |
74 // it has been hidden, in order to ensure that thumbnailer notifications to | 76 // it has been hidden, in order to ensure that thumbnailer notifications to |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 std::unique_ptr<RecyclableCompositorMac> recyclable_compositor_; | 174 std::unique_ptr<RecyclableCompositorMac> recyclable_compositor_; |
173 | 175 |
174 std::unique_ptr<DelegatedFrameHost> delegated_frame_host_; | 176 std::unique_ptr<DelegatedFrameHost> delegated_frame_host_; |
175 std::unique_ptr<ui::Layer> root_layer_; | 177 std::unique_ptr<ui::Layer> root_layer_; |
176 | 178 |
177 bool has_transparent_background_ = false; | 179 bool has_transparent_background_ = false; |
178 | 180 |
179 // The begin frame source being observed. Null if none. | 181 // The begin frame source being observed. Null if none. |
180 cc::BeginFrameSource* begin_frame_source_ = nullptr; | 182 cc::BeginFrameSource* begin_frame_source_ = nullptr; |
181 cc::BeginFrameArgs last_begin_frame_args_; | 183 cc::BeginFrameArgs last_begin_frame_args_; |
| 184 uint64_t latest_confirmed_frame_ = cc::BeginFrameArgs::kInvalidFrameNumber; |
182 bool needs_begin_frames_ = false; | 185 bool needs_begin_frames_ = false; |
183 | 186 |
184 base::WeakPtrFactory<BrowserCompositorMac> weak_factory_; | 187 base::WeakPtrFactory<BrowserCompositorMac> weak_factory_; |
185 }; | 188 }; |
186 | 189 |
187 } // namespace content | 190 } // namespace content |
188 | 191 |
189 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_COMPOSITOR_VIEW_MAC_H_ | 192 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_COMPOSITOR_VIEW_MAC_H_ |
OLD | NEW |