| OLD | NEW |
| 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 #ifndef UI_OZONE_PLATFORM_DRM_TEST_MOCK_DRM_DEVICE_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_TEST_MOCK_DRM_DEVICE_H_ |
| 6 #define UI_OZONE_PLATFORM_DRM_TEST_MOCK_DRM_DEVICE_H_ | 6 #define UI_OZONE_PLATFORM_DRM_TEST_MOCK_DRM_DEVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "skia/ext/refptr.h" | 12 #include "skia/ext/refptr.h" |
| 13 #include "third_party/skia/include/core/SkSurface.h" | 13 #include "third_party/skia/include/core/SkSurface.h" |
| 14 #include "ui/ozone/platform/drm/gpu/drm_device.h" | 14 #include "ui/ozone/platform/drm/gpu/drm_device.h" |
| 15 | 15 |
| 16 namespace ui { | 16 namespace ui { |
| 17 | 17 |
| 18 class CrtcController; | 18 class CrtcController; |
| 19 struct GammaRampRGBEntry; |
| 19 | 20 |
| 20 // The real DrmDevice makes actual DRM calls which we can't use in unit tests. | 21 // The real DrmDevice makes actual DRM calls which we can't use in unit tests. |
| 21 class MockDrmDevice : public ui::DrmDevice { | 22 class MockDrmDevice : public ui::DrmDevice { |
| 22 public: | 23 public: |
| 23 MockDrmDevice(); | 24 MockDrmDevice(); |
| 24 MockDrmDevice(bool use_sync_flips, | 25 MockDrmDevice(bool use_sync_flips, |
| 25 std::vector<uint32_t> crtcs, | 26 std::vector<uint32_t> crtcs, |
| 26 size_t planes_per_crtc); | 27 size_t planes_per_crtc); |
| 27 | 28 |
| 28 int get_get_crtc_call_count() const { return get_crtc_call_count_; } | 29 int get_get_crtc_call_count() const { return get_crtc_call_count_; } |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 uint32_t* handle, | 103 uint32_t* handle, |
| 103 uint32_t* stride, | 104 uint32_t* stride, |
| 104 void** pixels) override; | 105 void** pixels) override; |
| 105 void DestroyDumbBuffer(const SkImageInfo& info, | 106 void DestroyDumbBuffer(const SkImageInfo& info, |
| 106 uint32_t handle, | 107 uint32_t handle, |
| 107 uint32_t stride, | 108 uint32_t stride, |
| 108 void* pixels) override; | 109 void* pixels) override; |
| 109 bool CommitProperties(drmModePropertySet* properties, | 110 bool CommitProperties(drmModePropertySet* properties, |
| 110 uint32_t flags, | 111 uint32_t flags, |
| 111 const PageFlipCallback& callback) override; | 112 const PageFlipCallback& callback) override; |
| 113 bool SetGammaRamp(uint32_t crtc_id, |
| 114 const std::vector<GammaRampRGBEntry>& lut) override; |
| 112 | 115 |
| 113 private: | 116 private: |
| 114 ~MockDrmDevice() override; | 117 ~MockDrmDevice() override; |
| 115 | 118 |
| 116 int get_crtc_call_count_; | 119 int get_crtc_call_count_; |
| 117 int set_crtc_call_count_; | 120 int set_crtc_call_count_; |
| 118 int restore_crtc_call_count_; | 121 int restore_crtc_call_count_; |
| 119 int add_framebuffer_call_count_; | 122 int add_framebuffer_call_count_; |
| 120 int remove_framebuffer_call_count_; | 123 int remove_framebuffer_call_count_; |
| 121 int page_flip_call_count_; | 124 int page_flip_call_count_; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 137 std::map<uint32_t, uint32_t> crtc_cursor_map_; | 140 std::map<uint32_t, uint32_t> crtc_cursor_map_; |
| 138 | 141 |
| 139 std::queue<PageFlipCallback> callbacks_; | 142 std::queue<PageFlipCallback> callbacks_; |
| 140 | 143 |
| 141 DISALLOW_COPY_AND_ASSIGN(MockDrmDevice); | 144 DISALLOW_COPY_AND_ASSIGN(MockDrmDevice); |
| 142 }; | 145 }; |
| 143 | 146 |
| 144 } // namespace ui | 147 } // namespace ui |
| 145 | 148 |
| 146 #endif // UI_OZONE_PLATFORM_DRM_TEST_MOCK_DRM_DEVICE_H_ | 149 #endif // UI_OZONE_PLATFORM_DRM_TEST_MOCK_DRM_DEVICE_H_ |
| OLD | NEW |