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