Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Side by Side Diff: content/browser/compositor/software_output_device_ozone_unittest.cc

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: Sync with ToT Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/test/scoped_task_environment.h" 10 #include "base/test/scoped_task_environment.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 ui::ContextFactoryPrivate* context_factory_private = nullptr; 89 ui::ContextFactoryPrivate* context_factory_private = nullptr;
90 ui::InitializeContextFactoryForTests(enable_pixel_output_, &context_factory, 90 ui::InitializeContextFactoryForTests(enable_pixel_output_, &context_factory,
91 &context_factory_private); 91 &context_factory_private);
92 92
93 const gfx::Size size(500, 400); 93 const gfx::Size size(500, 400);
94 window_ = ui::OzonePlatform::GetInstance()->CreatePlatformWindow( 94 window_ = ui::OzonePlatform::GetInstance()->CreatePlatformWindow(
95 &window_delegate_, gfx::Rect(size)); 95 &window_delegate_, gfx::Rect(size));
96 compositor_.reset( 96 compositor_.reset(
97 new ui::Compositor(viz::FrameSinkId(1, 1), context_factory, nullptr, 97 new ui::Compositor(viz::FrameSinkId(1, 1), context_factory, nullptr,
98 base::ThreadTaskRunnerHandle::Get(), 98 base::ThreadTaskRunnerHandle::Get(),
99 false /* enable_surface_synchronization */)); 99 false /* enable_surface_synchronization */,
100 false /* enable_pixel_canvas */));
100 compositor_->SetAcceleratedWidget(window_delegate_.GetAcceleratedWidget()); 101 compositor_->SetAcceleratedWidget(window_delegate_.GetAcceleratedWidget());
101 compositor_->SetScaleAndSize(1.0f, size); 102 compositor_->SetScaleAndSize(1.0f, size);
102 103
103 output_device_ = 104 output_device_ =
104 content::SoftwareOutputDeviceOzone::Create(compositor_.get()); 105 content::SoftwareOutputDeviceOzone::Create(compositor_.get());
105 if (output_device_) 106 if (output_device_)
106 output_device_->Resize(size, 1.f); 107 output_device_->Resize(size, 1.f);
107 } 108 }
108 109
109 void SoftwareOutputDeviceOzoneTest::TearDown() { 110 void SoftwareOutputDeviceOzoneTest::TearDown() {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 // Increase size. 144 // Increase size.
144 output_device_->Resize(size, 1.f); 145 output_device_->Resize(size, 1.f);
145 146
146 canvas = output_device_->BeginPaint(damage); 147 canvas = output_device_->BeginPaint(damage);
147 canvas_size.SetSize(canvas->getBaseLayerSize().width(), 148 canvas_size.SetSize(canvas->getBaseLayerSize().width(),
148 canvas->getBaseLayerSize().height()); 149 canvas->getBaseLayerSize().height());
149 EXPECT_EQ(size.ToString(), canvas_size.ToString()); 150 EXPECT_EQ(size.ToString(), canvas_size.ToString());
150 151
151 } 152 }
152 153
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698