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

Side by Side Diff: content/renderer/android/synchronous_compositor_output_surface.cc

Issue 2002303002: Consolidate OutputSurface constructors into GL vs Vulkan. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: outputsurface-constructors: rebase-and-fixcrash Created 4 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
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/renderer/android/synchronous_compositor_output_surface.h" 5 #include "content/renderer/android/synchronous_compositor_output_surface.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/ptr_util.h"
12 #include "cc/output/compositor_frame.h" 13 #include "cc/output/compositor_frame.h"
13 #include "cc/output/context_provider.h" 14 #include "cc/output/context_provider.h"
14 #include "cc/output/output_surface_client.h" 15 #include "cc/output/output_surface_client.h"
15 #include "cc/output/software_output_device.h" 16 #include "cc/output/software_output_device.h"
16 #include "content/common/android/sync_compositor_messages.h" 17 #include "content/common/android/sync_compositor_messages.h"
17 #include "content/renderer/android/synchronous_compositor_external_begin_frame_s ource.h" 18 #include "content/renderer/android/synchronous_compositor_external_begin_frame_s ource.h"
18 #include "content/renderer/android/synchronous_compositor_filter.h" 19 #include "content/renderer/android/synchronous_compositor_filter.h"
19 #include "content/renderer/android/synchronous_compositor_registry.h" 20 #include "content/renderer/android/synchronous_compositor_registry.h"
20 #include "content/renderer/gpu/frame_swap_message_queue.h" 21 #include "content/renderer/gpu/frame_swap_message_queue.h"
21 #include "content/renderer/render_thread_impl.h" 22 #include "content/renderer/render_thread_impl.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 void EndPaint() override {} 63 void EndPaint() override {}
63 64
64 private: 65 private:
65 SynchronousCompositorOutputSurface* surface_; 66 SynchronousCompositorOutputSurface* surface_;
66 SkCanvas null_canvas_; 67 SkCanvas null_canvas_;
67 68
68 DISALLOW_COPY_AND_ASSIGN(SoftwareDevice); 69 DISALLOW_COPY_AND_ASSIGN(SoftwareDevice);
69 }; 70 };
70 71
71 SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface( 72 SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface(
72 const scoped_refptr<cc::ContextProvider>& context_provider, 73 scoped_refptr<cc::ContextProvider> context_provider,
73 const scoped_refptr<cc::ContextProvider>& worker_context_provider, 74 scoped_refptr<cc::ContextProvider> worker_context_provider,
74 int routing_id, 75 int routing_id,
75 uint32_t output_surface_id, 76 uint32_t output_surface_id,
76 SynchronousCompositorRegistry* registry, 77 SynchronousCompositorRegistry* registry,
77 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue) 78 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue)
78 : cc::OutputSurface( 79 : cc::OutputSurface(std::move(context_provider),
79 context_provider, 80 std::move(worker_context_provider),
80 worker_context_provider, 81 base::MakeUnique<SoftwareDevice>(this)),
81 nullptr,
82 std::unique_ptr<cc::SoftwareOutputDevice>(new SoftwareDevice(this))),
83 routing_id_(routing_id), 82 routing_id_(routing_id),
84 output_surface_id_(output_surface_id), 83 output_surface_id_(output_surface_id),
85 registry_(registry), 84 registry_(registry),
86 sender_(RenderThreadImpl::current()->sync_compositor_message_filter()), 85 sender_(RenderThreadImpl::current()->sync_compositor_message_filter()),
87 registered_(false), 86 registered_(false),
88 sync_client_(nullptr), 87 sync_client_(nullptr),
89 current_sw_canvas_(nullptr), 88 current_sw_canvas_(nullptr),
90 memory_policy_(0u), 89 memory_policy_(0u),
91 did_swap_(false), 90 did_swap_(false),
92 frame_swap_message_queue_(frame_swap_message_queue), 91 frame_swap_message_queue_(frame_swap_message_queue),
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 bool SynchronousCompositorOutputSurface::Send(IPC::Message* message) { 303 bool SynchronousCompositorOutputSurface::Send(IPC::Message* message) {
305 DCHECK(CalledOnValidThread()); 304 DCHECK(CalledOnValidThread());
306 return sender_->Send(message); 305 return sender_->Send(message);
307 } 306 }
308 307
309 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { 308 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const {
310 return thread_checker_.CalledOnValidThread(); 309 return thread_checker_.CalledOnValidThread();
311 } 310 }
312 311
313 } // namespace content 312 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/android/synchronous_compositor_output_surface.h ('k') | content/renderer/gpu/compositor_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698