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

Side by Side Diff: cc/test/fake_compositor_frame_sink.cc

Issue 2888043004: [cc] Add and plumb CFS::DidNotProduceFrame. (Closed)
Patch Set: address nits, rename to DidNotProduceFrame. Created 3 years, 7 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
« no previous file with comments | « cc/test/fake_compositor_frame_sink.h ('k') | cc/test/test_compositor_frame_sink.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "cc/test/fake_compositor_frame_sink.h" 5 #include "cc/test/fake_compositor_frame_sink.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/threading/thread_task_runner_handle.h" 8 #include "base/threading/thread_task_runner_handle.h"
9 #include "cc/output/compositor_frame_sink_client.h" 9 #include "cc/output/compositor_frame_sink_client.h"
10 #include "cc/resources/returned_resource.h" 10 #include "cc/resources/returned_resource.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 resources_held_by_parent_.insert(resources_held_by_parent_.end(), 57 resources_held_by_parent_.insert(resources_held_by_parent_.end(),
58 last_sent_frame_->resource_list.begin(), 58 last_sent_frame_->resource_list.begin(),
59 last_sent_frame_->resource_list.end()); 59 last_sent_frame_->resource_list.end());
60 60
61 base::ThreadTaskRunnerHandle::Get()->PostTask( 61 base::ThreadTaskRunnerHandle::Get()->PostTask(
62 FROM_HERE, 62 FROM_HERE,
63 base::BindOnce(&FakeCompositorFrameSink::DidReceiveCompositorFrameAck, 63 base::BindOnce(&FakeCompositorFrameSink::DidReceiveCompositorFrameAck,
64 weak_ptr_factory_.GetWeakPtr())); 64 weak_ptr_factory_.GetWeakPtr()));
65 } 65 }
66 66
67 void FakeCompositorFrameSink::DidNotProduceFrame(const BeginFrameAck& ack) {}
68
67 void FakeCompositorFrameSink::DidReceiveCompositorFrameAck() { 69 void FakeCompositorFrameSink::DidReceiveCompositorFrameAck() {
68 client_->DidReceiveCompositorFrameAck(); 70 client_->DidReceiveCompositorFrameAck();
69 } 71 }
70 72
71 void FakeCompositorFrameSink::ReturnResourcesHeldByParent() { 73 void FakeCompositorFrameSink::ReturnResourcesHeldByParent() {
72 if (last_sent_frame_) { 74 if (last_sent_frame_) {
73 // Return the last frame's resources immediately. 75 // Return the last frame's resources immediately.
74 ReturnedResourceArray resources; 76 ReturnedResourceArray resources;
75 for (const auto& resource : resources_held_by_parent_) 77 for (const auto& resource : resources_held_by_parent_)
76 resources.push_back(resource.ToReturnedResource()); 78 resources.push_back(resource.ToReturnedResource());
77 resources_held_by_parent_.clear(); 79 resources_held_by_parent_.clear();
78 client_->ReclaimResources(resources); 80 client_->ReclaimResources(resources);
79 } 81 }
80 } 82 }
81 83
82 } // namespace cc 84 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_compositor_frame_sink.h ('k') | cc/test/test_compositor_frame_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698