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

Side by Side Diff: cc/output/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
« no previous file with comments | « cc/output/output_surface.h ('k') | cc/output/output_surface_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/output_surface.h" 5 #include "cc/output/output_surface.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"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 uint64_t share_group_tracing_guid_; 114 uint64_t share_group_tracing_guid_;
115 115
116 DISALLOW_COPY_AND_ASSIGN(SkiaGpuTraceMemoryDump); 116 DISALLOW_COPY_AND_ASSIGN(SkiaGpuTraceMemoryDump);
117 }; 117 };
118 118
119 } // namespace 119 } // namespace
120 120
121 OutputSurface::OutputSurface( 121 OutputSurface::OutputSurface(
122 scoped_refptr<ContextProvider> context_provider, 122 scoped_refptr<ContextProvider> context_provider,
123 scoped_refptr<ContextProvider> worker_context_provider, 123 scoped_refptr<ContextProvider> worker_context_provider,
124 scoped_refptr<VulkanContextProvider> vulkan_context_provider,
125 std::unique_ptr<SoftwareOutputDevice> software_device) 124 std::unique_ptr<SoftwareOutputDevice> software_device)
126 : client_(NULL), 125 : context_provider_(std::move(context_provider)),
127 context_provider_(std::move(context_provider)),
128 worker_context_provider_(std::move(worker_context_provider)), 126 worker_context_provider_(std::move(worker_context_provider)),
129 vulkan_context_provider_(vulkan_context_provider),
130 software_device_(std::move(software_device)), 127 software_device_(std::move(software_device)),
131 device_scale_factor_(-1),
132 has_alpha_(true),
133 external_stencil_test_enabled_(false),
134 weak_ptr_factory_(this) { 128 weak_ptr_factory_(this) {
135 client_thread_checker_.DetachFromThread(); 129 client_thread_checker_.DetachFromThread();
136 } 130 }
137 131
138 OutputSurface::OutputSurface(scoped_refptr<ContextProvider> context_provider)
139 : OutputSurface(std::move(context_provider),
140 nullptr,
141 nullptr,
142 nullptr) {
143 }
144
145 OutputSurface::OutputSurface( 132 OutputSurface::OutputSurface(
146 scoped_refptr<ContextProvider> context_provider, 133 scoped_refptr<VulkanContextProvider> vulkan_context_provider)
147 scoped_refptr<ContextProvider> worker_context_provider) 134 : vulkan_context_provider_(vulkan_context_provider),
148 : OutputSurface(std::move(context_provider), 135 weak_ptr_factory_(this) {
149 std::move(worker_context_provider), 136 client_thread_checker_.DetachFromThread();
150 nullptr,
151 nullptr) {
152 }
153
154 OutputSurface::OutputSurface(
155 std::unique_ptr<SoftwareOutputDevice> software_device)
156 : OutputSurface(nullptr,
157 nullptr,
158 nullptr,
159 std::move(software_device)) {
160 }
161
162 OutputSurface::OutputSurface(
163 scoped_refptr<ContextProvider> context_provider,
164 std::unique_ptr<SoftwareOutputDevice> software_device)
165 : OutputSurface(std::move(context_provider),
166 nullptr,
167 nullptr,
168 std::move(software_device)) {
169 } 137 }
170 138
171 // Forwarded to OutputSurfaceClient 139 // Forwarded to OutputSurfaceClient
172 void OutputSurface::SetNeedsRedrawRect(const gfx::Rect& damage_rect) { 140 void OutputSurface::SetNeedsRedrawRect(const gfx::Rect& damage_rect) {
173 TRACE_EVENT0("cc", "OutputSurface::SetNeedsRedrawRect"); 141 TRACE_EVENT0("cc", "OutputSurface::SetNeedsRedrawRect");
174 client_->SetNeedsRedrawRect(damage_rect); 142 client_->SetNeedsRedrawRect(damage_rect);
175 } 143 }
176 144
177 void OutputSurface::ReclaimResources(const CompositorFrameAck* ack) { 145 void OutputSurface::ReclaimResources(const CompositorFrameAck* ack) {
178 client_->ReclaimResources(ack); 146 client_->ReclaimResources(ack);
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 if (context_provider_.get()) { 328 if (context_provider_.get()) {
361 context_provider_->SetLostContextCallback( 329 context_provider_->SetLostContextCallback(
362 ContextProvider::LostContextCallback()); 330 ContextProvider::LostContextCallback());
363 } 331 }
364 context_provider_ = nullptr; 332 context_provider_ = nullptr;
365 client_ = nullptr; 333 client_ = nullptr;
366 weak_ptr_factory_.InvalidateWeakPtrs(); 334 weak_ptr_factory_.InvalidateWeakPtrs();
367 } 335 }
368 336
369 } // namespace cc 337 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/output_surface.h ('k') | cc/output/output_surface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698