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

Side by Side Diff: skia/ext/vector_canvas_unittest.cc

Issue 18248: CommandLine API rework (Closed)
Patch Set: fixes Created 11 years, 11 months 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
« no previous file with comments | « net/url_request/url_request_unittest.h ('k') | webkit/activex_shim/activex_shared.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "skia/ext/vector_canvas.h" 5 #include "skia/ext/vector_canvas.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 390
391 Image image1(*vcanvas_); 391 Image image1(*vcanvas_);
392 Image image2(*pcanvas_); 392 Image image2(*pcanvas_);
393 double diff = image1.PercentageDifferent(image2); 393 double diff = image1.PercentageDifferent(image2);
394 return std::max(std::max(diff1, diff2), diff); 394 return std::max(std::max(diff1, diff2), diff);
395 } 395 }
396 396
397 // Returns COMPARE, which is the default. If kGenerateSwitch command 397 // Returns COMPARE, which is the default. If kGenerateSwitch command
398 // line argument is used to start this process, GENERATE is returned instead. 398 // line argument is used to start this process, GENERATE is returned instead.
399 static ProcessAction CurrentMode() { 399 static ProcessAction CurrentMode() {
400 return CommandLine().HasSwitch(kGenerateSwitch) ? GENERATE : COMPARE; 400 return CommandLine::ForCurrentProcess()->HasSwitch(kGenerateSwitch) ?
401 GENERATE : COMPARE;
401 } 402 }
402 403
403 // Length in x and y of the square canvas. 404 // Length in x and y of the square canvas.
404 int size_; 405 int size_;
405 406
406 // Current image number in the current test. Used to number of test files. 407 // Current image number in the current test. Used to number of test files.
407 int number_; 408 int number_;
408 409
409 // A temporary HDC to draw into. 410 // A temporary HDC to draw into.
410 Context* context_; 411 Context* context_;
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 { 978 {
978 vcanvas_->rotate(67); 979 vcanvas_->rotate(67);
979 pcanvas_->rotate(67); 980 pcanvas_->rotate(67);
980 vcanvas_->drawBitmap(bitmap, 20, -50, NULL); 981 vcanvas_->drawBitmap(bitmap, 20, -50, NULL);
981 pcanvas_->drawBitmap(bitmap, 20, -50, NULL); 982 pcanvas_->drawBitmap(bitmap, 20, -50, NULL);
982 EXPECT_EQ(0., ProcessImage(L"rotate")); 983 EXPECT_EQ(0., ProcessImage(L"rotate"));
983 } 984 }
984 } 985 }
985 986
986 } // namespace skia 987 } // namespace skia
OLDNEW
« no previous file with comments | « net/url_request/url_request_unittest.h ('k') | webkit/activex_shim/activex_shared.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698