OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "SKPAnimationBench.h" | 8 #include "SKPAnimationBench.h" |
9 #include "SkCommandLineFlags.h" | 9 #include "SkCommandLineFlags.h" |
10 #include "SkMultiPictureDraw.h" | 10 #include "SkMultiPictureDraw.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 fAnimationTimer.start(); | 27 fAnimationTimer.start(); |
28 } | 28 } |
29 | 29 |
30 void SKPAnimationBench::drawPicture() { | 30 void SKPAnimationBench::drawPicture() { |
31 fAnimationTimer.end(); | 31 fAnimationTimer.end(); |
32 | 32 |
33 for (int j = 0; j < this->tileRects().count(); ++j) { | 33 for (int j = 0; j < this->tileRects().count(); ++j) { |
34 SkMatrix trans = SkMatrix::MakeTrans(-1.f * this->tileRects()[j].fLeft, | 34 SkMatrix trans = SkMatrix::MakeTrans(-1.f * this->tileRects()[j].fLeft, |
35 -1.f * this->tileRects()[j].fTop); | 35 -1.f * this->tileRects()[j].fTop); |
36 fAnimation->preConcatFrameMatrix(fAnimationTimer.fWall, fDevBounds, &tra
ns); | 36 fAnimation->preConcatFrameMatrix(fAnimationTimer.fWall, fDevBounds, &tra
ns); |
37 this->surfaces()[j]->getCanvas()->drawPicture(this->picture(), &trans, N
ULL); | 37 this->surfaces()[j]->getCanvas()->drawPicture(this->picture(), &trans, n
ullptr); |
38 } | 38 } |
39 | 39 |
40 for (int j = 0; j < this->tileRects().count(); ++j) { | 40 for (int j = 0; j < this->tileRects().count(); ++j) { |
41 this->surfaces()[j]->getCanvas()->flush(); | 41 this->surfaces()[j]->getCanvas()->flush(); |
42 } | 42 } |
43 } | 43 } |
44 | 44 |
45 class ZoomAnimation : public SKPAnimationBench::Animation { | 45 class ZoomAnimation : public SKPAnimationBench::Animation { |
46 public: | 46 public: |
47 ZoomAnimation(SkScalar zoomMax, double zoomPeriodMs) | 47 ZoomAnimation(SkScalar zoomMax, double zoomPeriodMs) |
(...skipping 18 matching lines...) Expand all Loading... |
66 | 66 |
67 private: | 67 private: |
68 double fZoomMax; | 68 double fZoomMax; |
69 double fZoomPeriodMs; | 69 double fZoomPeriodMs; |
70 }; | 70 }; |
71 | 71 |
72 SKPAnimationBench::Animation* SKPAnimationBench::CreateZoomAnimation(SkScalar zo
omMax, | 72 SKPAnimationBench::Animation* SKPAnimationBench::CreateZoomAnimation(SkScalar zo
omMax, |
73 double zoom
PeriodMs) { | 73 double zoom
PeriodMs) { |
74 return new ZoomAnimation(zoomMax, zoomPeriodMs); | 74 return new ZoomAnimation(zoomMax, zoomPeriodMs); |
75 } | 75 } |
OLD | NEW |