| OLD | NEW |
| 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" | |
| 7 | 6 |
| 8 namespace ui { | 7 namespace ui { |
| 9 | 8 |
| 10 namespace { | 9 MockScanoutBuffer::MockScanoutBuffer(const gfx::Size& size, uint32_t format) |
| 11 | 10 : size_(size), format_(format) {} |
| 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) {} | |
| 25 | 11 |
| 26 MockScanoutBuffer::~MockScanoutBuffer() {} | 12 MockScanoutBuffer::~MockScanoutBuffer() {} |
| 27 | 13 |
| 28 uint32_t MockScanoutBuffer::GetFramebufferId() const { | 14 uint32_t MockScanoutBuffer::GetFramebufferId() const { |
| 29 return id_; | 15 return 1; |
| 30 } | 16 } |
| 31 | 17 |
| 32 uint32_t MockScanoutBuffer::GetOpaqueFramebufferId() const { | 18 uint32_t MockScanoutBuffer::GetOpaqueFramebufferId() const { |
| 33 return 2; | 19 return 2; |
| 34 } | 20 } |
| 35 | 21 |
| 36 uint32_t MockScanoutBuffer::GetHandle() const { | 22 uint32_t MockScanoutBuffer::GetHandle() const { |
| 37 return 0; | 23 return 0; |
| 38 } | 24 } |
| 39 | 25 |
| 40 gfx::Size MockScanoutBuffer::GetSize() const { | 26 gfx::Size MockScanoutBuffer::GetSize() const { |
| 41 return size_; | 27 return size_; |
| 42 } | 28 } |
| 43 | 29 |
| 44 uint32_t MockScanoutBuffer::GetFramebufferPixelFormat() const { | 30 uint32_t MockScanoutBuffer::GetFramebufferPixelFormat() const { |
| 45 return format_; | 31 return format_; |
| 46 } | 32 } |
| 47 | 33 |
| 48 uint32_t MockScanoutBuffer::GetOpaqueFramebufferPixelFormat() const { | 34 uint32_t MockScanoutBuffer::GetOpaqueFramebufferPixelFormat() const { |
| 49 return format_; | 35 return format_; |
| 50 } | 36 } |
| 51 | 37 |
| 52 uint64_t MockScanoutBuffer::GetFormatModifier() const { | |
| 53 return modifier_; | |
| 54 } | |
| 55 | |
| 56 const DrmDevice* MockScanoutBuffer::GetDrmDevice() const { | 38 const DrmDevice* MockScanoutBuffer::GetDrmDevice() const { |
| 57 return drm_.get(); | 39 return nullptr; |
| 58 } | 40 } |
| 59 | 41 |
| 60 bool MockScanoutBuffer::RequiresGlFinish() const { | 42 bool MockScanoutBuffer::RequiresGlFinish() const { |
| 61 return false; | 43 return false; |
| 62 } | 44 } |
| 63 | 45 |
| 64 } // namespace ui | 46 } // namespace ui |
| OLD | NEW |