| 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_DRI_TEST_MOCK_DRI_WRAPPER_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRI_TEST_MOCK_DRI_WRAPPER_H_ |
| 6 #define UI_OZONE_PLATFORM_DRI_TEST_MOCK_DRI_WRAPPER_H_ | 6 #define UI_OZONE_PLATFORM_DRI_TEST_MOCK_DRI_WRAPPER_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "skia/ext/refptr.h" | 11 #include "skia/ext/refptr.h" |
| 12 #include "third_party/skia/include/core/SkSurface.h" | 12 #include "third_party/skia/include/core/SkSurface.h" |
| 13 #include "ui/ozone/platform/dri/dri_wrapper.h" | 13 #include "ui/ozone/platform/dri/dri_wrapper.h" |
| 14 | 14 |
| 15 namespace ui { | 15 namespace ui { |
| 16 | 16 |
| 17 class CrtcController; | 17 class CrtcController; |
| 18 | 18 |
| 19 // The real DriWrapper makes actual DRM calls which we can't use in unit tests. | 19 // The real DriWrapper makes actual DRM calls which we can't use in unit tests. |
| 20 class MockDriWrapper : public ui::DriWrapper { | 20 class MockDriWrapper : public ui::DriWrapper { |
| 21 public: | 21 public: |
| 22 MockDriWrapper(int fd); | 22 MockDriWrapper(int fd); |
| 23 MockDriWrapper(int fd, | 23 MockDriWrapper(int fd, |
| 24 bool software_mode, | 24 bool use_sync_flips, |
| 25 std::vector<uint32_t> crtcs, | 25 std::vector<uint32_t> crtcs, |
| 26 size_t planes_per_crtc); | 26 size_t planes_per_crtc); |
| 27 ~MockDriWrapper() override; | 27 ~MockDriWrapper() override; |
| 28 | 28 |
| 29 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_; } |
| 30 int get_set_crtc_call_count() const { return set_crtc_call_count_; } | 30 int get_set_crtc_call_count() const { return set_crtc_call_count_; } |
| 31 int get_restore_crtc_call_count() const { return restore_crtc_call_count_; } | 31 int get_restore_crtc_call_count() const { return restore_crtc_call_count_; } |
| 32 int get_add_framebuffer_call_count() const { | 32 int get_add_framebuffer_call_count() const { |
| 33 return add_framebuffer_call_count_; | 33 return add_framebuffer_call_count_; |
| 34 } | 34 } |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 std::vector<skia::RefPtr<SkSurface> > buffers_; | 121 std::vector<skia::RefPtr<SkSurface> > buffers_; |
| 122 | 122 |
| 123 std::queue<PageFlipCallback> callbacks_; | 123 std::queue<PageFlipCallback> callbacks_; |
| 124 | 124 |
| 125 DISALLOW_COPY_AND_ASSIGN(MockDriWrapper); | 125 DISALLOW_COPY_AND_ASSIGN(MockDriWrapper); |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 } // namespace ui | 128 } // namespace ui |
| 129 | 129 |
| 130 #endif // UI_OZONE_PLATFORM_DRI_TEST_MOCK_DRI_WRAPPER_H_ | 130 #endif // UI_OZONE_PLATFORM_DRI_TEST_MOCK_DRI_WRAPPER_H_ |
| OLD | NEW |