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

Unified Diff: tests/SkpSkGrTest.cpp

Issue 1811613004: Change SkTime::GetMSecs to double; ensure values stored in SkMSec do not overflow. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Rebase. Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/PathOpsSkpClipTest.cpp ('k') | tests/StrokerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/SkpSkGrTest.cpp
diff --git a/tests/SkpSkGrTest.cpp b/tests/SkpSkGrTest.cpp
index 23bec84b8f585016d82131194caf27db034b0c2f..4469d4fb57c9b3b7acebf1069a2cee1bde315f81 100644
--- a/tests/SkpSkGrTest.cpp
+++ b/tests/SkpSkGrTest.cpp
@@ -106,7 +106,7 @@ struct TestResult {
TestStep fTestStep;
int fDirNo;
int fPixelError;
- int fTime;
+ SkMSec fTime;
bool fScaleOversized;
};
@@ -343,7 +343,7 @@ static SkMSec timePict(SkPicture* pic, SkCanvas* canvas) {
SkRect rect = {0, 0, SkIntToScalar(SkTMin(maxDimension, pWidth)),
SkIntToScalar(SkTMin(maxDimension, pHeight))};
canvas->clipRect(rect);
- SkMSec start = SkTime::GetMSecs();
+ skiatest::Timer timer;
for (int x = 0; x < slices; ++x) {
for (int y = 0; y < slices; ++y) {
pic->draw(canvas);
@@ -351,9 +351,9 @@ static SkMSec timePict(SkPicture* pic, SkCanvas* canvas) {
}
canvas->translate(SkIntToScalar(xInterval), SkIntToScalar(-yInterval * slices));
}
- SkMSec end = SkTime::GetMSecs();
+ SkMSec elapsed = timer.elapsedMsInt();
canvas->restore();
- return end - start;
+ return elapsed;
}
static void drawPict(SkPicture* pic, SkCanvas* canvas, int scale) {
@@ -462,8 +462,8 @@ void TestResult::testOne() {
if (fTestStep == kCompareBits) {
fPixelError = similarBits(grBitmap, bitmap);
- int skTime = timePict(pic, &skCanvas);
- int grTime = timePict(pic, &grCanvas);
+ SkMSec skTime = timePict(pic, &skCanvas);
+ SkMSec grTime = timePict(pic, &grCanvas);
fTime = skTime - grTime;
} else if (fTestStep == kEncodeFiles) {
SkString pngStr = make_png_name(fFilename);
« no previous file with comments | « tests/PathOpsSkpClipTest.cpp ('k') | tests/StrokerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698