| 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 "SampleCode.h" | 8 #include "SampleCode.h" |
| 9 #include "SkAnimTimer.h" | 9 #include "SkAnimTimer.h" |
| 10 #include "SkView.h" | 10 #include "SkView.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 SkPaint paint; | 89 SkPaint paint; |
| 90 paint.setAntiAlias(true); | 90 paint.setAntiAlias(true); |
| 91 | 91 |
| 92 if (fInterp) { | 92 if (fInterp) { |
| 93 SkScalar values[5]; | 93 SkScalar values[5]; |
| 94 SkInterpolator::Result res = fInterp->timeToValues(fTime, values); | 94 SkInterpolator::Result res = fInterp->timeToValues(fTime, values); |
| 95 fColor = floats_to_color(values); | 95 fColor = floats_to_color(values); |
| 96 | 96 |
| 97 canvas->save(); | 97 canvas->save(); |
| 98 canvas->translate(fR.centerX(), fR.centerY()); | 98 canvas->rotate(values[4], fR.centerX(), fR.centerY()); |
| 99 canvas->rotate(values[4]); | |
| 100 canvas->translate(-fR.centerX(), -fR.centerY()); | |
| 101 | 99 |
| 102 switch (res) { | 100 switch (res) { |
| 103 case SkInterpolator::kFreezeEnd_Result: | 101 case SkInterpolator::kFreezeEnd_Result: |
| 104 delete fInterp; | 102 delete fInterp; |
| 105 fInterp = nullptr; | 103 fInterp = nullptr; |
| 106 break; | 104 break; |
| 107 default: | 105 default: |
| 108 break; | 106 break; |
| 109 } | 107 } |
| 110 } | 108 } |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 } | 175 } |
| 178 | 176 |
| 179 private: | 177 private: |
| 180 typedef SampleView INHERITED; | 178 typedef SampleView INHERITED; |
| 181 }; | 179 }; |
| 182 | 180 |
| 183 ////////////////////////////////////////////////////////////////////////////// | 181 ////////////////////////////////////////////////////////////////////////////// |
| 184 | 182 |
| 185 static SkView* MyFactory() { return new HTView; } | 183 static SkView* MyFactory() { return new HTView; } |
| 186 static SkViewRegister reg(MyFactory); | 184 static SkViewRegister reg(MyFactory); |
| OLD | NEW |