| OLD | NEW |
| 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" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 121 } |
| 122 | 122 |
| 123 base::Closure fence_wait_task = | 123 base::Closure fence_wait_task = |
| 124 base::Bind(&WaitForFence, GetDisplay(), fence); | 124 base::Bind(&WaitForFence, GetDisplay(), fence); |
| 125 | 125 |
| 126 base::Closure fence_retired_callback = base::Bind( | 126 base::Closure fence_retired_callback = base::Bind( |
| 127 &GbmSurfaceless::FenceRetired, weak_factory_.GetWeakPtr(), fence, frame); | 127 &GbmSurfaceless::FenceRetired, weak_factory_.GetWeakPtr(), fence, frame); |
| 128 | 128 |
| 129 base::PostTaskWithTraitsAndReply( | 129 base::PostTaskWithTraitsAndReply( |
| 130 FROM_HERE, | 130 FROM_HERE, |
| 131 base::TaskTraits() | 131 {base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, |
| 132 .WithShutdownBehavior( | |
| 133 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN) | |
| 134 .MayBlock(), | |
| 135 fence_wait_task, fence_retired_callback); | 132 fence_wait_task, fence_retired_callback); |
| 136 } | 133 } |
| 137 | 134 |
| 138 void GbmSurfaceless::PostSubBufferAsync( | 135 void GbmSurfaceless::PostSubBufferAsync( |
| 139 int x, | 136 int x, |
| 140 int y, | 137 int y, |
| 141 int width, | 138 int width, |
| 142 int height, | 139 int height, |
| 143 const SwapCompletionCallback& callback) { | 140 const SwapCompletionCallback& callback) { |
| 144 // The actual sub buffer handling is handled at higher layers. | 141 // The actual sub buffer handling is handled at higher layers. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 swap_buffers_pending_ = false; | 226 swap_buffers_pending_ = false; |
| 230 if (result == gfx::SwapResult::SWAP_FAILED) { | 227 if (result == gfx::SwapResult::SWAP_FAILED) { |
| 231 last_swap_buffers_result_ = false; | 228 last_swap_buffers_result_ = false; |
| 232 return; | 229 return; |
| 233 } | 230 } |
| 234 | 231 |
| 235 SubmitFrame(); | 232 SubmitFrame(); |
| 236 } | 233 } |
| 237 | 234 |
| 238 } // namespace ui | 235 } // namespace ui |
| OLD | NEW |