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

Side by Side Diff: ui/ozone/platform/drm/gpu/drm_overlay_validator.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_overlay_validator.h" 5 #include "ui/ozone/platform/drm/gpu/drm_overlay_validator.h"
6 6
7 #include <drm_fourcc.h> 7 #include <drm_fourcc.h>
8 8
9 #include "ui/gfx/geometry/size_conversions.h" 9 #include "ui/gfx/geometry/size_conversions.h"
10 #include "ui/ozone/platform/drm/common/drm_util.h" 10 #include "ui/ozone/platform/drm/common/drm_util.h"
(...skipping 25 matching lines...) Expand all
36 ScanoutBufferGenerator* buffer_generator, 36 ScanoutBufferGenerator* buffer_generator,
37 std::vector<scoped_refptr<ScanoutBuffer>>* reusable_buffers) { 37 std::vector<scoped_refptr<ScanoutBuffer>>* reusable_buffers) {
38 // Check if we can re-use existing buffers. 38 // Check if we can re-use existing buffers.
39 for (const auto& buffer : *reusable_buffers) { 39 for (const auto& buffer : *reusable_buffers) {
40 if (buffer->GetFramebufferPixelFormat() == format && 40 if (buffer->GetFramebufferPixelFormat() == format &&
41 buffer->GetSize() == size) { 41 buffer->GetSize() == size) {
42 return buffer; 42 return buffer;
43 } 43 }
44 } 44 }
45 45
46 gfx::BufferFormat buffer_format = GetBufferFormatFromFourCCFormat(format);
47 scoped_refptr<ScanoutBuffer> scanout_buffer = 46 scoped_refptr<ScanoutBuffer> scanout_buffer =
48 buffer_generator->Create(drm_device, buffer_format, size); 47 buffer_generator->Create(drm_device, format, size);
49 reusable_buffers->push_back(scanout_buffer); 48 reusable_buffers->push_back(scanout_buffer);
50 49
51 return scanout_buffer; 50 return scanout_buffer;
52 } 51 }
53 52
54 gfx::Size GetScaledSize(const gfx::Size original_size, 53 gfx::Size GetScaledSize(const gfx::Size original_size,
55 const gfx::Rect display_rect, 54 const gfx::Rect display_rect,
56 const gfx::RectF crop_rect) { 55 const gfx::RectF crop_rect) {
57 if (!crop_rect.IsEmpty()) { 56 if (!crop_rect.IsEmpty()) {
58 return gfx::ToCeiledSize( 57 return gfx::ToCeiledSize(
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 272
274 // Make sure we dont hold reference to buffer when caching this plane list. 273 // Make sure we dont hold reference to buffer when caching this plane list.
275 plane.buffer = nullptr; 274 plane.buffer = nullptr;
276 } 275 }
277 276
278 DCHECK(hints_plane_list.size() == overlay_hints.size()); 277 DCHECK(hints_plane_list.size() == overlay_hints.size());
279 overlay_hints_cache_.Put(hints_plane_list, overlay_hints); 278 overlay_hints_cache_.Put(hints_plane_list, overlay_hints);
280 } 279 }
281 280
282 } // namespace ui 281 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/ozone/platform/drm/gpu/drm_overlay_validator_unittest.cc » ('j') | ui/ozone/platform/drm/gpu/drm_thread.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698