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

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

Issue 1426993003: Ozone: Dont hardcode format to YUV when using Overlay Composition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review fixes Created 4 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
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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 DrmDeviceManager* device_manager, 54 DrmDeviceManager* device_manager,
55 ScreenManager* screen_manager) 55 ScreenManager* screen_manager)
56 : widget_(widget), 56 : widget_(widget),
57 device_manager_(device_manager), 57 device_manager_(device_manager),
58 screen_manager_(screen_manager) { 58 screen_manager_(screen_manager) {
59 } 59 }
60 60
61 DrmWindow::~DrmWindow() { 61 DrmWindow::~DrmWindow() {
62 } 62 }
63 63
64 void DrmWindow::Initialize() { 64 void DrmWindow::Initialize(ScanoutBufferGenerator* buffer_generator) {
65 TRACE_EVENT1("drm", "DrmWindow::Initialize", "widget", widget_); 65 TRACE_EVENT1("drm", "DrmWindow::Initialize", "widget", widget_);
66 66
67 device_manager_->UpdateDrmDevice(widget_, nullptr); 67 device_manager_->UpdateDrmDevice(widget_, nullptr);
68 overlay_validator_ = make_scoped_ptr(new DrmOverlayValidator(this)); 68 overlay_validator_ =
69 make_scoped_ptr(new DrmOverlayValidator(this, buffer_generator));
69 } 70 }
70 71
71 void DrmWindow::Shutdown() { 72 void DrmWindow::Shutdown() {
72 TRACE_EVENT1("drm", "DrmWindow::Shutdown", "widget", widget_); 73 TRACE_EVENT1("drm", "DrmWindow::Shutdown", "widget", widget_);
73 device_manager_->RemoveDrmDevice(widget_); 74 device_manager_->RemoveDrmDevice(widget_);
74 } 75 }
75 76
76 gfx::AcceleratedWidget DrmWindow::GetAcceleratedWidget() { 77 gfx::AcceleratedWidget DrmWindow::GetAcceleratedWidget() {
77 return widget_; 78 return widget_;
78 } 79 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 } 128 }
128 129
129 void DrmWindow::SchedulePageFlip(const std::vector<OverlayPlane>& planes, 130 void DrmWindow::SchedulePageFlip(const std::vector<OverlayPlane>& planes,
130 const SwapCompletionCallback& callback) { 131 const SwapCompletionCallback& callback) {
131 if (force_buffer_reallocation_) { 132 if (force_buffer_reallocation_) {
132 force_buffer_reallocation_ = false; 133 force_buffer_reallocation_ = false;
133 callback.Run(gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS); 134 callback.Run(gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS);
134 return; 135 return;
135 } 136 }
136 137
137 last_submitted_planes_ = planes; 138 last_submitted_planes_ =
139 overlay_validator_->PrepareBuffersForPageFlip(planes);
138 140
139 if (!controller_) { 141 if (!controller_) {
140 callback.Run(gfx::SwapResult::SWAP_ACK); 142 callback.Run(gfx::SwapResult::SWAP_ACK);
141 return; 143 return;
142 } 144 }
143 145
144 controller_->SchedulePageFlip(last_submitted_planes_, callback); 146 controller_->SchedulePageFlip(last_submitted_planes_, callback);
145 } 147 }
146 148
147 std::vector<OverlayCheck_Params> DrmWindow::TestPageFlip( 149 std::vector<OverlayCheck_Params> DrmWindow::TestPageFlip(
148 const std::vector<OverlayCheck_Params>& overlay_params, 150 const std::vector<OverlayCheck_Params>& overlay_params) {
149 ScanoutBufferGenerator* buffer_generator) { 151 return overlay_validator_->TestPageFlip(overlay_params,
150 return overlay_validator_->TestPageFlip( 152 last_submitted_planes_);
151 overlay_params, last_submitted_planes_, buffer_generator);
152 } 153 }
153 154
154 const OverlayPlane* DrmWindow::GetLastModesetBuffer() { 155 const OverlayPlane* DrmWindow::GetLastModesetBuffer() {
155 return OverlayPlane::GetPrimaryPlane(last_submitted_planes_); 156 return OverlayPlane::GetPrimaryPlane(last_submitted_planes_);
156 } 157 }
157 158
158 void DrmWindow::GetVSyncParameters( 159 void DrmWindow::GetVSyncParameters(
159 const gfx::VSyncProvider::UpdateVSyncCallback& callback) const { 160 const gfx::VSyncProvider::UpdateVSyncCallback& callback) const {
160 if (!controller_) 161 if (!controller_)
161 return; 162 return;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 if (!cursor_buffers_[i]->Initialize( 248 if (!cursor_buffers_[i]->Initialize(
248 info, false /* should_register_framebuffer */)) { 249 info, false /* should_register_framebuffer */)) {
249 LOG(FATAL) << "Failed to initialize cursor buffer"; 250 LOG(FATAL) << "Failed to initialize cursor buffer";
250 return; 251 return;
251 } 252 }
252 } 253 }
253 } 254 }
254 } 255 }
255 256
256 } // namespace ui 257 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_window.h ('k') | ui/ozone/platform/drm/gpu/drm_window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698