Skip to content

Commit

Permalink
Merge branch 'simplify_convex_tessellation' of github.com:jonahwillia…
Browse files Browse the repository at this point in the history
…ms/engine into simplify_convex_tessellation
  • Loading branch information
jonahwilliams committed Nov 14, 2023
2 parents d142d1a + d0dd986 commit 37c238a
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 20 deletions.
12 changes: 6 additions & 6 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ vars = {
'llvm_git': 'https://llvm.googlesource.com',
# OCMock is for testing only so there is no google clone
'ocmock_git': 'https://github.com/erikdoe/ocmock.git',
'skia_revision': '1e9711980c61881138d51b25dd033e9f32951bcf',
'skia_revision': '17b6555a15511085d3a36321594695078f433131',

# WARNING: DO NOT EDIT canvaskit_cipd_instance MANUALLY
# See `lib/web_ui/README.md` for how to roll CanvasKit to a new version.
Expand Down Expand Up @@ -59,7 +59,7 @@ vars = {
# Dart is: https://github.com/dart-lang/sdk/blob/main/DEPS
# You can use //tools/dart/create_updated_flutter_deps.py to produce
# updated revision list of existing dependencies.
'dart_revision': '1a1b9cbc838a9fa218356cbc3c4ee6c1691efbd4',
'dart_revision': '370145bbbd4f400f419815a2f50f165daf9d00a0',

# WARNING: DO NOT EDIT MANUALLY
# The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py
Expand All @@ -69,7 +69,7 @@ vars = {
'dart_browser_launcher_rev': '4f9e7843b683c9e9357aaf263a929ec6ecf959c8',
'dart_clock_rev': 'f975668839f45bad561d6227f88297bbbcff03fa',
'dart_collection_rev': 'f309148623c4755ce9d6c00850092458325058ca',
'dart_devtools_rev': 'fec80c6e29b627aa17e8b15f72cb4013a28d14ec',
'dart_devtools_rev': '28a3978da5f230d4311fd2a4e2effaf0ef620de7',
'dart_libprotobuf_rev': '24487dd1045c7f3d64a21f38a3f0c06cc4cf2edb',
'dart_perfetto_rev': '13ce0c9e13b0940d2476cd0cff2301708a9a2e2b',
'dart_protobuf_gn_rev': 'ca669f79945418f6229e4fef89b666b2a88cbb10',
Expand All @@ -78,7 +78,7 @@ vars = {
'dart_root_certificates_rev': '692f6d6488af68e0121317a9c2c9eb393eb0ee50',
'dart_tools_rev': 'dd46ef2d48a674bd7aef19b7a267c69470656492',
'dart_watcher_rev': 'b2b278ae4198b4c431a145ddcfdab1460d5f9ec5',
'dart_webdev_rev': '6961b202c343e12893e6c664ef70336b7c3845c3',
'dart_webdev_rev': '5ad79c240b000a50057612d6af4573f6e649f65c',
'dart_webkit_inspection_protocol_rev': '667c55e6f65638592768e0325b75420e39b01d2e',
'dart_yaml_edit_rev': '9b9d33c5255798c950e843efe19e6f81a225ad28',
'dart_zlib_rev': '14dd4c4455602c9b71a1a89b5cafd1f4030d2e3f',
Expand Down Expand Up @@ -333,7 +333,7 @@ deps = {
Var('chromium_git') + '/external/github.com/WebAssembly/binaryen.git@a51bd6df919a5b79574f0996a760cc20cb05697e',

'src/third_party/dart/third_party/devtools':
{'dep_type': 'cipd', 'packages': [{'package': 'dart/third_party/flutter/devtools', 'version': 'git_revision:fec80c6e29b627aa17e8b15f72cb4013a28d14ec'}]},
{'dep_type': 'cipd', 'packages': [{'package': 'dart/third_party/flutter/devtools', 'version': 'git_revision:28a3978da5f230d4311fd2a4e2effaf0ef620de7'}]},

'src/third_party/dart/third_party/pkg/args':
Var('dart_git') + '/args.git@46d5033377d277d70bc6ec68504730b9384b1db1',
Expand Down Expand Up @@ -950,7 +950,7 @@ deps = {
'packages': [
{
'package': 'fuchsia/sdk/core/linux-amd64',
'version': 'ikCrJNCuuApNeuH-6I6v4dUNoTAen6ExZgDPBuJOotEC'
'version': 'UaodAPcg8HCGdDb-ChhD8POE2xs6aSgKd5w4pD-C2kQC'
}
],
'condition': 'host_os == "linux" and not download_fuchsia_sdk',
Expand Down
2 changes: 1 addition & 1 deletion ci/licenses_golden/licenses_dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Signature: 103d4ff215dbc1d1d173c53a02775a51
Signature: b6b3ce62b7d2961df6f4e76d4df34b84

====================================================================================================
LIBRARY: dart
Expand Down
2 changes: 1 addition & 1 deletion ci/licenses_golden/licenses_fuchsia
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Signature: 35d7ad046078e952793b908250f5689b
Signature: f2b777d781fab7734005abe333d13034

====================================================================================================
LIBRARY: fuchsia_sdk
Expand Down
2 changes: 1 addition & 1 deletion ci/licenses_golden/licenses_skia
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Signature: f7e337fb193552b13ab991c405855df6
Signature: 66bf30ab99465a814b8fd321b7140495

====================================================================================================
LIBRARY: etc1
Expand Down
2 changes: 1 addition & 1 deletion flow/stopwatch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ size_t Stopwatch::GetCurrentSample() const {
}

double StopwatchVisualizer::UnitFrameInterval(double raster_time_ms) const {
return raster_time_ms / stopwatch_.GetFrameBudget().count();
return raster_time_ms / frame_budget_.count();
}

double StopwatchVisualizer::UnitHeight(double raster_time_ms,
Expand Down
10 changes: 9 additions & 1 deletion flow/stopwatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ class FixedRefreshRateStopwatch : public Stopwatch {
class StopwatchVisualizer {
public:
explicit StopwatchVisualizer(const Stopwatch& stopwatch)
: stopwatch_(stopwatch) {}
: stopwatch_(stopwatch) {
// Looking up the frame budget from the stopwatch delegate class may call
// into JNI or make platform calls which are slow. This value is safe to
// cache since the StopwatchVisualizer is recreated on each frame.
frame_budget_ = stopwatch_.GetFrameBudget();
}

virtual ~StopwatchVisualizer() = default;

Expand All @@ -112,7 +117,10 @@ class StopwatchVisualizer {
/// @brief Converts a raster time to a unit height.
double UnitHeight(double time_ms, double max_height) const;

fml::Milliseconds GetFrameBudget() const { return frame_budget_; }

const Stopwatch& stopwatch_;
fml::Milliseconds frame_budget_;
};

} // namespace flutter
Expand Down
2 changes: 1 addition & 1 deletion flow/stopwatch_dl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void DlStopwatchVisualizer::Visualize(DlCanvas* canvas,
auto const bottom = rect.bottom();

// Scale the graph to show time frames up to those that are 3x the frame time.
auto const one_frame_ms = stopwatch_.GetFrameBudget().count();
auto const one_frame_ms = GetFrameBudget().count();
auto const max_interval = one_frame_ms * 3.0;
auto const max_unit_interval = UnitFrameInterval(max_interval);
auto const sample_unit_width = (1.0 / kMaxSamples);
Expand Down
4 changes: 2 additions & 2 deletions flow/stopwatch_sk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void SkStopwatchVisualizer::InitVisualizeSurface(SkISize size) const {

// Scale the graph to show frame times up to those that are 3 times the frame
// time.
const double one_frame_ms = stopwatch_.GetFrameBudget().count();
const double one_frame_ms = GetFrameBudget().count();
const double max_interval = one_frame_ms * 3.0;
const double max_unit_interval = UnitFrameInterval(max_interval);

Expand Down Expand Up @@ -101,7 +101,7 @@ void SkStopwatchVisualizer::Visualize(DlCanvas* canvas,

// Scale the graph to show frame times up to those that are 3 times the frame
// time.
const double one_frame_ms = stopwatch_.GetFrameBudget().count();
const double one_frame_ms = GetFrameBudget().count();
const double max_interval = one_frame_ms * 3.0;
const double max_unit_interval = UnitFrameInterval(max_interval);

Expand Down
17 changes: 11 additions & 6 deletions flow/stopwatch_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// found in the LICENSE file.

#include "flutter/flow/stopwatch.h"
#include "fml/time/time_delta.h"
#include "gmock/gmock.h" // IWYU pragma: keep
#include "gtest/gtest.h"

Expand All @@ -11,9 +12,14 @@ using testing::Return;
namespace flutter {
namespace testing {

class MockRefreshRateUpdater : public Stopwatch::RefreshRateUpdater {
class FakeRefreshRateUpdater : public Stopwatch::RefreshRateUpdater {
public:
MOCK_METHOD(fml::Milliseconds, GetFrameBudget, (), (const, override));
fml::Milliseconds GetFrameBudget() const override { return budget_; }

void SetFrameBudget(fml::Milliseconds budget) { budget_ = budget; }

private:
fml::Milliseconds budget_;
};

TEST(Instrumentation, GetDefaultFrameBudgetTest) {
Expand All @@ -32,11 +38,10 @@ TEST(Instrumentation, GetOneShotFrameBudgetTest) {
}

TEST(Instrumentation, GetFrameBudgetFromUpdaterTest) {
MockRefreshRateUpdater updater;
FakeRefreshRateUpdater updater;
fml::Milliseconds frame_budget_90fps = fml::RefreshRateToFrameBudget(90);
EXPECT_CALL(updater, GetFrameBudget())
.Times(1)
.WillOnce(Return(frame_budget_90fps));
updater.SetFrameBudget(frame_budget_90fps);

Stopwatch stopwatch(updater);
fml::Milliseconds actual_frame_budget = stopwatch.GetFrameBudget();
EXPECT_EQ(frame_budget_90fps, actual_frame_budget);
Expand Down
11 changes: 11 additions & 0 deletions tools/android_sdk/create_cipd_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ for platform in "${platforms[@]}"; do
done
done

# Special treatment for NDK to move to expected directory.
# Instead of the ndk being in `sdk/ndk/<major>.<minor>.<patch>/`, it will be
# in `ndk/`.
# This simplifies the build scripts, and enables version difference between
# the Dart and Flutter build while reusing the same build rules.
mv $upload_dir/sdk/ndk $upload_dir/ndk-bundle
ndk_sub_paths=`find $upload_dir/ndk-bundle -maxdepth 1 -type d`
ndk_sub_paths_arr=($ndk_sub_paths)
mv ${ndk_sub_paths_arr[1]} $upload_dir/ndk
rm -rf $upload_dir/ndk-bundle

# Accept all licenses to ensure they are generated and uploaded.
yes "y" | $sdkmanager_path --licenses --sdk_root=$sdk_root
cp -r "$sdk_root/licenses" "$upload_dir/sdk"
Expand Down

0 comments on commit 37c238a

Please sign in to comment.