| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <d3d9.h> | 5 #include <d3d9.h> |
| 6 #include <random> | 6 #include <random> |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/hash.h" | 10 #include "base/hash.h" |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 base::win::ScopedComPtr<IDirect3DSurface9> src, dst; | 348 base::win::ScopedComPtr<IDirect3DSurface9> src, dst; |
| 349 ASSERT_TRUE(d3d_utils::CreateTemporaryLockableSurface( | 349 ASSERT_TRUE(d3d_utils::CreateTemporaryLockableSurface( |
| 350 device(), src_size, src.Receive())) | 350 device(), src_size, src.Receive())) |
| 351 << "Could not create src render target"; | 351 << "Could not create src render target"; |
| 352 ASSERT_TRUE(d3d_utils::CreateTemporaryLockableSurface( | 352 ASSERT_TRUE(d3d_utils::CreateTemporaryLockableSurface( |
| 353 device(), dst_size, dst.Receive())) | 353 device(), dst_size, dst.Receive())) |
| 354 << "Could not create dst render target"; | 354 << "Could not create dst render target"; |
| 355 | 355 |
| 356 FillSymmetricRandomCheckerboard(src, src_size, checkerboard_size); | 356 FillSymmetricRandomCheckerboard(src, src_size, checkerboard_size); |
| 357 | 357 |
| 358 ASSERT_TRUE(gpu_ops->ResizeBilinear(src, gfx::Rect(src_size), dst)); | 358 ASSERT_TRUE(gpu_ops->ResizeBilinear(src, gfx::Rect(src_size), dst, |
| 359 gfx::Rect(dst_size))); |
| 359 | 360 |
| 360 AssertSymmetry(dst, dst_size); | 361 AssertSymmetry(dst, dst_size); |
| 361 } | 362 } |
| 362 | 363 |
| 363 void CreateRandomCheckerboardTexture( | 364 void CreateRandomCheckerboardTexture( |
| 364 const gfx::Size& size, | 365 const gfx::Size& size, |
| 365 int checkerboard_size, | 366 int checkerboard_size, |
| 366 IDirect3DSurface9** reference_surface, | 367 IDirect3DSurface9** reference_surface, |
| 367 IDirect3DTexture9** result) { | 368 IDirect3DTexture9** result) { |
| 368 base::win::ScopedComPtr<IDirect3DSurface9> dst; | 369 base::win::ScopedComPtr<IDirect3DSurface9> dst; |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 result.push_back(base::win::GetVersion()); | 882 result.push_back(base::win::GetVersion()); |
| 882 } | 883 } |
| 883 return result; | 884 return result; |
| 884 } | 885 } |
| 885 | 886 |
| 886 } // namespace | 887 } // namespace |
| 887 | 888 |
| 888 INSTANTIATE_TEST_CASE_P(VistaAndUp, | 889 INSTANTIATE_TEST_CASE_P(VistaAndUp, |
| 889 AcceleratedSurfaceTransformerTest, | 890 AcceleratedSurfaceTransformerTest, |
| 890 ::testing::ValuesIn(WindowsVersionIfVistaOrBetter())); | 891 ::testing::ValuesIn(WindowsVersionIfVistaOrBetter())); |
| OLD | NEW |