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

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

Issue 2948513003: Revert of ozone/drm: Only reuse ScanoutBuffers with compatible modifiers (Closed)
Patch Set: Created 3 years, 6 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 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/mock_scanout_buffer_generator.h" 5 #include "ui/ozone/platform/drm/gpu/mock_scanout_buffer_generator.h"
6 6
7 #include "ui/ozone/platform/drm/common/drm_util.h" 7 #include "ui/ozone/platform/drm/common/drm_util.h"
8 #include "ui/ozone/platform/drm/gpu/mock_scanout_buffer.h" 8 #include "ui/ozone/platform/drm/gpu/mock_scanout_buffer.h"
9 9
10 namespace ui { 10 namespace ui {
11 11
12 MockScanoutBufferGenerator::MockScanoutBufferGenerator() {} 12 MockScanoutBufferGenerator::MockScanoutBufferGenerator() {}
13 13
14 MockScanoutBufferGenerator::~MockScanoutBufferGenerator() {} 14 MockScanoutBufferGenerator::~MockScanoutBufferGenerator() {}
15 15
16 scoped_refptr<ScanoutBuffer> MockScanoutBufferGenerator::Create( 16 scoped_refptr<ScanoutBuffer> MockScanoutBufferGenerator::Create(
17 const scoped_refptr<DrmDevice>& drm, 17 const scoped_refptr<DrmDevice>& drm,
18 uint32_t format, 18 uint32_t format,
19 const gfx::Size& size) { 19 const gfx::Size& size) {
20 return CreateWithModifier(drm, format, DRM_FORMAT_MOD_NONE, size);
21 }
22
23 scoped_refptr<ScanoutBuffer> MockScanoutBufferGenerator::CreateWithModifier(
24 const scoped_refptr<DrmDevice>& drm,
25 uint32_t format,
26 uint64_t modifier,
27 const gfx::Size& size) {
28 if (allocation_failure_) 20 if (allocation_failure_)
29 return nullptr; 21 return nullptr;
30 22
31 scoped_refptr<MockScanoutBuffer> buffer( 23 scoped_refptr<MockScanoutBuffer> buffer(new MockScanoutBuffer(size, format));
32 new MockScanoutBuffer(size, format, modifier, drm));
33 24
34 return buffer; 25 return buffer;
35 } 26 }
36 27
37 } // namespace ui 28 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/mock_scanout_buffer_generator.h ('k') | ui/ozone/platform/drm/gpu/scanout_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698