OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 SERVICES_UI_WS_FRAME_GENERATOR_H_ | 5 #ifndef SERVICES_UI_WS_FRAME_GENERATOR_H_ |
6 #define SERVICES_UI_WS_FRAME_GENERATOR_H_ | 6 #define SERVICES_UI_WS_FRAME_GENERATOR_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 class FrameGeneratorDelegate; | 31 class FrameGeneratorDelegate; |
32 class ServerWindow; | 32 class ServerWindow; |
33 | 33 |
34 // Responsible for redrawing the display in response to the redraw requests by | 34 // Responsible for redrawing the display in response to the redraw requests by |
35 // submitting CompositorFrames to the owned CompositorFrameSink. | 35 // submitting CompositorFrames to the owned CompositorFrameSink. |
36 class FrameGenerator : public cc::CompositorFrameSinkClient, | 36 class FrameGenerator : public cc::CompositorFrameSinkClient, |
37 public cc::BeginFrameObserver { | 37 public cc::BeginFrameObserver { |
38 public: | 38 public: |
39 FrameGenerator( | 39 FrameGenerator( |
40 FrameGeneratorDelegate* delegate, | |
41 ServerWindow* root_window, | 40 ServerWindow* root_window, |
42 std::unique_ptr<cc::CompositorFrameSink> compositor_frame_sink); | 41 std::unique_ptr<cc::CompositorFrameSink> compositor_frame_sink); |
43 ~FrameGenerator() override; | 42 ~FrameGenerator() override; |
44 | 43 |
45 void SetDeviceScaleFactor(float device_scale_factor); | 44 void SetDeviceScaleFactor(float device_scale_factor); |
| 45 void SetHighContrastMode(bool enabled); |
46 | 46 |
47 // Updates the WindowManager's SurfaceInfo. | 47 // Updates the WindowManager's SurfaceInfo. |
48 void OnSurfaceCreated(const cc::SurfaceInfo& surface_info); | 48 void OnSurfaceCreated(const cc::SurfaceInfo& surface_info); |
49 | 49 |
50 void OnWindowDamaged(); | 50 void OnWindowDamaged(); |
51 | 51 |
52 private: | 52 private: |
53 // cc::CompositorFrameSinkClient implementation: | 53 // cc::CompositorFrameSinkClient implementation: |
54 void SetBeginFrameSource(cc::BeginFrameSource* source) override; | 54 void SetBeginFrameSource(cc::BeginFrameSource* source) override; |
55 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; | 55 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; |
(...skipping 25 matching lines...) Expand all Loading... |
81 void SetNeedsBeginFrame(bool needs_begin_frame); | 81 void SetNeedsBeginFrame(bool needs_begin_frame); |
82 | 82 |
83 FrameGeneratorDelegate* delegate_; | 83 FrameGeneratorDelegate* delegate_; |
84 ServerWindow* const root_window_; | 84 ServerWindow* const root_window_; |
85 float device_scale_factor_ = 1.f; | 85 float device_scale_factor_ = 1.f; |
86 | 86 |
87 std::unique_ptr<cc::CompositorFrameSink> compositor_frame_sink_; | 87 std::unique_ptr<cc::CompositorFrameSink> compositor_frame_sink_; |
88 cc::BeginFrameArgs last_begin_frame_args_; | 88 cc::BeginFrameArgs last_begin_frame_args_; |
89 cc::BeginFrameSource* begin_frame_source_ = nullptr; | 89 cc::BeginFrameSource* begin_frame_source_ = nullptr; |
90 bool observing_begin_frames_ = false; | 90 bool observing_begin_frames_ = false; |
| 91 bool high_contrast_mode_enabled_ = false; |
91 | 92 |
92 cc::SurfaceInfo window_manager_surface_info_; | 93 cc::SurfaceInfo window_manager_surface_info_; |
93 | 94 |
94 DISALLOW_COPY_AND_ASSIGN(FrameGenerator); | 95 DISALLOW_COPY_AND_ASSIGN(FrameGenerator); |
95 }; | 96 }; |
96 | 97 |
97 } // namespace ws | 98 } // namespace ws |
98 | 99 |
99 } // namespace ui | 100 } // namespace ui |
100 | 101 |
101 #endif // SERVICES_UI_WS_FRAME_GENERATOR_H_ | 102 #endif // SERVICES_UI_WS_FRAME_GENERATOR_H_ |
OLD | NEW |