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

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

Issue 2533163002: ozone: Create GbmBuffers from fourcc formats and gbm flags. (Closed)
Patch Set: Address dnicoara's comments. Created 4 years 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/screen_manager.h" 5 #include "ui/ozone/platform/drm/gpu/screen_manager.h"
6 6
7 #include <xf86drmMode.h> 7 #include <xf86drmMode.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 if (window) { 337 if (window) {
338 const OverlayPlane* primary = window->GetLastModesetBuffer(); 338 const OverlayPlane* primary = window->GetLastModesetBuffer();
339 const DrmDevice* drm = controller->GetAllocationDrmDevice().get(); 339 const DrmDevice* drm = controller->GetAllocationDrmDevice().get();
340 if (primary && primary->buffer->GetSize() == bounds.size() && 340 if (primary && primary->buffer->GetSize() == bounds.size() &&
341 primary->buffer->GetDrmDevice() == drm) 341 primary->buffer->GetDrmDevice() == drm)
342 return *primary; 342 return *primary;
343 } 343 }
344 344
345 gfx::BufferFormat format = ui::DisplaySnapshot::PrimaryFormat(); 345 gfx::BufferFormat format = ui::DisplaySnapshot::PrimaryFormat();
346 scoped_refptr<DrmDevice> drm = controller->GetAllocationDrmDevice(); 346 scoped_refptr<DrmDevice> drm = controller->GetAllocationDrmDevice();
347 uint32_t fourcc_format = ui::GetFourCCFormatForFramebuffer(format);
347 scoped_refptr<ScanoutBuffer> buffer = 348 scoped_refptr<ScanoutBuffer> buffer =
348 buffer_generator_->Create(drm, format, bounds.size()); 349 buffer_generator_->Create(drm, fourcc_format, bounds.size());
349 if (!buffer) { 350 if (!buffer) {
350 LOG(ERROR) << "Failed to create scanout buffer"; 351 LOG(ERROR) << "Failed to create scanout buffer";
351 return OverlayPlane(nullptr, 0, gfx::OVERLAY_TRANSFORM_INVALID, gfx::Rect(), 352 return OverlayPlane(nullptr, 0, gfx::OVERLAY_TRANSFORM_INVALID, gfx::Rect(),
352 gfx::RectF()); 353 gfx::RectF());
353 } 354 }
354 355
355 FillModesetBuffer(drm, controller, buffer.get()); 356 FillModesetBuffer(drm, controller, buffer.get());
356 return OverlayPlane(buffer); 357 return OverlayPlane(buffer);
357 } 358 }
358 359
(...skipping 28 matching lines...) Expand all
387 DrmWindow* ScreenManager::FindWindowAt(const gfx::Rect& bounds) const { 388 DrmWindow* ScreenManager::FindWindowAt(const gfx::Rect& bounds) const {
388 for (auto pair : window_map_) { 389 for (auto pair : window_map_) {
389 if (pair.second->bounds() == bounds) 390 if (pair.second->bounds() == bounds)
390 return pair.second; 391 return pair.second;
391 } 392 }
392 393
393 return nullptr; 394 return nullptr;
394 } 395 }
395 396
396 } // namespace ui 397 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698