| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 void PixelTest::ForceExpandedViewport(const gfx::Size& surface_expansion) { | 137 void PixelTest::ForceExpandedViewport(const gfx::Size& surface_expansion) { |
| 138 static_cast<PixelTestOutputSurface*>(output_surface_.get()) | 138 static_cast<PixelTestOutputSurface*>(output_surface_.get()) |
| 139 ->set_surface_expansion_size(surface_expansion); | 139 ->set_surface_expansion_size(surface_expansion); |
| 140 SoftwareOutputDevice* device = output_surface_->software_device(); | 140 SoftwareOutputDevice* device = output_surface_->software_device(); |
| 141 if (device) { | 141 if (device) { |
| 142 static_cast<PixelTestSoftwareOutputDevice*>(device) | 142 static_cast<PixelTestSoftwareOutputDevice*>(device) |
| 143 ->set_surface_expansion_size(surface_expansion); | 143 ->set_surface_expansion_size(surface_expansion); |
| 144 } | 144 } |
| 145 } | 145 } |
| 146 | 146 |
| 147 void PixelTest::ForceViewportOffset(gfx::Vector2d viewport_offset) { | 147 void PixelTest::ForceViewportOffset(const gfx::Vector2d& viewport_offset) { |
| 148 external_device_viewport_offset_ = viewport_offset; | 148 external_device_viewport_offset_ = viewport_offset; |
| 149 } | 149 } |
| 150 | 150 |
| 151 void PixelTest::ForceDeviceClip(const gfx::Rect& clip) { | 151 void PixelTest::ForceDeviceClip(const gfx::Rect& clip) { |
| 152 external_device_clip_rect_ = clip; | 152 external_device_clip_rect_ = clip; |
| 153 } | 153 } |
| 154 | 154 |
| 155 void PixelTest::EnableExternalStencilTest() { | 155 void PixelTest::EnableExternalStencilTest() { |
| 156 static_cast<PixelTestOutputSurface*>(output_surface_.get()) | 156 static_cast<PixelTestOutputSurface*>(output_surface_.get()) |
| 157 ->set_has_external_stencil_test(true); | 157 ->set_has_external_stencil_test(true); |
| 158 } | 158 } |
| 159 | 159 |
| 160 void PixelTest::SetUpSoftwareRenderer() { | 160 void PixelTest::SetUpSoftwareRenderer() { |
| 161 scoped_ptr<SoftwareOutputDevice> device(new PixelTestSoftwareOutputDevice()); | 161 scoped_ptr<SoftwareOutputDevice> device(new PixelTestSoftwareOutputDevice()); |
| 162 output_surface_.reset(new PixelTestOutputSurface(device.Pass())); | 162 output_surface_.reset(new PixelTestOutputSurface(device.Pass())); |
| 163 output_surface_->BindToClient(output_surface_client_.get()); | 163 output_surface_->BindToClient(output_surface_client_.get()); |
| 164 resource_provider_ = | 164 resource_provider_ = |
| 165 ResourceProvider::Create(output_surface_.get(), NULL, 0, false, 1); | 165 ResourceProvider::Create(output_surface_.get(), NULL, 0, false, 1); |
| 166 renderer_ = SoftwareRenderer::Create( | 166 renderer_ = SoftwareRenderer::Create( |
| 167 this, &settings_, output_surface_.get(), resource_provider_.get()) | 167 this, &settings_, output_surface_.get(), resource_provider_.get()) |
| 168 .PassAs<DirectRenderer>(); | 168 .PassAs<DirectRenderer>(); |
| 169 } | 169 } |
| 170 | 170 |
| 171 } // namespace cc | 171 } // namespace cc |
| OLD | NEW |