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

Side by Side Diff: ui/ozone/platform/drm/gpu/gbm_surfaceless.cc

Issue 2609733002: [reland] Use TaskScheduler instead of WorkerPool in gbm_surfaceless.cc. (Closed)
Patch Set: fix build error Created 3 years, 11 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ui/ozone/platform/drm/gpu/gbm_surfaceless.h" 5 #include "ui/ozone/platform/drm/gpu/gbm_surfaceless.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "base/threading/worker_pool.h" 12 #include "base/task_scheduler/post_task.h"
13 #include "base/trace_event/trace_event.h" 13 #include "base/trace_event/trace_event.h"
14 #include "ui/ozone/common/egl_util.h" 14 #include "ui/ozone/common/egl_util.h"
15 #include "ui/ozone/platform/drm/gpu/drm_vsync_provider.h" 15 #include "ui/ozone/platform/drm/gpu/drm_vsync_provider.h"
16 #include "ui/ozone/platform/drm/gpu/drm_window_proxy.h" 16 #include "ui/ozone/platform/drm/gpu/drm_window_proxy.h"
17 #include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h" 17 #include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h"
18 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h" 18 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h"
19 19
20 namespace ui { 20 namespace ui {
21 21
22 namespace { 22 namespace {
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 return; 124 return;
125 } 125 }
126 126
127 base::Closure fence_wait_task = 127 base::Closure fence_wait_task =
128 base::Bind(&WaitForFence, GetDisplay(), fence); 128 base::Bind(&WaitForFence, GetDisplay(), fence);
129 129
130 base::Closure fence_retired_callback = 130 base::Closure fence_retired_callback =
131 base::Bind(&GbmSurfaceless::FenceRetired, weak_factory_.GetWeakPtr(), 131 base::Bind(&GbmSurfaceless::FenceRetired, weak_factory_.GetWeakPtr(),
132 fence, frame); 132 fence, frame);
133 133
134 base::WorkerPool::PostTaskAndReply(FROM_HERE, fence_wait_task, 134 base::PostTaskWithTraitsAndReply(
135 fence_retired_callback, false); 135 FROM_HERE, base::TaskTraits()
136 .WithShutdownBehavior(
137 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)
138 .MayBlock(),
139 fence_wait_task, fence_retired_callback);
136 return; // Defer frame submission until fence signals. 140 return; // Defer frame submission until fence signals.
137 } 141 }
138 142
139 frame->ready = true; 143 frame->ready = true;
140 SubmitFrame(); 144 SubmitFrame();
141 } 145 }
142 146
143 void GbmSurfaceless::PostSubBufferAsync( 147 void GbmSurfaceless::PostSubBufferAsync(
144 int x, 148 int x,
145 int y, 149 int y,
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 } 245 }
242 246
243 SubmitFrame(); 247 SubmitFrame();
244 } 248 }
245 249
246 bool GbmSurfaceless::IsUniversalDisplayLinkDevice() { 250 bool GbmSurfaceless::IsUniversalDisplayLinkDevice() {
247 return planes_.empty() ? false : planes_[0].buffer->RequiresGlFinish(); 251 return planes_.empty() ? false : planes_[0].buffer->RequiresGlFinish();
248 } 252 }
249 253
250 } // namespace ui 254 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698