| 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 21 matching lines...) Expand all Loading... |
| 32 class FrameGeneratorTest; | 32 class FrameGeneratorTest; |
| 33 } | 33 } |
| 34 | 34 |
| 35 class FrameGeneratorDelegate; | 35 class FrameGeneratorDelegate; |
| 36 class ServerWindow; | 36 class ServerWindow; |
| 37 | 37 |
| 38 // Responsible for redrawing the display in response to the redraw requests by | 38 // Responsible for redrawing the display in response to the redraw requests by |
| 39 // submitting CompositorFrames to the owned CompositorFrameSink. | 39 // submitting CompositorFrames to the owned CompositorFrameSink. |
| 40 class FrameGenerator : public cc::mojom::MojoCompositorFrameSinkClient { | 40 class FrameGenerator : public cc::mojom::MojoCompositorFrameSinkClient { |
| 41 public: | 41 public: |
| 42 FrameGenerator(FrameGeneratorDelegate* delegate, | 42 FrameGenerator(FrameGeneratorDelegate* delegate, ServerWindow* root_window); |
| 43 ServerWindow* root_window, | |
| 44 gfx::AcceleratedWidget widget); | |
| 45 ~FrameGenerator() override; | 43 ~FrameGenerator() override; |
| 46 | 44 |
| 47 void SetDeviceScaleFactor(float device_scale_factor); | 45 void SetDeviceScaleFactor(float device_scale_factor); |
| 48 | 46 |
| 47 // Schedules a redraw for the provided region. |
| 48 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget); |
| 49 |
| 49 // Updates the WindowManager's SurfaceInfo. | 50 // Updates the WindowManager's SurfaceInfo. |
| 50 void OnSurfaceCreated(const cc::SurfaceInfo& surface_info); | 51 void OnSurfaceCreated(const cc::SurfaceInfo& surface_info); |
| 51 | 52 |
| 52 void OnWindowDamaged(); | 53 void OnWindowDamaged(); |
| 53 | 54 |
| 54 private: | 55 private: |
| 55 friend class ui::ws::test::FrameGeneratorTest; | 56 friend class ui::ws::test::FrameGeneratorTest; |
| 56 | 57 |
| 57 // cc::mojom::MojoCompositorFrameSinkClient implementation: | 58 // cc::mojom::MojoCompositorFrameSinkClient implementation: |
| 58 void DidReceiveCompositorFrameAck() override; | 59 void DidReceiveCompositorFrameAck() override; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 83 mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient> binding_; | 84 mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient> binding_; |
| 84 | 85 |
| 85 DISALLOW_COPY_AND_ASSIGN(FrameGenerator); | 86 DISALLOW_COPY_AND_ASSIGN(FrameGenerator); |
| 86 }; | 87 }; |
| 87 | 88 |
| 88 } // namespace ws | 89 } // namespace ws |
| 89 | 90 |
| 90 } // namespace ui | 91 } // namespace ui |
| 91 | 92 |
| 92 #endif // SERVICES_UI_WS_FRAME_GENERATOR_H_ | 93 #endif // SERVICES_UI_WS_FRAME_GENERATOR_H_ |
| OLD | NEW |