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

Side by Side Diff: cc/output/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/output/compositor_frame_sink.h ('k') | cc/output/compositor_frame_sink_unittest.cc » ('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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "cc/output/compositor_frame_sink.h" 5 #include "cc/output/compositor_frame_sink.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/threading/thread_task_runner_handle.h" 12 #include "base/threading/thread_task_runner_handle.h"
13 #include "base/trace_event/trace_event.h" 13 #include "base/trace_event/trace_event.h"
14 #include "cc/output/compositor_frame_sink_client.h" 14 #include "cc/output/compositor_frame_sink_client.h"
15 #include "gpu/GLES2/gl2extchromium.h" 15 #include "gpu/GLES2/gl2extchromium.h"
16 #include "gpu/command_buffer/client/context_support.h" 16 #include "gpu/command_buffer/client/context_support.h"
17 #include "gpu/command_buffer/client/gles2_interface.h" 17 #include "gpu/command_buffer/client/gles2_interface.h"
18 18
19 namespace cc { 19 namespace cc {
20 20
21 CompositorFrameSink::CompositorFrameSink( 21 CompositorFrameSink::CompositorFrameSink(
22 scoped_refptr<ContextProvider> context_provider, 22 scoped_refptr<ContextProvider> context_provider,
23 scoped_refptr<ContextProvider> worker_context_provider) 23 scoped_refptr<ContextProvider> worker_context_provider,
24 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
25 SharedBitmapManager* shared_bitmap_manager)
24 : context_provider_(std::move(context_provider)), 26 : context_provider_(std::move(context_provider)),
25 worker_context_provider_(std::move(worker_context_provider)) { 27 worker_context_provider_(std::move(worker_context_provider)),
28 gpu_memory_buffer_manager_(gpu_memory_buffer_manager),
29 shared_bitmap_manager_(shared_bitmap_manager) {
26 client_thread_checker_.DetachFromThread(); 30 client_thread_checker_.DetachFromThread();
27 } 31 }
28 32
29 CompositorFrameSink::CompositorFrameSink( 33 CompositorFrameSink::CompositorFrameSink(
30 scoped_refptr<VulkanContextProvider> vulkan_context_provider) 34 scoped_refptr<VulkanContextProvider> vulkan_context_provider)
31 : vulkan_context_provider_(vulkan_context_provider) { 35 : vulkan_context_provider_(vulkan_context_provider),
36 gpu_memory_buffer_manager_(nullptr),
37 shared_bitmap_manager_(nullptr) {
32 client_thread_checker_.DetachFromThread(); 38 client_thread_checker_.DetachFromThread();
33 } 39 }
34 40
35 CompositorFrameSink::~CompositorFrameSink() { 41 CompositorFrameSink::~CompositorFrameSink() {
36 if (client_) 42 if (client_)
37 DetachFromClient(); 43 DetachFromClient();
38 } 44 }
39 45
40 bool CompositorFrameSink::BindToClient(CompositorFrameSinkClient* client) { 46 bool CompositorFrameSink::BindToClient(CompositorFrameSinkClient* client) {
41 DCHECK(client_thread_checker_.CalledOnValidThread()); 47 DCHECK(client_thread_checker_.CalledOnValidThread());
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 context_provider_ = nullptr; 80 context_provider_ = nullptr;
75 client_ = nullptr; 81 client_ = nullptr;
76 } 82 }
77 83
78 void CompositorFrameSink::DidLoseCompositorFrameSink() { 84 void CompositorFrameSink::DidLoseCompositorFrameSink() {
79 TRACE_EVENT0("cc", "CompositorFrameSink::DidLoseCompositorFrameSink"); 85 TRACE_EVENT0("cc", "CompositorFrameSink::DidLoseCompositorFrameSink");
80 client_->DidLoseCompositorFrameSink(); 86 client_->DidLoseCompositorFrameSink();
81 } 87 }
82 88
83 } // namespace cc 89 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/compositor_frame_sink.h ('k') | cc/output/compositor_frame_sink_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698