| 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 "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
| 7 #include "third_party/skia/include/core/SkCanvas.h" | 7 #include "third_party/skia/include/core/SkCanvas.h" |
| 8 #include "third_party/skia/include/core/SkColor.h" | 8 #include "third_party/skia/include/core/SkColor.h" |
| 9 #include "third_party/skia/include/core/SkDevice.h" | 9 #include "third_party/skia/include/core/SkDevice.h" |
| 10 #include "ui/ozone/platform/dri/crtc_controller.h" | 10 #include "ui/ozone/platform/dri/crtc_controller.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 new ui::CrtcController(drm, kDefaultCrtc, kDefaultConnector)))); | 30 new ui::CrtcController(drm, kDefaultCrtc, kDefaultConnector)))); |
| 31 scoped_refptr<ui::DriBuffer> buffer(new ui::DriBuffer(drm)); | 31 scoped_refptr<ui::DriBuffer> buffer(new ui::DriBuffer(drm)); |
| 32 SkImageInfo info = SkImageInfo::MakeN32Premul(kDefaultMode.hdisplay, | 32 SkImageInfo info = SkImageInfo::MakeN32Premul(kDefaultMode.hdisplay, |
| 33 kDefaultMode.vdisplay); | 33 kDefaultMode.vdisplay); |
| 34 EXPECT_TRUE(buffer->Initialize(info)); | 34 EXPECT_TRUE(buffer->Initialize(info)); |
| 35 EXPECT_TRUE(controller_->Modeset(ui::OverlayPlane(buffer), kDefaultMode)); | 35 EXPECT_TRUE(controller_->Modeset(ui::OverlayPlane(buffer), kDefaultMode)); |
| 36 } | 36 } |
| 37 virtual ~MockDriWindowDelegate() {} | 37 virtual ~MockDriWindowDelegate() {} |
| 38 | 38 |
| 39 // DriWindowDelegate: | 39 // DriWindowDelegate: |
| 40 virtual void Initialize() OVERRIDE {} | 40 virtual void Initialize() override {} |
| 41 virtual void Shutdown() OVERRIDE {} | 41 virtual void Shutdown() override {} |
| 42 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE { return 1; } | 42 virtual gfx::AcceleratedWidget GetAcceleratedWidget() override { return 1; } |
| 43 virtual ui::HardwareDisplayController* GetController() OVERRIDE { | 43 virtual ui::HardwareDisplayController* GetController() override { |
| 44 return controller_.get(); | 44 return controller_.get(); |
| 45 } | 45 } |
| 46 virtual void OnBoundsChanged(const gfx::Rect& bounds) OVERRIDE {} | 46 virtual void OnBoundsChanged(const gfx::Rect& bounds) override {} |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 scoped_ptr<ui::HardwareDisplayController> controller_; | 49 scoped_ptr<ui::HardwareDisplayController> controller_; |
| 50 | 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(MockDriWindowDelegate); | 51 DISALLOW_COPY_AND_ASSIGN(MockDriWindowDelegate); |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 } // namespace | 54 } // namespace |
| 55 | 55 |
| 56 class DriSurfaceTest : public testing::Test { | 56 class DriSurfaceTest : public testing::Test { |
| 57 public: | 57 public: |
| 58 DriSurfaceTest() {} | 58 DriSurfaceTest() {} |
| 59 | 59 |
| 60 virtual void SetUp() OVERRIDE; | 60 virtual void SetUp() override; |
| 61 virtual void TearDown() OVERRIDE; | 61 virtual void TearDown() override; |
| 62 | 62 |
| 63 protected: | 63 protected: |
| 64 scoped_ptr<base::MessageLoop> message_loop_; | 64 scoped_ptr<base::MessageLoop> message_loop_; |
| 65 scoped_ptr<ui::MockDriWrapper> drm_; | 65 scoped_ptr<ui::MockDriWrapper> drm_; |
| 66 scoped_ptr<MockDriWindowDelegate> window_delegate_; | 66 scoped_ptr<MockDriWindowDelegate> window_delegate_; |
| 67 scoped_ptr<ui::DriSurface> surface_; | 67 scoped_ptr<ui::DriSurface> surface_; |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 DISALLOW_COPY_AND_ASSIGN(DriSurfaceTest); | 70 DISALLOW_COPY_AND_ASSIGN(DriSurfaceTest); |
| 71 }; | 71 }; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // Make sure the updates are correctly propagated to the native surface. | 117 // Make sure the updates are correctly propagated to the native surface. |
| 118 for (int i = 0; i < image.height(); ++i) { | 118 for (int i = 0; i < image.height(); ++i) { |
| 119 for (int j = 0; j < image.width(); ++j) { | 119 for (int j = 0; j < image.width(); ++j) { |
| 120 if (j < kDefaultMode.hdisplay / 2 && i < kDefaultMode.vdisplay / 2) | 120 if (j < kDefaultMode.hdisplay / 2 && i < kDefaultMode.vdisplay / 2) |
| 121 EXPECT_EQ(SK_ColorWHITE, image.getColor(j, i)); | 121 EXPECT_EQ(SK_ColorWHITE, image.getColor(j, i)); |
| 122 else | 122 else |
| 123 EXPECT_EQ(SK_ColorBLACK, image.getColor(j, i)); | 123 EXPECT_EQ(SK_ColorBLACK, image.getColor(j, i)); |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 } | 126 } |
| OLD | NEW |