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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 surface->UnlockRect(); | 68 surface->UnlockRect(); |
69 return result; | 69 return result; |
70 } | 70 } |
71 | 71 |
72 bool WritePNGFile(const SkBitmap& bitmap, const base::FilePath& file_path) { | 72 bool WritePNGFile(const SkBitmap& bitmap, const base::FilePath& file_path) { |
73 std::vector<unsigned char> png_data; | 73 std::vector<unsigned char> png_data; |
74 const bool discard_transparency = true; | 74 const bool discard_transparency = true; |
75 if (gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, | 75 if (gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, |
76 discard_transparency, | 76 discard_transparency, |
77 &png_data) && | 77 &png_data) && |
78 file_util::CreateDirectory(file_path.DirName())) { | 78 base::CreateDirectory(file_path.DirName())) { |
79 char* data = reinterpret_cast<char*>(&png_data[0]); | 79 char* data = reinterpret_cast<char*>(&png_data[0]); |
80 int size = static_cast<int>(png_data.size()); | 80 int size = static_cast<int>(png_data.size()); |
81 return file_util::WriteFile(file_path, data, size) == size; | 81 return file_util::WriteFile(file_path, data, size) == size; |
82 } | 82 } |
83 return false; | 83 return false; |
84 } | 84 } |
85 | 85 |
86 } // namespace | 86 } // namespace |
87 | 87 |
88 // Test fixture for AcceleratedSurfaceTransformer. | 88 // Test fixture for AcceleratedSurfaceTransformer. |
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 result.push_back(base::win::GetVersion()); | 886 result.push_back(base::win::GetVersion()); |
887 } | 887 } |
888 return result; | 888 return result; |
889 } | 889 } |
890 | 890 |
891 } // namespace | 891 } // namespace |
892 | 892 |
893 INSTANTIATE_TEST_CASE_P(VistaAndUp, | 893 INSTANTIATE_TEST_CASE_P(VistaAndUp, |
894 AcceleratedSurfaceTransformerTest, | 894 AcceleratedSurfaceTransformerTest, |
895 ::testing::ValuesIn(WindowsVersionIfVistaOrBetter())); | 895 ::testing::ValuesIn(WindowsVersionIfVistaOrBetter())); |
OLD | NEW |