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

Unified Diff: dm/DMUtil.cpp

Issue 88543002: DM: some refactoring (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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
« dm/DMSerializeTask.cpp ('K') | « dm/DMUtil.h ('k') | gyp/dm.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMUtil.cpp
diff --git a/dm/DMUtil.cpp b/dm/DMUtil.cpp
index d5214849e6f4e72fea0cbd4ae3e975d9d1d52d98..6cf6c22e2a442476ad328a5d9b01991d2296453f 100644
--- a/dm/DMUtil.cpp
+++ b/dm/DMUtil.cpp
@@ -15,18 +15,9 @@ SkString Png(SkString s) {
return s;
}
-bool MeetsExpectations(const skiagm::Expectations& expectations, const SkBitmap bitmap) {
- if (expectations.ignoreFailure() || expectations.empty()) {
- return true;
- }
- const skiagm::GmResultDigest digest(bitmap);
- return expectations.match(digest);
-}
-
void RecordPicture(skiagm::GM* gm, SkPicture* picture, uint32_t recordFlags) {
- SkCanvas* canvas = picture->beginRecording(SkScalarCeilToInt(gm->width()),
- SkScalarCeilToInt(gm->height()),
- recordFlags);
+ const SkISize size = gm->getISize();
+ SkCanvas* canvas = picture->beginRecording(size.width(), size.height(), recordFlags);
canvas->concat(gm->getInitialTransform());
gm->draw(canvas);
canvas->flush();
@@ -34,7 +25,8 @@ void RecordPicture(skiagm::GM* gm, SkPicture* picture, uint32_t recordFlags) {
}
void SetupBitmap(const SkBitmap::Config config, skiagm::GM* gm, SkBitmap* bitmap) {
- bitmap->setConfig(config, SkScalarCeilToInt(gm->width()), SkScalarCeilToInt(gm->height()));
+ const SkISize size = gm->getISize();
+ bitmap->setConfig(config, size.width(), size.height());
bitmap->allocPixels();
bitmap->eraseColor(0x00000000);
}
« dm/DMSerializeTask.cpp ('K') | « dm/DMUtil.h ('k') | gyp/dm.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698