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

Side by Side Diff: dm/DMUtil.cpp

Issue 270543004: DM: Add --skps. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix and verbatim 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 unified diff | Download patch
« dm/DMUtil.h ('K') | « dm/DMUtil.h ('k') | dm/DMWriteTask.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "DMUtil.h" 1 #include "DMUtil.h"
2 2
3 #include "SkPicture.h" 3 #include "SkPicture.h"
4 #include "SkPictureRecorder.h" 4 #include "SkPictureRecorder.h"
5 5
6 namespace DM { 6 namespace DM {
7 7
8 SkString UnderJoin(const char* a, const char* b) { 8 SkString UnderJoin(const char* a, const char* b) {
9 SkString s; 9 SkString s;
10 s.appendf("%s_%s", a, b); 10 s.appendf("%s_%s", a, b);
(...skipping 16 matching lines...) Expand all
27 } 27 }
28 28
29 void SetupBitmap(const SkColorType ct, skiagm::GM* gm, SkBitmap* bitmap) { 29 void SetupBitmap(const SkColorType ct, skiagm::GM* gm, SkBitmap* bitmap) {
30 setup_bitmap(ct, gm->getISize().width(), gm->getISize().height(), bitmap); 30 setup_bitmap(ct, gm->getISize().width(), gm->getISize().height(), bitmap);
31 } 31 }
32 32
33 void SetupBitmap(const SkColorType ct, SkBenchmark* bench, SkBitmap* bitmap) { 33 void SetupBitmap(const SkColorType ct, SkBenchmark* bench, SkBitmap* bitmap) {
34 setup_bitmap(ct, bench->getSize().x(), bench->getSize().y(), bitmap); 34 setup_bitmap(ct, bench->getSize().x(), bench->getSize().y(), bitmap);
35 } 35 }
36 36
37 void SetupBitmap(const SkColorType ct, const SkPicture& pic, SkBitmap* bitmap) {
38 setup_bitmap(ct, pic.width(), pic.height(), bitmap);
39 }
40
37 void DrawPicture(SkPicture* picture, SkBitmap* bitmap) { 41 void DrawPicture(SkPicture* picture, SkBitmap* bitmap) {
38 SkASSERT(picture != NULL); 42 SkASSERT(picture != NULL);
39 SkASSERT(bitmap != NULL); 43 SkASSERT(bitmap != NULL);
40 SkCanvas canvas(*bitmap); 44 SkCanvas canvas(*bitmap);
41 canvas.drawPicture(*picture); 45 canvas.drawPicture(*picture);
42 canvas.flush(); 46 canvas.flush();
43 } 47 }
44 48
45 bool BitmapsEqual(const SkBitmap& a, const SkBitmap& b) { 49 bool BitmapsEqual(const SkBitmap& a, const SkBitmap& b) {
46 const SkAutoLockPixels lockA(a), lockB(b); 50 const SkAutoLockPixels lockA(a), lockB(b);
47 return a.getSize() == b.getSize() && 0 == memcmp(a.getPixels(), b.getPixels( ), b.getSize()); 51 return a.getSize() == b.getSize() && 0 == memcmp(a.getPixels(), b.getPixels( ), b.getSize());
48 } 52 }
49 53
50 } // namespace DM 54 } // namespace DM
OLDNEW
« dm/DMUtil.h ('K') | « dm/DMUtil.h ('k') | dm/DMWriteTask.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698