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/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "cc/output/compositor_frame_metadata.h" | 9 #include "cc/output/compositor_frame_metadata.h" |
10 #include "cc/output/copy_output_request.h" | 10 #include "cc/output/copy_output_request.h" |
11 #include "cc/output/gl_renderer.h" | 11 #include "cc/output/gl_renderer.h" |
12 #include "cc/output/output_surface.h" | 12 #include "cc/output/output_surface.h" |
13 #include "cc/output/software_renderer.h" | 13 #include "cc/output/software_renderer.h" |
14 #include "cc/resources/resource_provider.h" | 14 #include "cc/resources/resource_provider.h" |
15 #include "cc/test/paths.h" | 15 #include "cc/test/paths.h" |
16 #include "cc/test/pixel_test_utils.h" | 16 #include "cc/test/pixel_test_utils.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 #include "ui/gl/gl_implementation.h" | 18 #include "ui/gl/gl_implementation.h" |
19 #include "webkit/common/gpu/context_provider_in_process.h" | 19 #include "webkit/common/gpu/context_provider_in_process.h" |
20 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" | 20 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" |
21 | 21 |
22 namespace cc { | 22 namespace cc { |
23 | 23 |
24 class PixelTest::PixelTestRendererClient : public RendererClient { | 24 class PixelTest::PixelTestRendererClient : public RendererClient { |
25 public: | 25 public: |
26 explicit PixelTestRendererClient(gfx::Size device_viewport_size) | 26 explicit PixelTestRendererClient(gfx::Size device_viewport_size) |
27 : device_viewport_size_(device_viewport_size) {} | 27 : device_viewport_size_(device_viewport_size) {} |
28 | 28 |
29 // RendererClient implementation. | 29 // RendererClient implementation. |
30 virtual gfx::Size DeviceViewportSize() const OVERRIDE { | 30 virtual gfx::Rect DeviceViewport() const OVERRIDE { |
31 return device_viewport_size_; | 31 return gfx::Rect(device_viewport_size_); |
32 } | 32 } |
33 virtual float DeviceScaleFactor() const OVERRIDE { | 33 virtual float DeviceScaleFactor() const OVERRIDE { |
34 return 1.f; | 34 return 1.f; |
35 } | 35 } |
36 virtual const LayerTreeSettings& Settings() const OVERRIDE { | 36 virtual const LayerTreeSettings& Settings() const OVERRIDE { |
37 return settings_; | 37 return settings_; |
38 } | 38 } |
39 virtual void SetFullRootLayerDamage() OVERRIDE {} | 39 virtual void SetFullRootLayerDamage() OVERRIDE {} |
40 virtual void SetManagedMemoryPolicy( | 40 virtual void SetManagedMemoryPolicy( |
41 const ManagedMemoryPolicy& policy) OVERRIDE {} | 41 const ManagedMemoryPolicy& policy) OVERRIDE {} |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 scoped_ptr<SoftwareOutputDevice> device(new SoftwareOutputDevice()); | 146 scoped_ptr<SoftwareOutputDevice> device(new SoftwareOutputDevice()); |
147 output_surface_.reset(new OutputSurface(device.Pass())); | 147 output_surface_.reset(new OutputSurface(device.Pass())); |
148 resource_provider_ = ResourceProvider::Create(output_surface_.get(), 0); | 148 resource_provider_ = ResourceProvider::Create(output_surface_.get(), 0); |
149 renderer_ = SoftwareRenderer::Create( | 149 renderer_ = SoftwareRenderer::Create( |
150 fake_client_.get(), | 150 fake_client_.get(), |
151 output_surface_.get(), | 151 output_surface_.get(), |
152 resource_provider_.get()).PassAs<DirectRenderer>(); | 152 resource_provider_.get()).PassAs<DirectRenderer>(); |
153 } | 153 } |
154 | 154 |
155 } // namespace cc | 155 } // namespace cc |
OLD | NEW |