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

Side by Side Diff: cc/test/pixel_test_utils.cc

Issue 11474050: cc: Unify namespaces for all test files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 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 | « cc/test/pixel_test_utils.h ('k') | cc/test/render_pass_test_common.h » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_utils.h" 5 #include "cc/test/pixel_test_utils.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "third_party/skia/include/core/SkBitmap.h" 9 #include "third_party/skia/include/core/SkBitmap.h"
10 #include "ui/gfx/codec/png_codec.h" 10 #include "ui/gfx/codec/png_codec.h"
11 11
12 namespace cc { 12 namespace cc {
13 namespace test {
14 13
15 bool WritePNGFile(const SkBitmap& bitmap, const FilePath& file_path) { 14 bool WritePNGFile(const SkBitmap& bitmap, const FilePath& file_path) {
16 std::vector<unsigned char> png_data; 15 std::vector<unsigned char> png_data;
17 const bool discard_transparency = true; 16 const bool discard_transparency = true;
18 if (gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, 17 if (gfx::PNGCodec::EncodeBGRASkBitmap(bitmap,
19 discard_transparency, 18 discard_transparency,
20 &png_data) && 19 &png_data) &&
21 file_util::CreateDirectory(file_path.DirName())) { 20 file_util::CreateDirectory(file_path.DirName())) {
22 char* data = reinterpret_cast<char*>(&png_data[0]); 21 char* data = reinterpret_cast<char*>(&png_data[0]);
23 int size = static_cast<int>(png_data.size()); 22 int size = static_cast<int>(png_data.size());
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 68 }
70 69
71 if (diff_pixels_count != 0) { 70 if (diff_pixels_count != 0) {
72 LOG(ERROR) << "Images differ by pixel count: " << diff_pixels_count; 71 LOG(ERROR) << "Images differ by pixel count: " << diff_pixels_count;
73 return false; 72 return false;
74 } 73 }
75 74
76 return true; 75 return true;
77 } 76 }
78 77
79 } // namespace test
80 } // namespace cc 78 } // namespace cc
81
OLDNEW
« no previous file with comments | « cc/test/pixel_test_utils.h ('k') | cc/test/render_pass_test_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698