|
2 | 2 | // Use of this source code is governed by a BSD-style license that can be
|
3 | 3 | // found in the LICENSE file.
|
4 | 4 |
|
5 |
| -#include "flutter/fml/time/time_point.h" |
6 | 5 | #include "flutter/testing/testing.h"
|
7 | 6 | #include "impeller/base/strings.h"
|
8 | 7 | #include "impeller/fixtures/array.frag.h"
|
@@ -92,7 +91,7 @@ TEST_P(RendererTest, CanCreateBoxPrimitive) {
|
92 | 91 | pass.GetTransientsBuffer().EmplaceUniform(uniforms));
|
93 | 92 |
|
94 | 93 | FS::FrameInfo frame_info;
|
95 |
| - frame_info.current_time = fml::TimePoint::Now().ToEpochDelta().ToSecondsF(); |
| 94 | + frame_info.current_time = GetSecondsElapsed(); |
96 | 95 | frame_info.cursor_position = GetCursorPosition();
|
97 | 96 | frame_info.window_size.x = GetWindowSize().width;
|
98 | 97 | frame_info.window_size.y = GetWindowSize().height;
|
@@ -181,7 +180,7 @@ TEST_P(RendererTest, CanRenderPerspectiveCube) {
|
181 | 180 | cmd.BindVertices(vertex_buffer);
|
182 | 181 |
|
183 | 182 | VS::UniformBuffer uniforms;
|
184 |
| - Scalar time = fml::TimePoint::Now().ToEpochDelta().ToSecondsF(); |
| 183 | + Scalar time = GetSecondsElapsed(); |
185 | 184 | euler_angles = Vector3(0.19 * time, 0.7 * time, 0.43 * time);
|
186 | 185 |
|
187 | 186 | uniforms.mvp =
|
@@ -244,7 +243,7 @@ TEST_P(RendererTest, CanRenderMultiplePrimitives) {
|
244 | 243 | cmd.BindVertices(vertex_buffer);
|
245 | 244 |
|
246 | 245 | FS::FrameInfo frame_info;
|
247 |
| - frame_info.current_time = fml::TimePoint::Now().ToEpochDelta().ToSecondsF(); |
| 246 | + frame_info.current_time = GetSecondsElapsed(); |
248 | 247 | frame_info.cursor_position = GetCursorPosition();
|
249 | 248 | frame_info.window_size.x = GetWindowSize().width;
|
250 | 249 | frame_info.window_size.y = GetWindowSize().height;
|
@@ -359,7 +358,7 @@ TEST_P(RendererTest, CanRenderToTexture) {
|
359 | 358 | cmd.BindVertices(vertex_buffer);
|
360 | 359 |
|
361 | 360 | FS::FrameInfo frame_info;
|
362 |
| - frame_info.current_time = fml::TimePoint::Now().ToEpochDelta().ToSecondsF(); |
| 361 | + frame_info.current_time = GetSecondsElapsed(); |
363 | 362 | frame_info.cursor_position = GetCursorPosition();
|
364 | 363 | frame_info.window_size.x = GetWindowSize().width;
|
365 | 364 | frame_info.window_size.y = GetWindowSize().height;
|
@@ -722,7 +721,7 @@ TEST_P(RendererTest, TheImpeller) {
|
722 | 721 |
|
723 | 722 | FS::FragInfo fs_uniform;
|
724 | 723 | fs_uniform.texture_size = Point(size);
|
725 |
| - fs_uniform.time = fml::TimePoint::Now().ToEpochDelta().ToSecondsF(); |
| 724 | + fs_uniform.time = GetSecondsElapsed(); |
726 | 725 | FS::BindFragInfo(cmd,
|
727 | 726 | pass.GetTransientsBuffer().EmplaceUniform(fs_uniform));
|
728 | 727 | FS::BindBlueNoise(cmd, blue_noise, noise_sampler);
|
@@ -768,7 +767,7 @@ TEST_P(RendererTest, ArrayUniforms) {
|
768 | 767 | VS::BindVertInfo(cmd,
|
769 | 768 | pass.GetTransientsBuffer().EmplaceUniform(vs_uniform));
|
770 | 769 |
|
771 |
| - auto time = fml::TimePoint::Now().ToEpochDelta().ToSecondsF(); |
| 770 | + auto time = GetSecondsElapsed(); |
772 | 771 | auto y_pos = [&time](float x) {
|
773 | 772 | return 400 + 10 * std::cos(time * 5 + x / 6);
|
774 | 773 | };
|
|
0 commit comments