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

Unified Diff: dm/DMUtil.cpp

Issue 178473006: DM: also run benches once. (Closed) Base URL: https://skia.googlesource.com/skia.git@dm
Patch Set: add note Created 6 years, 10 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 | « dm/DMUtil.h ('k') | gm/gm.h » ('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 849d1bf9d8acb2613585f0fc33d086dc9f854008..5a849fb5f6224031cce91b56e947ec6bdffea596 100644
--- a/dm/DMUtil.cpp
+++ b/dm/DMUtil.cpp
@@ -19,13 +19,19 @@ void RecordPicture(skiagm::GM* gm, SkPicture* picture, uint32_t recordFlags) {
picture->endRecording();
}
-void SetupBitmap(const SkColorType ct, skiagm::GM* gm, SkBitmap* bitmap) {
- const SkISize size = gm->getISize();
- bitmap->allocPixels(SkImageInfo::Make(size.width(), size.height(),
- ct, kPremul_SkAlphaType));
+static void setup_bitmap(SkColorType ct, int width, int height, SkBitmap* bitmap) {
+ bitmap->allocPixels(SkImageInfo::Make(width, height, ct, kPremul_SkAlphaType));
bitmap->eraseColor(0x00000000);
}
+void SetupBitmap(const SkColorType ct, skiagm::GM* gm, SkBitmap* bitmap) {
+ setup_bitmap(ct, gm->getISize().width(), gm->getISize().height(), bitmap);
+}
+
+void SetupBitmap(const SkColorType ct, SkBenchmark* bench, SkBitmap* bitmap) {
+ setup_bitmap(ct, bench->getSize().x(), bench->getSize().y(), bitmap);
+}
+
void DrawPicture(SkPicture* picture, SkBitmap* bitmap) {
SkASSERT(picture != NULL);
SkASSERT(bitmap != NULL);
« no previous file with comments | « dm/DMUtil.h ('k') | gm/gm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698