| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "cc/test/pixel_test.h" | 5 #include "cc/test/pixel_test.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "cc/base/switches.h" | 10 #include "cc/base/switches.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 void PixelTest::ForceExpandedViewport(gfx::Size surface_expansion) { | 140 void PixelTest::ForceExpandedViewport(gfx::Size surface_expansion) { |
| 141 static_cast<PixelTestOutputSurface*>(output_surface_.get()) | 141 static_cast<PixelTestOutputSurface*>(output_surface_.get()) |
| 142 ->set_surface_expansion_size(surface_expansion); | 142 ->set_surface_expansion_size(surface_expansion); |
| 143 SoftwareOutputDevice* device = output_surface_->software_device(); | 143 SoftwareOutputDevice* device = output_surface_->software_device(); |
| 144 if (device) { | 144 if (device) { |
| 145 static_cast<PixelTestSoftwareOutputDevice*>(device) | 145 static_cast<PixelTestSoftwareOutputDevice*>(device) |
| 146 ->set_surface_expansion_size(surface_expansion); | 146 ->set_surface_expansion_size(surface_expansion); |
| 147 } | 147 } |
| 148 } | 148 } |
| 149 | 149 |
| 150 void PixelTest::ForceViewportOffset(gfx::Vector2d viewport_offset) { | 150 void PixelTest::ForceViewportOffset(const gfx::Vector2d& viewport_offset) { |
| 151 external_device_viewport_offset_ = viewport_offset; | 151 external_device_viewport_offset_ = viewport_offset; |
| 152 } | 152 } |
| 153 | 153 |
| 154 void PixelTest::ForceDeviceClip(const gfx::Rect& clip) { | 154 void PixelTest::ForceDeviceClip(const gfx::Rect& clip) { |
| 155 external_device_clip_rect_ = clip; | 155 external_device_clip_rect_ = clip; |
| 156 } | 156 } |
| 157 | 157 |
| 158 void PixelTest::EnableExternalStencilTest() { | 158 void PixelTest::EnableExternalStencilTest() { |
| 159 static_cast<PixelTestOutputSurface*>(output_surface_.get()) | 159 static_cast<PixelTestOutputSurface*>(output_surface_.get()) |
| 160 ->set_has_external_stencil_test(true); | 160 ->set_has_external_stencil_test(true); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void PixelTest::SetUpSoftwareRenderer() { | 163 void PixelTest::SetUpSoftwareRenderer() { |
| 164 scoped_ptr<SoftwareOutputDevice> device(new PixelTestSoftwareOutputDevice()); | 164 scoped_ptr<SoftwareOutputDevice> device(new PixelTestSoftwareOutputDevice()); |
| 165 output_surface_.reset(new PixelTestOutputSurface(device.Pass())); | 165 output_surface_.reset(new PixelTestOutputSurface(device.Pass())); |
| 166 output_surface_->BindToClient(output_surface_client_.get()); | 166 output_surface_->BindToClient(output_surface_client_.get()); |
| 167 resource_provider_ = | 167 resource_provider_ = |
| 168 ResourceProvider::Create(output_surface_.get(), NULL, 0, false, 1); | 168 ResourceProvider::Create(output_surface_.get(), NULL, 0, false, 1); |
| 169 renderer_ = SoftwareRenderer::Create( | 169 renderer_ = SoftwareRenderer::Create( |
| 170 this, &settings_, output_surface_.get(), resource_provider_.get()) | 170 this, &settings_, output_surface_.get(), resource_provider_.get()) |
| 171 .PassAs<DirectRenderer>(); | 171 .PassAs<DirectRenderer>(); |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace cc | 174 } // namespace cc |
| OLD | NEW |