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

Side by Side Diff: components/display_compositor/delegated_frame_evictor.cc

Issue 2811083002: Move frame eviction into components (Closed)
Patch Set: 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "content/browser/renderer_host/delegated_frame_evictor.h" 5 #include "components/display_compositor/delegated_frame_evictor.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace content { 9 namespace display_compositor {
10 10
11 DelegatedFrameEvictor::DelegatedFrameEvictor( 11 DelegatedFrameEvictor::DelegatedFrameEvictor(
12 DelegatedFrameEvictorClient* client) 12 DelegatedFrameEvictorClient* client)
13 : client_(client), has_frame_(false), visible_(false) { 13 : client_(client), has_frame_(false), visible_(false) {}
14
15 DelegatedFrameEvictor::~DelegatedFrameEvictor() {
16 DiscardedFrame();
14 } 17 }
15 18
16 DelegatedFrameEvictor::~DelegatedFrameEvictor() { DiscardedFrame(); }
17
18 void DelegatedFrameEvictor::SwappedFrame(bool visible) { 19 void DelegatedFrameEvictor::SwappedFrame(bool visible) {
19 visible_ = visible; 20 visible_ = visible;
20 has_frame_ = true; 21 has_frame_ = true;
21 RendererFrameManager::GetInstance()->AddFrame(this, visible); 22 RendererFrameManager::GetInstance()->AddFrame(this, visible);
22 } 23 }
23 24
24 void DelegatedFrameEvictor::DiscardedFrame() { 25 void DelegatedFrameEvictor::DiscardedFrame() {
25 RendererFrameManager::GetInstance()->RemoveFrame(this); 26 RendererFrameManager::GetInstance()->RemoveFrame(this);
26 has_frame_ = false; 27 has_frame_ = false;
27 } 28 }
(...skipping 18 matching lines...) Expand all
46 47
47 void DelegatedFrameEvictor::UnlockFrame() { 48 void DelegatedFrameEvictor::UnlockFrame() {
48 DCHECK(has_frame_); 49 DCHECK(has_frame_);
49 RendererFrameManager::GetInstance()->UnlockFrame(this); 50 RendererFrameManager::GetInstance()->UnlockFrame(this);
50 } 51 }
51 52
52 void DelegatedFrameEvictor::EvictCurrentFrame() { 53 void DelegatedFrameEvictor::EvictCurrentFrame() {
53 client_->EvictDelegatedFrame(); 54 client_->EvictDelegatedFrame();
54 } 55 }
55 56
56 } // namespace content 57 } // namespace display_compositor
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698