Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Side by Side Diff: components/viz/frame_sinks/frame_evictor.h

Issue 2811083002: Move frame eviction into components (Closed)
Patch Set: Fix win dbg warning C4275 with NON_EXPORTED_BASE Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698