OLD | NEW |
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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #if !defined(OS_WIN) | 7 #if !defined(OS_WIN) |
8 #include <unistd.h> | 8 #include <unistd.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 | 411 |
412 Image image1(*vcanvas_); | 412 Image image1(*vcanvas_); |
413 Image image2(*pcanvas_); | 413 Image image2(*pcanvas_); |
414 double diff = image1.PercentageDifferent(image2); | 414 double diff = image1.PercentageDifferent(image2); |
415 return std::max(std::max(diff1, diff2), diff); | 415 return std::max(std::max(diff1, diff2), diff); |
416 } | 416 } |
417 | 417 |
418 // Returns COMPARE, which is the default. If kGenerateSwitch command | 418 // Returns COMPARE, which is the default. If kGenerateSwitch command |
419 // line argument is used to start this process, GENERATE is returned instead. | 419 // line argument is used to start this process, GENERATE is returned instead. |
420 static ProcessAction CurrentMode() { | 420 static ProcessAction CurrentMode() { |
421 return CommandLine::ForCurrentProcess()->HasSwitch(kGenerateSwitch) ? | 421 return base::CommandLine::ForCurrentProcess()->HasSwitch(kGenerateSwitch) |
422 GENERATE : COMPARE; | 422 ? GENERATE |
| 423 : COMPARE; |
423 } | 424 } |
424 | 425 |
425 // Length in x and y of the square canvas. | 426 // Length in x and y of the square canvas. |
426 int size_; | 427 int size_; |
427 | 428 |
428 // Current image number in the current test. Used to number of test files. | 429 // Current image number in the current test. Used to number of test files. |
429 int number_; | 430 int number_; |
430 | 431 |
431 // A temporary HDC to draw into. | 432 // A temporary HDC to draw into. |
432 Context* context_; | 433 Context* context_; |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 pcanvas_->rotate(67); | 961 pcanvas_->rotate(67); |
961 vcanvas_->drawBitmap(bitmap, 20, -50, NULL); | 962 vcanvas_->drawBitmap(bitmap, 20, -50, NULL); |
962 pcanvas_->drawBitmap(bitmap, 20, -50, NULL); | 963 pcanvas_->drawBitmap(bitmap, 20, -50, NULL); |
963 EXPECT_EQ(0., ProcessImage(FILE_PATH_LITERAL("rotate"))); | 964 EXPECT_EQ(0., ProcessImage(FILE_PATH_LITERAL("rotate"))); |
964 } | 965 } |
965 } | 966 } |
966 | 967 |
967 #endif // !defined(USE_AURA) | 968 #endif // !defined(USE_AURA) |
968 | 969 |
969 } // namespace skia | 970 } // namespace skia |
OLD | NEW |