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 #include <drm_fourcc.h> |
| 6 |
5 #include "base/bind.h" | 7 #include "base/bind.h" |
6 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
7 #include "third_party/skia/include/core/SkCanvas.h" | 9 #include "third_party/skia/include/core/SkCanvas.h" |
8 #include "ui/ozone/platform/drm/gpu/crtc_controller.h" | 10 #include "ui/ozone/platform/drm/gpu/crtc_controller.h" |
9 #include "ui/ozone/platform/drm/gpu/drm_buffer.h" | 11 #include "ui/ozone/platform/drm/gpu/drm_buffer.h" |
10 #include "ui/ozone/platform/drm/gpu/drm_device.h" | 12 #include "ui/ozone/platform/drm/gpu/drm_device.h" |
11 #include "ui/ozone/platform/drm/gpu/hardware_display_controller.h" | 13 #include "ui/ozone/platform/drm/gpu/hardware_display_controller.h" |
12 #include "ui/ozone/platform/drm/test/mock_drm_device.h" | 14 #include "ui/ozone/platform/drm/test/mock_drm_device.h" |
13 #include "ui/ozone/public/native_pixmap.h" | 15 #include "ui/ozone/public/native_pixmap.h" |
14 | 16 |
(...skipping 13 matching lines...) Expand all Loading... |
28 const gfx::SizeF kDefaultModeSizeF(1.0, 1.0); | 30 const gfx::SizeF kDefaultModeSizeF(1.0, 1.0); |
29 | 31 |
30 class MockScanoutBuffer : public ui::ScanoutBuffer { | 32 class MockScanoutBuffer : public ui::ScanoutBuffer { |
31 public: | 33 public: |
32 MockScanoutBuffer(const gfx::Size& size) : size_(size) {} | 34 MockScanoutBuffer(const gfx::Size& size) : size_(size) {} |
33 | 35 |
34 // ScanoutBuffer: | 36 // ScanoutBuffer: |
35 uint32_t GetFramebufferId() const override { return 0; } | 37 uint32_t GetFramebufferId() const override { return 0; } |
36 uint32_t GetHandle() const override { return 0; } | 38 uint32_t GetHandle() const override { return 0; } |
37 gfx::Size GetSize() const override { return size_; } | 39 gfx::Size GetSize() const override { return size_; } |
38 uint32_t GetFormat() const override { return 0; } | 40 uint32_t GetFramebufferPixelFormat() const override { |
| 41 return DRM_FORMAT_XRGB8888; |
| 42 } |
39 | 43 |
40 private: | 44 private: |
41 ~MockScanoutBuffer() override {} | 45 ~MockScanoutBuffer() override {} |
42 | 46 |
43 gfx::Size size_; | 47 gfx::Size size_; |
44 | 48 |
45 DISALLOW_COPY_AND_ASSIGN(MockScanoutBuffer); | 49 DISALLOW_COPY_AND_ASSIGN(MockScanoutBuffer); |
46 }; | 50 }; |
47 | 51 |
48 } // namespace | 52 } // namespace |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 planes, false, false, | 409 planes, false, false, |
406 base::Bind(&HardwareDisplayControllerTest::PageFlipCallback, | 410 base::Bind(&HardwareDisplayControllerTest::PageFlipCallback, |
407 base::Unretained(this)))); | 411 base::Unretained(this)))); |
408 | 412 |
409 controller_->RemoveCrtc(drm_, kPrimaryCrtc); | 413 controller_->RemoveCrtc(drm_, kPrimaryCrtc); |
410 | 414 |
411 EXPECT_EQ(1, page_flips_); | 415 EXPECT_EQ(1, page_flips_); |
412 drm_->RunCallbacks(); | 416 drm_->RunCallbacks(); |
413 EXPECT_EQ(1, page_flips_); | 417 EXPECT_EQ(1, page_flips_); |
414 } | 418 } |
OLD | NEW |