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 "content/browser/compositor/software_output_device_ozone.h" |
| 6 |
| 7 #include <memory> |
| 8 |
5 #include "base/macros.h" | 9 #include "base/macros.h" |
6 #include "base/memory/scoped_ptr.h" | |
7 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
8 #include "base/thread_task_runner_handle.h" | 11 #include "base/thread_task_runner_handle.h" |
9 #include "content/browser/compositor/software_output_device_ozone.h" | |
10 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
11 #include "third_party/skia/include/core/SkCanvas.h" | 13 #include "third_party/skia/include/core/SkCanvas.h" |
12 #include "ui/compositor/compositor.h" | 14 #include "ui/compositor/compositor.h" |
13 #include "ui/compositor/test/context_factories_for_test.h" | 15 #include "ui/compositor/test/context_factories_for_test.h" |
14 #include "ui/gfx/geometry/size.h" | 16 #include "ui/gfx/geometry/size.h" |
15 #include "ui/gfx/skia_util.h" | 17 #include "ui/gfx/skia_util.h" |
16 #include "ui/gfx/vsync_provider.h" | 18 #include "ui/gfx/vsync_provider.h" |
17 #include "ui/gl/gl_implementation.h" | 19 #include "ui/gl/gl_implementation.h" |
18 #include "ui/ozone/public/ozone_platform.h" | 20 #include "ui/ozone/public/ozone_platform.h" |
19 #include "ui/ozone/public/surface_ozone_canvas.h" | 21 #include "ui/ozone/public/surface_ozone_canvas.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 58 |
57 class SoftwareOutputDeviceOzoneTest : public testing::Test { | 59 class SoftwareOutputDeviceOzoneTest : public testing::Test { |
58 public: | 60 public: |
59 SoftwareOutputDeviceOzoneTest(); | 61 SoftwareOutputDeviceOzoneTest(); |
60 ~SoftwareOutputDeviceOzoneTest() override; | 62 ~SoftwareOutputDeviceOzoneTest() override; |
61 | 63 |
62 void SetUp() override; | 64 void SetUp() override; |
63 void TearDown() override; | 65 void TearDown() override; |
64 | 66 |
65 protected: | 67 protected: |
66 scoped_ptr<content::SoftwareOutputDeviceOzone> output_device_; | 68 std::unique_ptr<content::SoftwareOutputDeviceOzone> output_device_; |
67 bool enable_pixel_output_; | 69 bool enable_pixel_output_; |
68 | 70 |
69 private: | 71 private: |
70 scoped_ptr<ui::Compositor> compositor_; | 72 std::unique_ptr<ui::Compositor> compositor_; |
71 scoped_ptr<base::MessageLoop> message_loop_; | 73 std::unique_ptr<base::MessageLoop> message_loop_; |
72 TestPlatformWindowDelegate window_delegate_; | 74 TestPlatformWindowDelegate window_delegate_; |
73 scoped_ptr<ui::PlatformWindow> window_; | 75 std::unique_ptr<ui::PlatformWindow> window_; |
74 | 76 |
75 DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceOzoneTest); | 77 DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceOzoneTest); |
76 }; | 78 }; |
77 | 79 |
78 SoftwareOutputDeviceOzoneTest::SoftwareOutputDeviceOzoneTest() | 80 SoftwareOutputDeviceOzoneTest::SoftwareOutputDeviceOzoneTest() |
79 : enable_pixel_output_(false) { | 81 : enable_pixel_output_(false) { |
80 message_loop_.reset(new base::MessageLoopForUI); | 82 message_loop_.reset(new base::MessageLoopForUI); |
81 } | 83 } |
82 | 84 |
83 SoftwareOutputDeviceOzoneTest::~SoftwareOutputDeviceOzoneTest() { | 85 SoftwareOutputDeviceOzoneTest::~SoftwareOutputDeviceOzoneTest() { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // Increase size. | 140 // Increase size. |
139 output_device_->Resize(size, 1.f); | 141 output_device_->Resize(size, 1.f); |
140 | 142 |
141 canvas = output_device_->BeginPaint(damage); | 143 canvas = output_device_->BeginPaint(damage); |
142 canvas_size.SetSize(canvas->getBaseLayerSize().width(), | 144 canvas_size.SetSize(canvas->getBaseLayerSize().width(), |
143 canvas->getBaseLayerSize().height()); | 145 canvas->getBaseLayerSize().height()); |
144 EXPECT_EQ(size.ToString(), canvas_size.ToString()); | 146 EXPECT_EQ(size.ToString(), canvas_size.ToString()); |
145 | 147 |
146 } | 148 } |
147 | 149 |
OLD | NEW |