| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SKPBench.h" | 8 #include "SKPBench.h" |
| 9 #include "SkCommandLineFlags.h" | 9 #include "SkCommandLineFlags.h" |
| 10 #include "SkMultiPictureDraw.h" | 10 #include "SkMultiPictureDraw.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 } | 97 } |
| 98 | 98 |
| 99 bool SKPBench::isSuitableFor(Backend backend) { | 99 bool SKPBench::isSuitableFor(Backend backend) { |
| 100 return backend != kNonRendering_Backend; | 100 return backend != kNonRendering_Backend; |
| 101 } | 101 } |
| 102 | 102 |
| 103 SkIPoint SKPBench::onGetSize() { | 103 SkIPoint SKPBench::onGetSize() { |
| 104 return SkIPoint::Make(fClip.width(), fClip.height()); | 104 return SkIPoint::Make(fClip.width(), fClip.height()); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void SKPBench::onDraw(const int loops, SkCanvas* canvas) { | 107 void SKPBench::onDraw(int loops, SkCanvas* canvas) { |
| 108 SkASSERT(fDoLooping || 1 == loops); | 108 SkASSERT(fDoLooping || 1 == loops); |
| 109 if (fUseMultiPictureDraw) { | 109 if (fUseMultiPictureDraw) { |
| 110 for (int i = 0; i < loops; i++) { | 110 for (int i = 0; i < loops; i++) { |
| 111 this->drawMPDPicture(); | 111 this->drawMPDPicture(); |
| 112 } | 112 } |
| 113 } else { | 113 } else { |
| 114 for (int i = 0; i < loops; i++) { | 114 for (int i = 0; i < loops; i++) { |
| 115 this->drawPicture(); | 115 this->drawPicture(); |
| 116 } | 116 } |
| 117 } | 117 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 138 for (int j = 0; j < fTileRects.count(); ++j) { | 138 for (int j = 0; j < fTileRects.count(); ++j) { |
| 139 const SkMatrix trans = SkMatrix::MakeTrans(-fTileRects[j].fLeft / fScale
, | 139 const SkMatrix trans = SkMatrix::MakeTrans(-fTileRects[j].fLeft / fScale
, |
| 140 -fTileRects[j].fTop / fScale)
; | 140 -fTileRects[j].fTop / fScale)
; |
| 141 fSurfaces[j]->getCanvas()->drawPicture(fPic, &trans, nullptr); | 141 fSurfaces[j]->getCanvas()->drawPicture(fPic, &trans, nullptr); |
| 142 } | 142 } |
| 143 | 143 |
| 144 for (int j = 0; j < fTileRects.count(); ++j) { | 144 for (int j = 0; j < fTileRects.count(); ++j) { |
| 145 fSurfaces[j]->getCanvas()->flush(); | 145 fSurfaces[j]->getCanvas()->flush(); |
| 146 } | 146 } |
| 147 } | 147 } |
| OLD | NEW |