| 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/layer_tree_pixel_test.h" | 5 #include "cc/test/layer_tree_pixel_test.h" |
| 6 | 6 |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "cc/output/copy_output_request.h" | 8 #include "cc/output/copy_output_request.h" |
| 9 #include "cc/output/copy_output_result.h" | 9 #include "cc/output/copy_output_result.h" |
| 10 #include "cc/resources/texture_mailbox.h" | 10 #include "cc/resources/texture_mailbox.h" |
| 11 #include "cc/test/paths.h" | 11 #include "cc/test/paths.h" |
| 12 #include "cc/test/pixel_comparator.h" | 12 #include "cc/test/pixel_comparator.h" |
| 13 #include "cc/test/pixel_test_output_surface.h" | 13 #include "cc/test/pixel_test_output_surface.h" |
| 14 #include "cc/test/pixel_test_software_output_device.h" | 14 #include "cc/test/pixel_test_software_output_device.h" |
| 15 #include "cc/test/pixel_test_utils.h" | 15 #include "cc/test/pixel_test_utils.h" |
| 16 #include "cc/trees/layer_tree_impl.h" | 16 #include "cc/trees/layer_tree_impl.h" |
| 17 #include "ui/gl/gl_implementation.h" | 17 #include "ui/gl/gl_implementation.h" |
| 18 #include "webkit/common/gpu/context_provider_in_process.h" | 18 #include "webkit/common/gpu/context_provider_in_process.h" |
| 19 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" | 19 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" |
| 20 | 20 |
| 21 namespace cc { | 21 namespace cc { |
| 22 | 22 |
| 23 LayerTreePixelTest::LayerTreePixelTest() | 23 LayerTreePixelTest::LayerTreePixelTest() |
| 24 : pixel_comparator_(new ExactPixelComparator(true)), | 24 : pixel_comparator_(new ExactPixelComparator(true)), |
| 25 test_type_(GL_WITH_DEFAULT) {} | 25 test_type_(GL_WITH_DEFAULT) {} |
| 26 | 26 |
| 27 LayerTreePixelTest::~LayerTreePixelTest() {} | 27 LayerTreePixelTest::~LayerTreePixelTest() {} |
| 28 | 28 |
| 29 scoped_ptr<OutputSurface> LayerTreePixelTest::CreateOutputSurface() { | 29 scoped_ptr<OutputSurface> LayerTreePixelTest::CreateOutputSurface( |
| 30 bool fallback) { |
| 30 gfx::Vector2d viewport_offset(20, 10); | 31 gfx::Vector2d viewport_offset(20, 10); |
| 31 gfx::Size surface_expansion_size(40, 60); | 32 gfx::Size surface_expansion_size(40, 60); |
| 32 scoped_ptr<PixelTestOutputSurface> output_surface; | 33 scoped_ptr<PixelTestOutputSurface> output_surface; |
| 33 | 34 |
| 34 switch (test_type_) { | 35 switch (test_type_) { |
| 35 case SOFTWARE_WITH_DEFAULT: | 36 case SOFTWARE_WITH_DEFAULT: |
| 36 case SOFTWARE_WITH_BITMAP: { | 37 case SOFTWARE_WITH_BITMAP: { |
| 37 scoped_ptr<PixelTestSoftwareOutputDevice> software_output_device( | 38 scoped_ptr<PixelTestSoftwareOutputDevice> software_output_device( |
| 38 new PixelTestSoftwareOutputDevice); | 39 new PixelTestSoftwareOutputDevice); |
| 39 software_output_device->set_surface_expansion_size( | 40 software_output_device->set_surface_expansion_size( |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 out_pixels[dest_y + x + SK_G32_SHIFT/8] = pixels.get()[src_y + x + 1]; | 251 out_pixels[dest_y + x + SK_G32_SHIFT/8] = pixels.get()[src_y + x + 1]; |
| 251 out_pixels[dest_y + x + SK_B32_SHIFT/8] = pixels.get()[src_y + x + 2]; | 252 out_pixels[dest_y + x + SK_B32_SHIFT/8] = pixels.get()[src_y + x + 2]; |
| 252 out_pixels[dest_y + x + SK_A32_SHIFT/8] = pixels.get()[src_y + x + 3]; | 253 out_pixels[dest_y + x + SK_A32_SHIFT/8] = pixels.get()[src_y + x + 3]; |
| 253 } | 254 } |
| 254 } | 255 } |
| 255 | 256 |
| 256 return bitmap.Pass(); | 257 return bitmap.Pass(); |
| 257 } | 258 } |
| 258 | 259 |
| 259 } // namespace cc | 260 } // namespace cc |
| OLD | NEW |