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