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

Unified Diff: bench/SKPBench.cpp

Issue 1061323003: Change to add zoom animations to nanobench (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: windows warning Created 5 years, 8 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 | « bench/SKPBench.h ('k') | bench/nanobench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/SKPBench.cpp
diff --git a/bench/SKPBench.cpp b/bench/SKPBench.cpp
index 6f74ff942d8aefbb7fbc86477e726b65abe9056f..592d0428fd01f7c449dc91e7f9b0229366570ca4 100644
--- a/bench/SKPBench.cpp
+++ b/bench/SKPBench.cpp
@@ -98,32 +98,40 @@ SkIPoint SKPBench::onGetSize() {
void SKPBench::onDraw(const int loops, SkCanvas* canvas) {
if (fUseMultiPictureDraw) {
for (int i = 0; i < loops; i++) {
- SkMultiPictureDraw mpd;
-
- for (int j = 0; j < fTileRects.count(); ++j) {
- SkMatrix trans;
- trans.setTranslate(-fTileRects[j].fLeft/fScale,
- -fTileRects[j].fTop/fScale);
- mpd.add(fSurfaces[j]->getCanvas(), fPic, &trans);
- }
-
- mpd.draw();
-
- for (int j = 0; j < fTileRects.count(); ++j) {
- fSurfaces[j]->getCanvas()->flush();
- }
+ this->drawMPDPicture();
}
} else {
for (int i = 0; i < loops; i++) {
- for (int j = 0; j < fTileRects.count(); ++j) {
- const SkMatrix trans = SkMatrix::MakeTrans(-fTileRects[j].fLeft / fScale,
- -fTileRects[j].fTop / fScale);
- fSurfaces[j]->getCanvas()->drawPicture(fPic, &trans, NULL);
- }
-
- for (int j = 0; j < fTileRects.count(); ++j) {
- fSurfaces[j]->getCanvas()->flush();
- }
+ this->drawPicture();
}
}
}
+
+void SKPBench::drawMPDPicture() {
+ SkMultiPictureDraw mpd;
+
+ for (int j = 0; j < fTileRects.count(); ++j) {
+ SkMatrix trans;
+ trans.setTranslate(-fTileRects[j].fLeft/fScale,
+ -fTileRects[j].fTop/fScale);
+ mpd.add(fSurfaces[j]->getCanvas(), fPic, &trans);
+ }
+
+ mpd.draw();
+
+ for (int j = 0; j < fTileRects.count(); ++j) {
+ fSurfaces[j]->getCanvas()->flush();
+ }
+}
+
+void SKPBench::drawPicture() {
+ for (int j = 0; j < fTileRects.count(); ++j) {
+ const SkMatrix trans = SkMatrix::MakeTrans(-fTileRects[j].fLeft / fScale,
+ -fTileRects[j].fTop / fScale);
+ fSurfaces[j]->getCanvas()->drawPicture(fPic, &trans, NULL);
+ }
+
+ for (int j = 0; j < fTileRects.count(); ++j) {
+ fSurfaces[j]->getCanvas()->flush();
+ }
+}
« no previous file with comments | « bench/SKPBench.h ('k') | bench/nanobench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698