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

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

Issue 1417423002: [Ozone-DRM] Fix double call of swap buffers callback on failure (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 5 years, 2 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 | ui/ozone/platform/drm/gpu/drm_window_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/drm_window.h" 5 #include "ui/ozone/platform/drm/gpu/drm_window.h"
6 6
7 #include <drm_fourcc.h> 7 #include <drm_fourcc.h>
8 8
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 return; 133 return;
134 } 134 }
135 135
136 last_submitted_planes_ = planes; 136 last_submitted_planes_ = planes;
137 137
138 if (!controller_) { 138 if (!controller_) {
139 callback.Run(gfx::SwapResult::SWAP_ACK); 139 callback.Run(gfx::SwapResult::SWAP_ACK);
140 return; 140 return;
141 } 141 }
142 142
143 if (!controller_->SchedulePageFlip(last_submitted_planes_, 143 // Controller should call the callback in all cases.
144 false /* test_only */, callback)) { 144 controller_->SchedulePageFlip(last_submitted_planes_, false /* test_only */,
145 callback.Run(gfx::SwapResult::SWAP_FAILED); 145 callback);
146 }
147 } 146 }
148 147
149 std::vector<OverlayCheck_Params> DrmWindow::TestPageFlip( 148 std::vector<OverlayCheck_Params> DrmWindow::TestPageFlip(
150 const std::vector<OverlayCheck_Params>& overlays, 149 const std::vector<OverlayCheck_Params>& overlays,
151 ScanoutBufferGenerator* buffer_generator) { 150 ScanoutBufferGenerator* buffer_generator) {
152 std::vector<OverlayCheck_Params> params; 151 std::vector<OverlayCheck_Params> params;
153 if (!controller_) { 152 if (!controller_) {
154 // Nothing much we can do here. 153 // Nothing much we can do here.
155 return params; 154 return params;
156 } 155 }
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 if (!cursor_buffers_[i]->Initialize( 306 if (!cursor_buffers_[i]->Initialize(
308 info, false /* should_register_framebuffer */)) { 307 info, false /* should_register_framebuffer */)) {
309 LOG(FATAL) << "Failed to initialize cursor buffer"; 308 LOG(FATAL) << "Failed to initialize cursor buffer";
310 return; 309 return;
311 } 310 }
312 } 311 }
313 } 312 }
314 } 313 }
315 314
316 } // namespace ui 315 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/ozone/platform/drm/gpu/drm_window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698