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" | 5 #include "content/browser/compositor/software_output_device_ozone.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 SoftwareOutputDeviceOzoneTest::~SoftwareOutputDeviceOzoneTest() { | 85 SoftwareOutputDeviceOzoneTest::~SoftwareOutputDeviceOzoneTest() { |
86 } | 86 } |
87 | 87 |
88 void SoftwareOutputDeviceOzoneTest::SetUp() { | 88 void SoftwareOutputDeviceOzoneTest::SetUp() { |
89 ui::ContextFactory* context_factory = | 89 ui::ContextFactory* context_factory = |
90 ui::InitializeContextFactoryForTests(enable_pixel_output_); | 90 ui::InitializeContextFactoryForTests(enable_pixel_output_); |
91 | 91 |
92 const gfx::Size size(500, 400); | 92 const gfx::Size size(500, 400); |
93 window_ = ui::OzonePlatform::GetInstance()->CreatePlatformWindow( | 93 window_ = ui::OzonePlatform::GetInstance()->CreatePlatformWindow( |
94 &window_delegate_, gfx::Rect(size)); | 94 &window_delegate_, gfx::Rect(size)); |
95 compositor_.reset( | 95 compositor_.reset(new ui::Compositor(context_factory, nullptr, |
96 new ui::Compositor(context_factory, base::ThreadTaskRunnerHandle::Get())); | 96 base::ThreadTaskRunnerHandle::Get())); |
97 compositor_->SetAcceleratedWidget(window_delegate_.GetAcceleratedWidget()); | 97 compositor_->SetAcceleratedWidget(window_delegate_.GetAcceleratedWidget()); |
98 compositor_->SetScaleAndSize(1.0f, size); | 98 compositor_->SetScaleAndSize(1.0f, size); |
99 | 99 |
100 output_device_ = | 100 output_device_ = |
101 content::SoftwareOutputDeviceOzone::Create(compositor_.get()); | 101 content::SoftwareOutputDeviceOzone::Create(compositor_.get()); |
102 if (output_device_) | 102 if (output_device_) |
103 output_device_->Resize(size, 1.f); | 103 output_device_->Resize(size, 1.f); |
104 } | 104 } |
105 | 105 |
106 void SoftwareOutputDeviceOzoneTest::TearDown() { | 106 void SoftwareOutputDeviceOzoneTest::TearDown() { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // Increase size. | 140 // Increase size. |
141 output_device_->Resize(size, 1.f); | 141 output_device_->Resize(size, 1.f); |
142 | 142 |
143 canvas = output_device_->BeginPaint(damage); | 143 canvas = output_device_->BeginPaint(damage); |
144 canvas_size.SetSize(canvas->getBaseLayerSize().width(), | 144 canvas_size.SetSize(canvas->getBaseLayerSize().width(), |
145 canvas->getBaseLayerSize().height()); | 145 canvas->getBaseLayerSize().height()); |
146 EXPECT_EQ(size.ToString(), canvas_size.ToString()); | 146 EXPECT_EQ(size.ToString(), canvas_size.ToString()); |
147 | 147 |
148 } | 148 } |
149 | 149 |
OLD | NEW |