Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Side by Side Diff: ui/surface/accelerated_surface_transformer_win_unittest.cc

Issue 100573002: Move directory creation functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/ui_base_paths.cc ('k') | webkit/browser/appcache/appcache_database.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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()));
OLDNEW
« no previous file with comments | « ui/base/ui_base_paths.cc ('k') | webkit/browser/appcache/appcache_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698