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

Side by Side Diff: chrome/browser/chromeos/login/screenshot_testing/SkDiffPixelsMetric_cpu.cpp

Issue 1547093002: Switch to standard integer types in chrome/browser/chromeos/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // WARNING! This file is copied from third_party/skia/tools/skpdiff and slightly 5 // WARNING! This file is copied from third_party/skia/tools/skpdiff and slightly
6 // modified to be compilable outside Skia and suit chromium style. Some comments 6 // modified to be compilable outside Skia and suit chromium style. Some comments
7 // can make no sense. 7 // can make no sense.
8 // TODO(elizavetai): remove this file and reuse the original one in Skia 8 // TODO(elizavetai): remove this file and reuse the original one in Skia
9 9
10 #include <stdint.h>
11
10 #include "chrome/browser/chromeos/login/screenshot_testing/SkDiffPixelsMetric.h" 12 #include "chrome/browser/chromeos/login/screenshot_testing/SkDiffPixelsMetric.h"
11 #include "third_party/skia/include/core/SkBitmap.h" 13 #include "third_party/skia/include/core/SkBitmap.h"
12 14
13 bool SkDifferentPixelsMetric::diff( 15 bool SkDifferentPixelsMetric::diff(
14 SkBitmap* baseline, 16 SkBitmap* baseline,
15 SkBitmap* test, 17 SkBitmap* test,
16 const SkImageDiffer::BitmapsToCreate& bitmapsToCreate, 18 const SkImageDiffer::BitmapsToCreate& bitmapsToCreate,
17 SkImageDiffer::Result* result) { 19 SkImageDiffer::Result* result) {
18 // Ensure the images are comparable 20 // Ensure the images are comparable
19 if (baseline->width() != test->width() || 21 if (baseline->width() != test->width() ||
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 } 117 }
116 if (bitmapsToCreate.whiteDiff) { 118 if (bitmapsToCreate.whiteDiff) {
117 result->whiteDiffBitmap.unlockPixels(); 119 result->whiteDiffBitmap.unlockPixels();
118 } 120 }
119 121
120 // Calculates the percentage of identical pixels 122 // Calculates the percentage of identical pixels
121 result->result = 1.0 - ((double)result->poiCount / (width * height)); 123 result->result = 1.0 - ((double)result->poiCount / (width * height));
122 124
123 return true; 125 return true;
124 } 126 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698