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

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

Issue 2951193002: 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.h" 5 #include "ui/ozone/platform/drm/gpu/mock_scanout_buffer.h"
6 #include "ui/ozone/platform/drm/gpu/mock_drm_device.h"
6 7
7 namespace ui { 8 namespace ui {
8 9
9 MockScanoutBuffer::MockScanoutBuffer(const gfx::Size& size, uint32_t format) 10 namespace {
10 : size_(size), format_(format) {} 11
12 uint32_t g_current_framebuffer_id = 1;
13
14 } // namespace
15
16 MockScanoutBuffer::MockScanoutBuffer(const gfx::Size& size,
17 uint32_t format,
18 uint64_t modifier,
19 const scoped_refptr<DrmDevice>& drm)
20 : size_(size),
21 format_(format),
22 modifier_(modifier),
23 id_(g_current_framebuffer_id++),
24 drm_(drm) {}
11 25
12 MockScanoutBuffer::~MockScanoutBuffer() {} 26 MockScanoutBuffer::~MockScanoutBuffer() {}
13 27
14 uint32_t MockScanoutBuffer::GetFramebufferId() const { 28 uint32_t MockScanoutBuffer::GetFramebufferId() const {
15 return 1; 29 return id_;
16 } 30 }
17 31
18 uint32_t MockScanoutBuffer::GetOpaqueFramebufferId() const { 32 uint32_t MockScanoutBuffer::GetOpaqueFramebufferId() const {
19 return 2; 33 return 2;
20 } 34 }
21 35
22 uint32_t MockScanoutBuffer::GetHandle() const { 36 uint32_t MockScanoutBuffer::GetHandle() const {
23 return 0; 37 return 0;
24 } 38 }
25 39
26 gfx::Size MockScanoutBuffer::GetSize() const { 40 gfx::Size MockScanoutBuffer::GetSize() const {
27 return size_; 41 return size_;
28 } 42 }
29 43
30 uint32_t MockScanoutBuffer::GetFramebufferPixelFormat() const { 44 uint32_t MockScanoutBuffer::GetFramebufferPixelFormat() const {
31 return format_; 45 return format_;
32 } 46 }
33 47
34 uint32_t MockScanoutBuffer::GetOpaqueFramebufferPixelFormat() const { 48 uint32_t MockScanoutBuffer::GetOpaqueFramebufferPixelFormat() const {
35 return format_; 49 return format_;
36 } 50 }
37 51
52 uint64_t MockScanoutBuffer::GetFormatModifier() const {
53 return modifier_;
54 }
55
38 const DrmDevice* MockScanoutBuffer::GetDrmDevice() const { 56 const DrmDevice* MockScanoutBuffer::GetDrmDevice() const {
39 return nullptr; 57 return drm_.get();
40 } 58 }
41 59
42 bool MockScanoutBuffer::RequiresGlFinish() const { 60 bool MockScanoutBuffer::RequiresGlFinish() const {
43 return false; 61 return false;
44 } 62 }
45 63
46 } // namespace ui 64 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/mock_scanout_buffer.h ('k') | ui/ozone/platform/drm/gpu/mock_scanout_buffer_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698