| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CC_SURFACES_DISPLAY_COMPOSITOR_LOCK_MANAGER_H_ |
| 6 #define CC_SURFACES_DISPLAY_COMPOSITOR_LOCK_MANAGER_H_ |
| 7 |
| 8 #include "cc/scheduler/begin_frame_source.h" |
| 9 #include "cc/surfaces/pending_surface_observer.h" |
| 10 #include "cc/surfaces/surface.h" |
| 11 #include "cc/surfaces/surface_observer.h" |
| 12 #include "cc/surfaces/surfaces_export.h" |
| 13 |
| 14 namespace cc { |
| 15 |
| 16 class SurfaceManager; |
| 17 |
| 18 class CC_SURFACES_EXPORT DisplayCompositorLockManager |
| 19 : public BeginFrameObserver, |
| 20 public PendingSurfaceObserver, |
| 21 public SurfaceObserver { |
| 22 public: |
| 23 DisplayCompositorLockManager(SurfaceManager* surface_manager, |
| 24 BeginFrameSource* begin_frame_source); |
| 25 ~DisplayCompositorLockManager() override; |
| 26 |
| 27 void RequestSurfaceResolution(Surface* pending_surface); |
| 28 |
| 29 bool observing_begin_frames() const { return observing_begin_frames_; } |
| 30 |
| 31 // BeginFrameObserver implementation. |
| 32 void OnBeginFrame(const BeginFrameArgs& args) override; |
| 33 const BeginFrameArgs& LastUsedBeginFrameArgs() const override; |
| 34 void OnBeginFrameSourcePausedChanged(bool paused) override; |
| 35 |
| 36 // PendingSurfaceObserver implementation: |
| 37 void OnSurfaceActivated(Surface* pending_surface) override; |
| 38 void OnSurfaceChanged( |
| 39 Surface* pending_surface, |
| 40 const SurfaceDependencies& added_dependencies, |
| 41 const SurfaceDependencies& removed_dependencies) override; |
| 42 void OnSurfaceDiscarded(Surface* pending_surface) override; |
| 43 |
| 44 // SurfaceObserver implementation: |
| 45 void OnSurfaceCreated(const SurfaceInfo& surface_info) override; |
| 46 void OnSurfaceDamaged(const SurfaceId& surface_id, bool* changed) override; |
| 47 |
| 48 private: |
| 49 void ReportSurfaceIdAvailable(const SurfaceId& surface_id); |
| 50 |
| 51 SurfaceManager* const surface_manager_; |
| 52 |
| 53 // The last begin frame args generated by the begin frame source. |
| 54 BeginFrameArgs last_begin_frame_args_; |
| 55 |
| 56 BeginFrameSource* begin_frame_source_; |
| 57 |
| 58 // Whether or not a rame observer has been added. |
| 59 bool observing_begin_frames_ = false; |
| 60 |
| 61 uint32_t begin_frame_count_ = 0; |
| 62 |
| 63 std::unordered_map<SurfaceId, PendingSurfaceSet, SurfaceIdHash> |
| 64 blocking_surfaces_; |
| 65 |
| 66 PendingSurfaceSet pending_surfaces_; |
| 67 |
| 68 DISALLOW_COPY_AND_ASSIGN(DisplayCompositorLockManager); |
| 69 }; |
| 70 |
| 71 } // namespace cc |
| 72 |
| 73 #endif // CC_SURFACES_DISPLAY_COMPOSITOR_LOCK_MANAGER_H_ |
| OLD | NEW |