Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
|
Fady Samuel
2017/04/12 03:17:02
nit: 2017
| |
| 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 COMPONENTS_DISPLAY_COMPOSITOR_FRAME_EVICTOR_H_ | |
| 6 #define COMPONENTS_DISPLAY_COMPOSITOR_FRAME_EVICTOR_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "components/display_compositor/display_compositor_export.h" | |
| 10 #include "components/display_compositor/frame_eviction_manager.h" | |
| 11 | |
| 12 namespace display_compositor { | |
| 13 | |
| 14 class DISPLAY_COMPOSITOR_EXPORT FrameEvictorClient { | |
| 15 public: | |
| 16 virtual ~FrameEvictorClient() {} | |
| 17 virtual void EvictDelegatedFrame() = 0; | |
| 18 }; | |
| 19 | |
| 20 class DISPLAY_COMPOSITOR_EXPORT FrameEvictor | |
| 21 : public FrameEvictionManagerClient { | |
| 22 public: | |
| 23 // |client| must outlive |this|. | |
| 24 explicit FrameEvictor(FrameEvictorClient* client); | |
| 25 ~FrameEvictor() override; | |
| 26 | |
| 27 void SwappedFrame(bool visible); | |
| 28 void DiscardedFrame(); | |
| 29 void SetVisible(bool visible); | |
| 30 void LockFrame(); | |
| 31 void UnlockFrame(); | |
| 32 bool HasFrame() { return has_frame_; } | |
| 33 | |
| 34 private: | |
| 35 // FrameEvictionManagerClient implementation. | |
| 36 void EvictCurrentFrame() override; | |
| 37 | |
| 38 FrameEvictorClient* client_; | |
| 39 bool has_frame_; | |
| 40 bool visible_; | |
| 41 | |
| 42 DISALLOW_COPY_AND_ASSIGN(FrameEvictor); | |
| 43 }; | |
| 44 | |
| 45 } // namespace display_compositor | |
| 46 | |
| 47 #endif // COMPONENTS_DISPLAY_COMPOSITOR_FRAME_EVICTOR_H_ | |
| OLD | NEW |