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

Unified Diff: dm/DMUtil.cpp

Issue 286993005: refactor DM::SetupBitmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 7 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') | no next file » | 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 5c7517147abc2c89911df3ac8b79655d66ad3e3a..bef903daf044cdf57655c0fbc38f3e664308651b 100644
--- a/dm/DMUtil.cpp
+++ b/dm/DMUtil.cpp
@@ -21,21 +21,13 @@ SkPicture* RecordPicture(skiagm::GM* gm, uint32_t recordFlags, SkBBHFactory* fac
return recorder.endRecording();
}
-static void setup_bitmap(SkColorType ct, int width, int height, SkBitmap* bitmap) {
+void AllocatePixels(SkColorType ct, int width, int height, SkBitmap* bitmap) {
bitmap->allocPixels(SkImageInfo::Make(width, height, ct, kPremul_SkAlphaType));
bitmap->eraseColor(0x00000000);
}
-void SetupBitmap(SkColorType ct, skiagm::GM* gm, SkBitmap* bitmap) {
- setup_bitmap(ct, gm->getISize().width(), gm->getISize().height(), bitmap);
-}
-
-void SetupBitmap(SkColorType ct, SkBenchmark* bench, SkBitmap* bitmap) {
- setup_bitmap(ct, bench->getSize().x(), bench->getSize().y(), bitmap);
-}
-
-void SetupBitmap(SkColorType ct, const SkPicture& pic, SkBitmap* bitmap) {
- setup_bitmap(ct, pic.width(), pic.height(), bitmap);
+void AllocatePixels(const SkBitmap& reference, SkBitmap* bitmap) {
+ AllocatePixels(reference.colorType(), reference.width(), reference.height(), bitmap);
}
void DrawPicture(SkPicture* picture, SkBitmap* bitmap) {
« no previous file with comments | « dm/DMUtil.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698