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_GPU_MOCK_DRM_DEVICE_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_MOCK_DRM_DEVICE_H_ |
6 #define UI_OZONE_PLATFORM_DRM_GPU_MOCK_DRM_DEVICE_H_ | 6 #define UI_OZONE_PLATFORM_DRM_GPU_MOCK_DRM_DEVICE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 void set_page_flip_expectation(bool state) { page_flip_expectation_ = state; } | 43 void set_page_flip_expectation(bool state) { page_flip_expectation_ = state; } |
44 void set_add_framebuffer_expectation(bool state) { | 44 void set_add_framebuffer_expectation(bool state) { |
45 add_framebuffer_expectation_ = state; | 45 add_framebuffer_expectation_ = state; |
46 } | 46 } |
47 void set_create_dumb_buffer_expectation(bool state) { | 47 void set_create_dumb_buffer_expectation(bool state) { |
48 create_dumb_buffer_expectation_ = state; | 48 create_dumb_buffer_expectation_ = state; |
49 } | 49 } |
50 | 50 |
51 uint32_t current_framebuffer() const { return current_framebuffer_; } | 51 uint32_t current_framebuffer() const { return current_framebuffer_; } |
52 | 52 |
53 const std::vector<skia::RefPtr<SkSurface>> buffers() const { | 53 const std::vector<sk_sp<SkSurface>> buffers() const { return buffers_; } |
54 return buffers_; | |
55 } | |
56 | 54 |
57 uint32_t get_cursor_handle_for_crtc(uint32_t crtc) const { | 55 uint32_t get_cursor_handle_for_crtc(uint32_t crtc) const { |
58 const auto it = crtc_cursor_map_.find(crtc); | 56 const auto it = crtc_cursor_map_.find(crtc); |
59 return it != crtc_cursor_map_.end() ? it->second : 0; | 57 return it != crtc_cursor_map_.end() ? it->second : 0; |
60 } | 58 } |
61 | 59 |
62 void RunCallbacks(); | 60 void RunCallbacks(); |
63 | 61 |
64 // DrmDevice: | 62 // DrmDevice: |
65 ScopedDrmCrtcPtr GetCrtc(uint32_t crtc_id) override; | 63 ScopedDrmCrtcPtr GetCrtc(uint32_t crtc_id) override; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 132 |
135 bool set_crtc_expectation_; | 133 bool set_crtc_expectation_; |
136 bool add_framebuffer_expectation_; | 134 bool add_framebuffer_expectation_; |
137 bool page_flip_expectation_; | 135 bool page_flip_expectation_; |
138 bool create_dumb_buffer_expectation_; | 136 bool create_dumb_buffer_expectation_; |
139 | 137 |
140 bool use_sync_flips_; | 138 bool use_sync_flips_; |
141 | 139 |
142 uint32_t current_framebuffer_; | 140 uint32_t current_framebuffer_; |
143 | 141 |
144 std::vector<skia::RefPtr<SkSurface>> buffers_; | 142 std::vector<sk_sp<SkSurface>> buffers_; |
145 | 143 |
146 std::map<uint32_t, uint32_t> crtc_cursor_map_; | 144 std::map<uint32_t, uint32_t> crtc_cursor_map_; |
147 | 145 |
148 std::queue<PageFlipCallback> callbacks_; | 146 std::queue<PageFlipCallback> callbacks_; |
149 | 147 |
150 DISALLOW_COPY_AND_ASSIGN(MockDrmDevice); | 148 DISALLOW_COPY_AND_ASSIGN(MockDrmDevice); |
151 }; | 149 }; |
152 | 150 |
153 } // namespace ui | 151 } // namespace ui |
154 | 152 |
155 #endif // UI_OZONE_PLATFORM_DRM_GPU_MOCK_DRM_DEVICE_H_ | 153 #endif // UI_OZONE_PLATFORM_DRM_GPU_MOCK_DRM_DEVICE_H_ |
OLD | NEW |