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

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

Issue 2452483002: Move GpuMemoryBufferManager and SharedBitmapManager to CompositorFrameSink (Closed)
Patch Set: rebase Created 4 years, 1 month 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/fake_layer_tree_host.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"
11 #include "cc/test/begin_frame_args_test.h" 11 #include "cc/test/begin_frame_args_test.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace cc { 14 namespace cc {
15 15
16 FakeCompositorFrameSink::FakeCompositorFrameSink( 16 FakeCompositorFrameSink::FakeCompositorFrameSink(
17 scoped_refptr<ContextProvider> context_provider, 17 scoped_refptr<ContextProvider> context_provider,
18 scoped_refptr<ContextProvider> worker_context_provider) 18 scoped_refptr<ContextProvider> worker_context_provider)
19 : CompositorFrameSink(std::move(context_provider), 19 : CompositorFrameSink(std::move(context_provider),
20 std::move(worker_context_provider)), 20 std::move(worker_context_provider),
21 weak_ptr_factory_(this) {} 21 nullptr,
22 nullptr),
23 weak_ptr_factory_(this) {
24 gpu_memory_buffer_manager_ =
25 context_provider_ ? &test_gpu_memory_buffer_manager_ : nullptr;
26 shared_bitmap_manager_ =
27 context_provider_ ? nullptr : &test_shared_bitmap_manager_;
28 }
22 29
23 FakeCompositorFrameSink::~FakeCompositorFrameSink() = default; 30 FakeCompositorFrameSink::~FakeCompositorFrameSink() = default;
24 31
25 void FakeCompositorFrameSink::DetachFromClient() { 32 void FakeCompositorFrameSink::DetachFromClient() {
26 ReturnResourcesHeldByParent(); 33 ReturnResourcesHeldByParent();
27 CompositorFrameSink::DetachFromClient(); 34 CompositorFrameSink::DetachFromClient();
28 } 35 }
29 36
30 void FakeCompositorFrameSink::SubmitCompositorFrame(CompositorFrame frame) { 37 void FakeCompositorFrameSink::SubmitCompositorFrame(CompositorFrame frame) {
31 ReturnResourcesHeldByParent(); 38 ReturnResourcesHeldByParent();
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 // Return the last frame's resources immediately. 75 // Return the last frame's resources immediately.
69 ReturnedResourceArray resources; 76 ReturnedResourceArray resources;
70 for (const auto& resource : resources_held_by_parent_) 77 for (const auto& resource : resources_held_by_parent_)
71 resources.push_back(resource.ToReturnedResource()); 78 resources.push_back(resource.ToReturnedResource());
72 resources_held_by_parent_.clear(); 79 resources_held_by_parent_.clear();
73 client_->ReclaimResources(resources); 80 client_->ReclaimResources(resources);
74 } 81 }
75 } 82 }
76 83
77 } // namespace cc 84 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_compositor_frame_sink.h ('k') | cc/test/fake_layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698