diff --git a/DEPS b/DEPS index b2e4c24f7dd6e..e14e6358d4465 100644 --- a/DEPS +++ b/DEPS @@ -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': '7685acfb622190506f54533b5083737cb36f86ca', + 'skia_revision': 'f3401c6186c1371361f8c4042c9a927c1221c29a', # WARNING: DO NOT EDIT canvaskit_cipd_instance MANUALLY # See `lib/web_ui/README.md` for how to roll CanvasKit to a new version. @@ -195,7 +195,6 @@ vars = { "upstream_libpng": "https://github.com/glennrp/libpng.git", "upstream_libtess2": "https://github.com/memononen/libtess2.git", "upstream_libwebp": "https://chromium.googlesource.com/webm/libwebp.git", - "upstream_libxml": "https://gitlab.gnome.org/GNOME/libxml2.git", "upstream_leak_tracker": "https://github.com/dart-lang/leak_tracker.git", "upstream_logging": "https://github.com/dart-lang/logging.git", "upstream_markdown": "https://github.com/dart-lang/markdown.git", @@ -273,7 +272,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + 'e0aa3ae49a32df7dd00655ee4dd55b00d84a47ea', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + '0141e94b34cbd3db77f28796587334857fa985da', 'src/flutter/third_party/rapidjson': Var('fuchsia_git') + '/third_party/rapidjson' + '@' + 'ef3564c5c8824989393b87df25355baf35ff544b', @@ -648,9 +647,6 @@ deps = { 'src/flutter/third_party/wuffs': Var('skia_git') + '/external/github.com/google/wuffs-mirror-release-c.git' + '@' + '600cd96cf47788ee3a74b40a6028b035c9fd6a61', - 'src/third_party/libxml': - Var('flutter_git') + '/third_party/libxml' + '@' + 'a143e452b5fc7d872813eeadc8db421694058098', - 'src/third_party/zlib': Var('chromium_git') + '/chromium/src/third_party/zlib.git' + '@' + Var('dart_zlib_rev'), @@ -666,7 +662,7 @@ deps = { 'src/flutter/third_party/pyyaml': Var('fuchsia_git') + '/third_party/pyyaml.git' + '@' + '25e97546488eee166b1abb229a27856cecd8b7ac', - 'src/third_party/swiftshader': + 'src/flutter/third_party/swiftshader': Var('swiftshader_git') + '/SwiftShader.git' + '@' + '5b6f768198ce6a6485da31e1be06b5a17a2bf0a0', 'src/third_party/angle': diff --git a/ci/licenses_golden/excluded_files b/ci/licenses_golden/excluded_files index b1c907110a197..51104ce3d8a54 100644 --- a/ci/licenses_golden/excluded_files +++ b/ci/licenses_golden/excluded_files @@ -1045,6 +1045,7 @@ ../../../flutter/third_party/sqlite/README.md ../../../flutter/third_party/sqlite/VERSION ../../../flutter/third_party/stb +../../../flutter/third_party/swiftshader ../../../flutter/third_party/test_shaders ../../../flutter/third_party/tinygltf ../../../flutter/third_party/tonic/.clang-format @@ -2874,7 +2875,6 @@ ../../../third_party/libpng/projects ../../../third_party/libpng/scripts ../../../third_party/libpng/tests -../../../third_party/libxml ../../../third_party/perfetto/.clang-format ../../../third_party/perfetto/.clang-tidy ../../../third_party/perfetto/.git @@ -3023,7 +3023,6 @@ ../../../third_party/root_certificates/certdata.pem ../../../third_party/root_certificates/certdata.txt ../../../third_party/root_certificates/codereview.settings -../../../third_party/swiftshader ../../../third_party/vulkan-deps/.git ../../../third_party/vulkan-deps/.gitattributes ../../../third_party/vulkan-deps/.gitignore diff --git a/ci/licenses_golden/licenses_flutter b/ci/licenses_golden/licenses_flutter index 99c8122d0d994..5083bee902362 100644 --- a/ci/licenses_golden/licenses_flutter +++ b/ci/licenses_golden/licenses_flutter @@ -5115,6 +5115,8 @@ ORIGIN: ../../../flutter/impeller/entity/geometry/point_field_geometry.cc + ../. ORIGIN: ../../../flutter/impeller/entity/geometry/point_field_geometry.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/geometry/rect_geometry.cc + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/geometry/rect_geometry.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/impeller/entity/geometry/round_rect_geometry.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/impeller/entity/geometry/round_rect_geometry.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/geometry/stroke_path_geometry.cc + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/geometry/stroke_path_geometry.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/geometry/vertices_geometry.cc + ../../../flutter/LICENSE @@ -7916,6 +7918,8 @@ FILE: ../../../flutter/impeller/entity/geometry/point_field_geometry.cc FILE: ../../../flutter/impeller/entity/geometry/point_field_geometry.h FILE: ../../../flutter/impeller/entity/geometry/rect_geometry.cc FILE: ../../../flutter/impeller/entity/geometry/rect_geometry.h +FILE: ../../../flutter/impeller/entity/geometry/round_rect_geometry.cc +FILE: ../../../flutter/impeller/entity/geometry/round_rect_geometry.h FILE: ../../../flutter/impeller/entity/geometry/stroke_path_geometry.cc FILE: ../../../flutter/impeller/entity/geometry/stroke_path_geometry.h FILE: ../../../flutter/impeller/entity/geometry/vertices_geometry.cc diff --git a/ci/licenses_golden/licenses_skia b/ci/licenses_golden/licenses_skia index 26a09fc6fb1c1..6a1e7aec25a03 100644 --- a/ci/licenses_golden/licenses_skia +++ b/ci/licenses_golden/licenses_skia @@ -1,4 +1,4 @@ -Signature: aa1ac33edf804b7c6ff2ac7584b0c6d0 +Signature: 2fd4d8d4611505dfd9381dc1ada23cf1 ==================================================================================================== LIBRARY: etc1 diff --git a/ci/licenses_golden/tool_signature b/ci/licenses_golden/tool_signature index 5970ad247311b..569c9c825d329 100644 --- a/ci/licenses_golden/tool_signature +++ b/ci/licenses_golden/tool_signature @@ -1,2 +1,2 @@ -Signature: 9c9e9d44a47e4d85f1debd69bc795b40 +Signature: 11fcac7657e1af099350216fe4aefee8 diff --git a/impeller/BUILD.gn b/impeller/BUILD.gn index 3237235fe9154..3bfe85a0fb072 100644 --- a/impeller/BUILD.gn +++ b/impeller/BUILD.gn @@ -119,7 +119,7 @@ impeller_component("impeller_unittests") { if (glfw_vulkan_library != "") { deps += [ - "//third_party/swiftshader", + "//flutter/third_party/swiftshader", "//third_party/vulkan-deps/vulkan-loader/src:libvulkan", "//third_party/vulkan_validation_layers", "//third_party/vulkan_validation_layers:vulkan_gen_json_files", diff --git a/impeller/aiks/aiks_context.h b/impeller/aiks/aiks_context.h index 5ac0fcaa7bc03..650465d770dfc 100644 --- a/impeller/aiks/aiks_context.h +++ b/impeller/aiks/aiks_context.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_AIKS_AIKS_CONTEXT_H_ +#define FLUTTER_IMPELLER_AIKS_AIKS_CONTEXT_H_ #include @@ -51,3 +52,5 @@ class AiksContext { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_AIKS_AIKS_CONTEXT_H_ diff --git a/impeller/aiks/aiks_playground.h b/impeller/aiks/aiks_playground.h index a98c426e7821d..64490cb679254 100644 --- a/impeller/aiks/aiks_playground.h +++ b/impeller/aiks/aiks_playground.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_AIKS_AIKS_PLAYGROUND_H_ +#define FLUTTER_IMPELLER_AIKS_AIKS_PLAYGROUND_H_ #include "flutter/fml/macros.h" #include "impeller/aiks/aiks_context.h" @@ -41,3 +42,5 @@ class AiksPlayground : public PlaygroundTest { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_AIKS_AIKS_PLAYGROUND_H_ diff --git a/impeller/aiks/aiks_unittests.cc b/impeller/aiks/aiks_unittests.cc index de64dc27ec688..3fdfec01ae0df 100644 --- a/impeller/aiks/aiks_unittests.cc +++ b/impeller/aiks/aiks_unittests.cc @@ -318,6 +318,74 @@ TEST_P(AiksTest, CanRenderClips) { ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture())); } +TEST_P(AiksTest, CanRenderSimpleClips) { + Canvas canvas; + canvas.Scale(GetContentScale()); + Paint paint; + + paint.color = Color::White(); + canvas.DrawPaint(paint); + + auto draw = [&canvas](const Paint& paint, Scalar x, Scalar y) { + canvas.Save(); + canvas.Translate({x, y}); + { + canvas.Save(); + canvas.ClipRect(Rect::MakeLTRB(50, 50, 150, 150)); + canvas.DrawPaint(paint); + canvas.Restore(); + } + { + canvas.Save(); + canvas.ClipOval(Rect::MakeLTRB(200, 50, 300, 150)); + canvas.DrawPaint(paint); + canvas.Restore(); + } + { + canvas.Save(); + canvas.ClipRRect(Rect::MakeLTRB(50, 200, 150, 300), {20, 20}); + canvas.DrawPaint(paint); + canvas.Restore(); + } + canvas.Restore(); + }; + + paint.color = Color::Blue(); + draw(paint, 0, 0); + + std::vector gradient_colors = { + Color{0x1f / 255.0, 0.0, 0x5c / 255.0, 1.0}, + Color{0x5b / 255.0, 0.0, 0x60 / 255.0, 1.0}, + Color{0x87 / 255.0, 0x01 / 255.0, 0x60 / 255.0, 1.0}, + Color{0xac / 255.0, 0x25 / 255.0, 0x53 / 255.0, 1.0}, + Color{0xe1 / 255.0, 0x6b / 255.0, 0x5c / 255.0, 1.0}, + Color{0xf3 / 255.0, 0x90 / 255.0, 0x60 / 255.0, 1.0}, + Color{0xff / 255.0, 0xb5 / 255.0, 0x6b / 250.0, 1.0}}; + std::vector stops = { + 0.0, + (1.0 / 6.0) * 1, + (1.0 / 6.0) * 2, + (1.0 / 6.0) * 3, + (1.0 / 6.0) * 4, + (1.0 / 6.0) * 5, + 1.0, + }; + auto texture = CreateTextureForFixture("airplane.jpg", + /*enable_mipmapping=*/true); + + paint.color_source = ColorSource::MakeRadialGradient( + {500, 600}, 75, std::move(gradient_colors), std::move(stops), + Entity::TileMode::kMirror, {}); + draw(paint, 0, 300); + + paint.color_source = ColorSource::MakeImage( + texture, Entity::TileMode::kRepeat, Entity::TileMode::kRepeat, {}, + Matrix::MakeTranslation({0, 0})); + draw(paint, 300, 0); + + ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture())); +} + TEST_P(AiksTest, CanRenderNestedClips) { Canvas canvas; Paint paint; @@ -2264,6 +2332,74 @@ TEST_P(AiksTest, FilledEllipsesRenderCorrectly) { ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture())); } +TEST_P(AiksTest, FilledRoundRectsRenderCorrectly) { + Canvas canvas; + canvas.Scale(GetContentScale()); + Paint paint; + const int color_count = 3; + Color colors[color_count] = { + Color::Blue(), + Color::Green(), + Color::Crimson(), + }; + + paint.color = Color::White(); + canvas.DrawPaint(paint); + + int c_index = 0; + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { + paint.color = colors[(c_index++) % color_count]; + canvas.DrawRRect(Rect::MakeXYWH(i * 100 + 10, j * 100 + 20, 80, 80), + Size(i * 5 + 10, j * 5 + 10), paint); + } + } + + std::vector gradient_colors = { + Color{0x1f / 255.0, 0.0, 0x5c / 255.0, 1.0}, + Color{0x5b / 255.0, 0.0, 0x60 / 255.0, 1.0}, + Color{0x87 / 255.0, 0x01 / 255.0, 0x60 / 255.0, 1.0}, + Color{0xac / 255.0, 0x25 / 255.0, 0x53 / 255.0, 1.0}, + Color{0xe1 / 255.0, 0x6b / 255.0, 0x5c / 255.0, 1.0}, + Color{0xf3 / 255.0, 0x90 / 255.0, 0x60 / 255.0, 1.0}, + Color{0xff / 255.0, 0xb5 / 255.0, 0x6b / 250.0, 1.0}}; + std::vector stops = { + 0.0, + (1.0 / 6.0) * 1, + (1.0 / 6.0) * 2, + (1.0 / 6.0) * 3, + (1.0 / 6.0) * 4, + (1.0 / 6.0) * 5, + 1.0, + }; + auto texture = CreateTextureForFixture("airplane.jpg", + /*enable_mipmapping=*/true); + + paint.color = Color::White().WithAlpha(0.1); + + paint.color_source = ColorSource::MakeRadialGradient( + {500, 550}, 75, std::move(gradient_colors), std::move(stops), + Entity::TileMode::kMirror, {}); + for (int i = 1; i <= 10; i++) { + int j = 11 - i; + canvas.DrawRRect(Rect::MakeLTRB(500 - i * 20, 550 - j * 20, // + 500 + i * 20, 550 + j * 20), + Size(i * 10, j * 10), paint); + } + + paint.color_source = ColorSource::MakeImage( + texture, Entity::TileMode::kRepeat, Entity::TileMode::kRepeat, {}, + Matrix::MakeTranslation({500, 20})); + for (int i = 1; i <= 10; i++) { + int j = 11 - i; + canvas.DrawRRect(Rect::MakeLTRB(700 - i * 20, 220 - j * 20, // + 700 + i * 20, 220 + j * 20), + Size(i * 10, j * 10), paint); + } + + ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture())); +} + TEST_P(AiksTest, GradientStrokesRenderCorrectly) { // Compare with https://fiddle.skia.org/c/027392122bec8ac2b5d5de00a4b9bbe2 auto callback = [&](AiksContext& renderer) -> std::optional { @@ -4335,9 +4471,9 @@ TEST_P(AiksTest, GaussianBlurAtPeripheryVertical) { canvas.Scale(GetContentScale()); canvas.DrawRRect(Rect::MakeLTRB(0, 0, GetWindowSize().width, 100), - Point(10, 10), Paint{.color = Color::LimeGreen()}); + Size(10, 10), Paint{.color = Color::LimeGreen()}); canvas.DrawRRect(Rect::MakeLTRB(0, 110, GetWindowSize().width, 210), - Point(10, 10), Paint{.color = Color::Magenta()}); + Size(10, 10), Paint{.color = Color::Magenta()}); canvas.ClipRect(Rect::MakeLTRB(100, 0, 200, GetWindowSize().height)); canvas.SaveLayer({.blend_mode = BlendMode::kSource}, std::nullopt, ImageFilter::MakeBlur(Sigma(20.0), Sigma(20.0), @@ -4358,7 +4494,7 @@ TEST_P(AiksTest, GaussianBlurAtPeripheryHorizontal) { Rect::MakeXYWH(0, 0, boston->GetSize().width, boston->GetSize().height), Rect::MakeLTRB(0, 0, GetWindowSize().width, 100), Paint{}); canvas.DrawRRect(Rect::MakeLTRB(0, 110, GetWindowSize().width, 210), - Point(10, 10), Paint{.color = Color::Magenta()}); + Size(10, 10), Paint{.color = Color::Magenta()}); canvas.ClipRect(Rect::MakeLTRB(0, 50, GetWindowSize().width, 150)); canvas.SaveLayer({.blend_mode = BlendMode::kSource}, std::nullopt, ImageFilter::MakeBlur(Sigma(20.0), Sigma(20.0), diff --git a/impeller/aiks/canvas.cc b/impeller/aiks/canvas.cc index 221326aff4d82..a7b290fbb5d45 100644 --- a/impeller/aiks/canvas.cc +++ b/impeller/aiks/canvas.cc @@ -365,27 +365,31 @@ void Canvas::DrawOval(const Rect& rect, const Paint& paint) { GetCurrentPass().AddEntity(std::move(entity)); } -void Canvas::DrawRRect(Rect rect, Point corner_radii, const Paint& paint) { - if (corner_radii.x == corner_radii.y && - AttemptDrawBlurredRRect(rect, corner_radii.x, paint)) { +void Canvas::DrawRRect(const Rect& rect, + const Size& corner_radii, + const Paint& paint) { + if (corner_radii.IsSquare() && + AttemptDrawBlurredRRect(rect, corner_radii.width, paint)) { return; } - auto path = PathBuilder{} - .SetConvexity(Convexity::kConvex) - .AddRoundedRect(rect, corner_radii) - .SetBounds(rect) - .TakePath(); + if (paint.style == Paint::Style::kFill) { Entity entity; entity.SetTransform(GetCurrentTransform()); entity.SetClipDepth(GetClipDepth()); entity.SetBlendMode(paint.blend_mode); entity.SetContents(CreateContentsForGeometryWithFilters( - paint, Geometry::MakeFillPath(std::move(path)))); + paint, Geometry::MakeRoundRect(rect, corner_radii))); GetCurrentPass().AddEntity(std::move(entity)); return; } + + auto path = PathBuilder{} + .SetConvexity(Convexity::kConvex) + .AddRoundedRect(rect, corner_radii) + .SetBounds(rect) + .TakePath(); DrawPath(std::move(path), paint); } @@ -444,23 +448,34 @@ void Canvas::ClipRect(const Rect& rect, Entity::ClipOperation clip_op) { } } +void Canvas::ClipOval(const Rect& bounds, Entity::ClipOperation clip_op) { + auto geometry = Geometry::MakeOval(bounds); + auto& cull_rect = transform_stack_.back().cull_rect; + if (clip_op == Entity::ClipOperation::kIntersect && // + cull_rect.has_value() && // + geometry->CoversArea(transform_stack_.back().transform, *cull_rect) // + ) { + return; // This clip will do nothing, so skip it. + } + + ClipGeometry(geometry, clip_op); + switch (clip_op) { + case Entity::ClipOperation::kIntersect: + IntersectCulling(bounds); + break; + case Entity::ClipOperation::kDifference: + break; + } +} + void Canvas::ClipRRect(const Rect& rect, - Point corner_radii, + const Size& corner_radii, Entity::ClipOperation clip_op) { - auto path = PathBuilder{} - .SetConvexity(Convexity::kConvex) - .AddRoundedRect(rect, corner_radii) - .SetBounds(rect) - .TakePath(); - auto size = rect.GetSize(); // Does the rounded rect have a flat part on the top/bottom or left/right? - bool flat_on_TB = corner_radii.x * 2 < size.width; - bool flat_on_LR = corner_radii.y * 2 < size.height; - std::optional inner_rect = (flat_on_LR && flat_on_TB) - ? rect.Expand(-corner_radii) - : std::make_optional(); - auto geometry = Geometry::MakeFillPath(std::move(path), inner_rect); + bool flat_on_TB = corner_radii.width * 2 < size.width; + bool flat_on_LR = corner_radii.height * 2 < size.height; + auto geometry = Geometry::MakeRoundRect(rect, corner_radii); auto& cull_rect = transform_stack_.back().cull_rect; if (clip_op == Entity::ClipOperation::kIntersect && // cull_rect.has_value() && // @@ -475,7 +490,7 @@ void Canvas::ClipRRect(const Rect& rect, IntersectCulling(rect); break; case Entity::ClipOperation::kDifference: - if (corner_radii.x <= 0.0 || corner_radii.y <= 0) { + if (corner_radii.IsEmpty()) { SubtractCulling(rect); } else { // We subtract the inner "tall" and "wide" rectangle pieces @@ -484,10 +499,10 @@ void Canvas::ClipRRect(const Rect& rect, // Since this is a subtract operation, we can subtract each // rectangle piece individually without fear of interference. if (flat_on_TB) { - SubtractCulling(rect.Expand({-corner_radii.x, 0.0})); + SubtractCulling(rect.Expand(Size{-corner_radii.width, 0.0})); } if (flat_on_LR) { - SubtractCulling(rect.Expand({0.0, -corner_radii.y})); + SubtractCulling(rect.Expand(Size{0.0, -corner_radii.height})); } } break; diff --git a/impeller/aiks/canvas.h b/impeller/aiks/canvas.h index 70c85cb1ef74f..60aa128956a04 100644 --- a/impeller/aiks/canvas.h +++ b/impeller/aiks/canvas.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_AIKS_CANVAS_H_ +#define FLUTTER_IMPELLER_AIKS_CANVAS_H_ #include #include @@ -106,7 +107,9 @@ class Canvas { void DrawOval(const Rect& rect, const Paint& paint); - void DrawRRect(Rect rect, Point corner_radii, const Paint& paint); + void DrawRRect(const Rect& rect, + const Size& corner_radii, + const Paint& paint); void DrawCircle(const Point& center, Scalar radius, const Paint& paint); @@ -134,9 +137,13 @@ class Canvas { const Rect& rect, Entity::ClipOperation clip_op = Entity::ClipOperation::kIntersect); + void ClipOval( + const Rect& bounds, + Entity::ClipOperation clip_op = Entity::ClipOperation::kIntersect); + void ClipRRect( const Rect& rect, - Point corner_radii, + const Size& corner_radii, Entity::ClipOperation clip_op = Entity::ClipOperation::kIntersect); void DrawPicture(const Picture& picture); @@ -196,3 +203,5 @@ class Canvas { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_AIKS_CANVAS_H_ diff --git a/impeller/aiks/canvas_recorder.h b/impeller/aiks/canvas_recorder.h index 99ddf1dab4d97..4b75ef5f82934 100644 --- a/impeller/aiks/canvas_recorder.h +++ b/impeller/aiks/canvas_recorder.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_AIKS_CANVAS_RECORDER_H_ +#define FLUTTER_IMPELLER_AIKS_CANVAS_RECORDER_H_ #include @@ -195,7 +196,9 @@ class CanvasRecorder { paint); } - void DrawRRect(Rect rect, Point corner_radii, const Paint& paint) { + void DrawRRect(const Rect& rect, + const Size& corner_radii, + const Paint& paint) { return ExecuteAndSerialize(FLT_CANVAS_RECORDER_OP_ARG(DrawRRect), rect, corner_radii, paint); } @@ -248,7 +251,7 @@ class CanvasRecorder { void ClipRRect( const Rect& rect, - Point corner_radii, + const Size& corner_radii, Entity::ClipOperation clip_op = Entity::ClipOperation::kIntersect) { return ExecuteAndSerialize(FLT_CANVAS_RECORDER_OP_ARG(ClipRRect), rect, corner_radii, clip_op); @@ -301,3 +304,5 @@ class CanvasRecorder { #endif } // namespace impeller + +#endif // FLUTTER_IMPELLER_AIKS_CANVAS_RECORDER_H_ diff --git a/impeller/aiks/canvas_type.h b/impeller/aiks/canvas_type.h index a6992163a77ba..c9402c0526d27 100644 --- a/impeller/aiks/canvas_type.h +++ b/impeller/aiks/canvas_type.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_AIKS_CANVAS_TYPE_H_ +#define FLUTTER_IMPELLER_AIKS_CANVAS_TYPE_H_ #include "impeller/aiks/canvas.h" #include "impeller/aiks/canvas_recorder.h" @@ -20,3 +21,5 @@ using CanvasType = Canvas; #endif } // namespace impeller + +#endif // FLUTTER_IMPELLER_AIKS_CANVAS_TYPE_H_ diff --git a/impeller/aiks/color_filter.h b/impeller/aiks/color_filter.h index 84dfbbd19b40d..4ed24b81b10cb 100644 --- a/impeller/aiks/color_filter.h +++ b/impeller/aiks/color_filter.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_AIKS_COLOR_FILTER_H_ +#define FLUTTER_IMPELLER_AIKS_COLOR_FILTER_H_ #include "impeller/entity/contents/filters/color_filter_contents.h" #include "impeller/geometry/color.h" @@ -176,3 +177,5 @@ class ComposedColorFilter final : public ColorFilter { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_AIKS_COLOR_FILTER_H_ diff --git a/impeller/aiks/color_source.h b/impeller/aiks/color_source.h index 7849b841ec784..868362d99c48c 100644 --- a/impeller/aiks/color_source.h +++ b/impeller/aiks/color_source.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_AIKS_COLOR_SOURCE_H_ +#define FLUTTER_IMPELLER_AIKS_COLOR_SOURCE_H_ #include #include @@ -103,3 +104,5 @@ class ColorSource { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_AIKS_COLOR_SOURCE_H_ diff --git a/impeller/aiks/image.h b/impeller/aiks/image.h index 4011137b403e3..534506880b2d4 100644 --- a/impeller/aiks/image.h +++ b/impeller/aiks/image.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_AIKS_IMAGE_H_ +#define FLUTTER_IMPELLER_AIKS_IMAGE_H_ #include @@ -30,3 +31,5 @@ class Image { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_AIKS_IMAGE_H_ diff --git a/impeller/aiks/image_filter.h b/impeller/aiks/image_filter.h index e3e6908df515c..9d72c14d1a522 100644 --- a/impeller/aiks/image_filter.h +++ b/impeller/aiks/image_filter.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_AIKS_IMAGE_FILTER_H_ +#define FLUTTER_IMPELLER_AIKS_IMAGE_FILTER_H_ #include "impeller/aiks/color_filter.h" #include "impeller/core/sampler_descriptor.h" @@ -271,3 +272,5 @@ class LocalMatrixImageFilter : public ImageFilter { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_AIKS_IMAGE_FILTER_H_ diff --git a/impeller/aiks/paint.h b/impeller/aiks/paint.h index 68608d3dce175..126f152dba84c 100644 --- a/impeller/aiks/paint.h +++ b/impeller/aiks/paint.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_AIKS_PAINT_H_ +#define FLUTTER_IMPELLER_AIKS_PAINT_H_ #include @@ -106,3 +107,5 @@ struct Paint { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_AIKS_PAINT_H_ diff --git a/impeller/aiks/paint_pass_delegate.h b/impeller/aiks/paint_pass_delegate.h index c0154475ae0ef..6209f56bcd190 100644 --- a/impeller/aiks/paint_pass_delegate.h +++ b/impeller/aiks/paint_pass_delegate.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_AIKS_PAINT_PASS_DELEGATE_H_ +#define FLUTTER_IMPELLER_AIKS_PAINT_PASS_DELEGATE_H_ #include @@ -81,3 +82,5 @@ class OpacityPeepholePassDelegate final : public EntityPassDelegate { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_AIKS_PAINT_PASS_DELEGATE_H_ diff --git a/impeller/aiks/picture.h b/impeller/aiks/picture.h index f4e8a640efa9a..8419d203e972f 100644 --- a/impeller/aiks/picture.h +++ b/impeller/aiks/picture.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_AIKS_PICTURE_H_ +#define FLUTTER_IMPELLER_AIKS_PICTURE_H_ #include #include @@ -31,3 +32,5 @@ struct Picture { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_AIKS_PICTURE_H_ diff --git a/impeller/aiks/picture_recorder.h b/impeller/aiks/picture_recorder.h index 739792a2df1b5..ab561d437e87a 100644 --- a/impeller/aiks/picture_recorder.h +++ b/impeller/aiks/picture_recorder.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_AIKS_PICTURE_RECORDER_H_ +#define FLUTTER_IMPELLER_AIKS_PICTURE_RECORDER_H_ #include "flutter/fml/macros.h" #include "impeller/aiks/canvas.h" @@ -25,3 +26,5 @@ class PictureRecorder { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_AIKS_PICTURE_RECORDER_H_ diff --git a/impeller/aiks/testing/context_mock.h b/impeller/aiks/testing/context_mock.h index c80ade623d4fd..b2d9138503fbb 100644 --- a/impeller/aiks/testing/context_mock.h +++ b/impeller/aiks/testing/context_mock.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_AIKS_TESTING_CONTEXT_MOCK_H_ +#define FLUTTER_IMPELLER_AIKS_TESTING_CONTEXT_MOCK_H_ #include #include @@ -115,3 +116,5 @@ class ContextMock : public Context { } // namespace testing } // namespace impeller + +#endif // FLUTTER_IMPELLER_AIKS_TESTING_CONTEXT_MOCK_H_ diff --git a/impeller/aiks/testing/context_spy.h b/impeller/aiks/testing/context_spy.h index 9d32f2e136880..28a5ec3907ae4 100644 --- a/impeller/aiks/testing/context_spy.h +++ b/impeller/aiks/testing/context_spy.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_AIKS_TESTING_CONTEXT_SPY_H_ +#define FLUTTER_IMPELLER_AIKS_TESTING_CONTEXT_SPY_H_ #include #include "impeller/aiks/testing/context_mock.h" @@ -28,3 +29,5 @@ class ContextSpy : public std::enable_shared_from_this { } // namespace testing } // namespace impeller + +#endif // FLUTTER_IMPELLER_AIKS_TESTING_CONTEXT_SPY_H_ diff --git a/impeller/aiks/trace_serializer.h b/impeller/aiks/trace_serializer.h index 9232de504a375..bb6598a50fcfe 100644 --- a/impeller/aiks/trace_serializer.h +++ b/impeller/aiks/trace_serializer.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_AIKS_TRACE_SERIALIZER_H_ +#define FLUTTER_IMPELLER_AIKS_TRACE_SERIALIZER_H_ #include #include "impeller/aiks/canvas_recorder.h" @@ -62,3 +63,5 @@ class TraceSerializer { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_AIKS_TRACE_SERIALIZER_H_ diff --git a/impeller/archivist/archivable.h b/impeller/archivist/archivable.h index 41c296301d20a..9a7bdba6d2b4f 100644 --- a/impeller/archivist/archivable.h +++ b/impeller/archivist/archivable.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ARCHIVIST_ARCHIVABLE_H_ +#define FLUTTER_IMPELLER_ARCHIVIST_ARCHIVABLE_H_ #include #include @@ -36,3 +37,5 @@ class Archivable { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ARCHIVIST_ARCHIVABLE_H_ diff --git a/impeller/archivist/archive.h b/impeller/archivist/archive.h index 33c3f66988034..753e60beb12ac 100644 --- a/impeller/archivist/archive.h +++ b/impeller/archivist/archive.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ARCHIVIST_ARCHIVE_H_ +#define FLUTTER_IMPELLER_ARCHIVIST_ARCHIVE_H_ #include #include @@ -72,3 +73,5 @@ class Archive { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ARCHIVIST_ARCHIVE_H_ diff --git a/impeller/archivist/archive_class_registration.h b/impeller/archivist/archive_class_registration.h index 6fc5710427043..7de79d35d505c 100644 --- a/impeller/archivist/archive_class_registration.h +++ b/impeller/archivist/archive_class_registration.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ARCHIVIST_ARCHIVE_CLASS_REGISTRATION_H_ +#define FLUTTER_IMPELLER_ARCHIVIST_ARCHIVE_CLASS_REGISTRATION_H_ #include #include @@ -49,3 +50,5 @@ class ArchiveClassRegistration { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ARCHIVIST_ARCHIVE_CLASS_REGISTRATION_H_ diff --git a/impeller/archivist/archive_database.h b/impeller/archivist/archive_database.h index e8376fc370190..c3f85196daec3 100644 --- a/impeller/archivist/archive_database.h +++ b/impeller/archivist/archive_database.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ARCHIVIST_ARCHIVE_DATABASE_H_ +#define FLUTTER_IMPELLER_ARCHIVIST_ARCHIVE_DATABASE_H_ #include #include @@ -53,3 +54,5 @@ class ArchiveDatabase { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ARCHIVIST_ARCHIVE_DATABASE_H_ diff --git a/impeller/archivist/archive_location.h b/impeller/archivist/archive_location.h index 6b773274ad44c..9df52ab40062d 100644 --- a/impeller/archivist/archive_location.h +++ b/impeller/archivist/archive_location.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ARCHIVIST_ARCHIVE_LOCATION_H_ +#define FLUTTER_IMPELLER_ARCHIVIST_ARCHIVE_LOCATION_H_ #include #include @@ -171,3 +172,5 @@ class ArchiveLocation { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ARCHIVIST_ARCHIVE_LOCATION_H_ diff --git a/impeller/archivist/archive_statement.h b/impeller/archivist/archive_statement.h index a5de60f865bc3..09e002afe7528 100644 --- a/impeller/archivist/archive_statement.h +++ b/impeller/archivist/archive_statement.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ARCHIVIST_ARCHIVE_STATEMENT_H_ +#define FLUTTER_IMPELLER_ARCHIVIST_ARCHIVE_STATEMENT_H_ #include #include @@ -95,3 +96,5 @@ class ArchiveStatement { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ARCHIVIST_ARCHIVE_STATEMENT_H_ diff --git a/impeller/archivist/archive_transaction.h b/impeller/archivist/archive_transaction.h index 671074cb1546e..1b95b37721a10 100644 --- a/impeller/archivist/archive_transaction.h +++ b/impeller/archivist/archive_transaction.h @@ -1,7 +1,8 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ARCHIVIST_ARCHIVE_TRANSACTION_H_ +#define FLUTTER_IMPELLER_ARCHIVIST_ARCHIVE_TRANSACTION_H_ #include @@ -47,3 +48,5 @@ class ArchiveTransaction { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ARCHIVIST_ARCHIVE_TRANSACTION_H_ diff --git a/impeller/archivist/archive_vector.h b/impeller/archivist/archive_vector.h index 2db657a68375d..34600cee92317 100644 --- a/impeller/archivist/archive_vector.h +++ b/impeller/archivist/archive_vector.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ARCHIVIST_ARCHIVE_VECTOR_H_ +#define FLUTTER_IMPELLER_ARCHIVIST_ARCHIVE_VECTOR_H_ #include "impeller/archivist/archive.h" @@ -35,3 +36,5 @@ class ArchiveVector : public Archivable { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ARCHIVIST_ARCHIVE_VECTOR_H_ diff --git a/impeller/archivist/archivist_fixture.h b/impeller/archivist/archivist_fixture.h index b31abd3eec963..fa90d0bdff404 100644 --- a/impeller/archivist/archivist_fixture.h +++ b/impeller/archivist/archivist_fixture.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ARCHIVIST_ARCHIVIST_FIXTURE_H_ +#define FLUTTER_IMPELLER_ARCHIVIST_ARCHIVIST_FIXTURE_H_ #include "flutter/fml/macros.h" #include "flutter/testing/testing.h" @@ -36,3 +37,5 @@ class ArchivistFixture : public ::testing::Test { } // namespace testing } // namespace impeller + +#endif // FLUTTER_IMPELLER_ARCHIVIST_ARCHIVIST_FIXTURE_H_ diff --git a/impeller/base/allocation.h b/impeller/base/allocation.h index a32d97bc0faf6..dd1b06befa6fe 100644 --- a/impeller/base/allocation.h +++ b/impeller/base/allocation.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_BASE_ALLOCATION_H_ +#define FLUTTER_IMPELLER_BASE_ALLOCATION_H_ #include #include @@ -54,3 +55,5 @@ std::shared_ptr CreateMappingWithString( std::shared_ptr CreateMappingWithString(std::string string); } // namespace impeller + +#endif // FLUTTER_IMPELLER_BASE_ALLOCATION_H_ diff --git a/impeller/base/backend_cast.h b/impeller/base/backend_cast.h index c3044bb2ac71c..71e2331cd4575 100644 --- a/impeller/base/backend_cast.h +++ b/impeller/base/backend_cast.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_BASE_BACKEND_CAST_H_ +#define FLUTTER_IMPELLER_BASE_BACKEND_CAST_H_ #include "flutter/fml/macros.h" @@ -25,3 +26,5 @@ class BackendCast { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_BASE_BACKEND_CAST_H_ diff --git a/impeller/base/comparable.h b/impeller/base/comparable.h index 08780f75c5e66..2f0c6e1e6513f 100644 --- a/impeller/base/comparable.h +++ b/impeller/base/comparable.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_BASE_COMPARABLE_H_ +#define FLUTTER_IMPELLER_BASE_COMPARABLE_H_ #include #include @@ -109,3 +110,5 @@ struct less { }; } // namespace std + +#endif // FLUTTER_IMPELLER_BASE_COMPARABLE_H_ diff --git a/impeller/base/config.h b/impeller/base/config.h index 610661a48db33..06c91869402d7 100644 --- a/impeller/base/config.h +++ b/impeller/base/config.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_BASE_CONFIG_H_ +#define FLUTTER_IMPELLER_BASE_CONFIG_H_ #include @@ -35,3 +36,5 @@ namespace impeller { } } // namespace impeller + +#endif // FLUTTER_IMPELLER_BASE_CONFIG_H_ diff --git a/impeller/base/promise.h b/impeller/base/promise.h index 04b0cc962bd60..30d45ae4d3f5f 100644 --- a/impeller/base/promise.h +++ b/impeller/base/promise.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_BASE_PROMISE_H_ +#define FLUTTER_IMPELLER_BASE_PROMISE_H_ #include @@ -17,3 +18,5 @@ std::future RealizedFuture(T t) { } } // namespace impeller + +#endif // FLUTTER_IMPELLER_BASE_PROMISE_H_ diff --git a/impeller/base/strings.h b/impeller/base/strings.h index 085bb1263d823..cefe10343eb0e 100644 --- a/impeller/base/strings.h +++ b/impeller/base/strings.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_BASE_STRINGS_H_ +#define FLUTTER_IMPELLER_BASE_STRINGS_H_ #include @@ -20,3 +21,5 @@ bool HasSuffix(const std::string& string, const std::string& suffix); std::string StripPrefix(const std::string& string, const std::string& to_strip); } // namespace impeller + +#endif // FLUTTER_IMPELLER_BASE_STRINGS_H_ diff --git a/impeller/base/thread.h b/impeller/base/thread.h index d6b03573a2631..c9f3fcb24548d 100644 --- a/impeller/base/thread.h +++ b/impeller/base/thread.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_BASE_THREAD_H_ +#define FLUTTER_IMPELLER_BASE_THREAD_H_ #include #include @@ -268,3 +269,5 @@ class ConditionVariable { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_BASE_THREAD_H_ diff --git a/impeller/base/thread_safety.h b/impeller/base/thread_safety.h index 8d1f0aa02ccf2..da1aed3b5e7a5 100644 --- a/impeller/base/thread_safety.h +++ b/impeller/base/thread_safety.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_BASE_THREAD_SAFETY_H_ +#define FLUTTER_IMPELLER_BASE_THREAD_SAFETY_H_ #if defined(__clang__) #define IPLR_THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x)) @@ -67,3 +68,5 @@ #define IPLR_NO_THREAD_SAFETY_ANALYSIS \ IPLR_THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis) + +#endif // FLUTTER_IMPELLER_BASE_THREAD_SAFETY_H_ diff --git a/impeller/base/timing.h b/impeller/base/timing.h index 1496fd9eb9503..86ac48ceba327 100644 --- a/impeller/base/timing.h +++ b/impeller/base/timing.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_BASE_TIMING_H_ +#define FLUTTER_IMPELLER_BASE_TIMING_H_ #include @@ -14,3 +15,5 @@ using Clock = std::chrono::high_resolution_clock; using TimePoint = std::chrono::time_point; } // namespace impeller + +#endif // FLUTTER_IMPELLER_BASE_TIMING_H_ diff --git a/impeller/base/validation.h b/impeller/base/validation.h index 1e7671adaa0ba..50ebd0c440247 100644 --- a/impeller/base/validation.h +++ b/impeller/base/validation.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_BASE_VALIDATION_H_ +#define FLUTTER_IMPELLER_BASE_VALIDATION_H_ #ifndef IMPELLER_ENABLE_VALIDATION #ifdef IMPELLER_DEBUG @@ -64,3 +65,5 @@ struct ScopedValidationDisable { /// happens in test environments. /// #define VALIDATION_LOG ::impeller::ValidationLog{}.GetStream() + +#endif // FLUTTER_IMPELLER_BASE_VALIDATION_H_ diff --git a/impeller/base/version.h b/impeller/base/version.h index 423e56272cf27..06e03ad394787 100644 --- a/impeller/base/version.h +++ b/impeller/base/version.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_BASE_VERSION_H_ +#define FLUTTER_IMPELLER_BASE_VERSION_H_ #include #include @@ -37,3 +38,5 @@ struct Version { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_BASE_VERSION_H_ diff --git a/impeller/compiler/compiler.h b/impeller/compiler/compiler.h index 32f9676743c29..8447983005562 100644 --- a/impeller/compiler/compiler.h +++ b/impeller/compiler/compiler.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_COMPILER_COMPILER_H_ +#define FLUTTER_IMPELLER_COMPILER_COMPILER_H_ #include #include @@ -64,3 +65,5 @@ class Compiler { } // namespace compiler } // namespace impeller + +#endif // FLUTTER_IMPELLER_COMPILER_COMPILER_H_ diff --git a/impeller/compiler/compiler_backend.h b/impeller/compiler/compiler_backend.h index ea278014398b1..4b2aabd0e00a3 100644 --- a/impeller/compiler/compiler_backend.h +++ b/impeller/compiler/compiler_backend.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_COMPILER_COMPILER_BACKEND_H_ +#define FLUTTER_IMPELLER_COMPILER_COMPILER_BACKEND_H_ #include #include @@ -71,3 +72,5 @@ struct CompilerBackend { } // namespace compiler } // namespace impeller + +#endif // FLUTTER_IMPELLER_COMPILER_COMPILER_BACKEND_H_ diff --git a/impeller/compiler/compiler_test.h b/impeller/compiler/compiler_test.h index 0f3c5f08c7921..fdee8a598e80e 100644 --- a/impeller/compiler/compiler_test.h +++ b/impeller/compiler/compiler_test.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_COMPILER_COMPILER_TEST_H_ +#define FLUTTER_IMPELLER_COMPILER_COMPILER_TEST_H_ #include "flutter/fml/macros.h" #include "flutter/testing/testing.h" @@ -45,3 +46,5 @@ class CompilerTest : public ::testing::TestWithParam { } // namespace testing } // namespace compiler } // namespace impeller + +#endif // FLUTTER_IMPELLER_COMPILER_COMPILER_TEST_H_ diff --git a/impeller/compiler/constants.h b/impeller/compiler/constants.h index c31005b8339ce..958a643aca542 100644 --- a/impeller/compiler/constants.h +++ b/impeller/compiler/constants.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_COMPILER_CONSTANTS_H_ +#define FLUTTER_IMPELLER_COMPILER_CONSTANTS_H_ namespace impeller { namespace compiler { @@ -11,3 +12,5 @@ constexpr char kExternalTexturePrefix[] = "SAMPLER_EXTERNAL_OES_"; } // namespace compiler } // namespace impeller + +#endif // FLUTTER_IMPELLER_COMPILER_CONSTANTS_H_ diff --git a/impeller/compiler/include_dir.h b/impeller/compiler/include_dir.h index 0c7927a47ffef..2a40dd0e36973 100644 --- a/impeller/compiler/include_dir.h +++ b/impeller/compiler/include_dir.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_COMPILER_INCLUDE_DIR_H_ +#define FLUTTER_IMPELLER_COMPILER_INCLUDE_DIR_H_ #include #include @@ -19,3 +20,5 @@ struct IncludeDir { } // namespace compiler } // namespace impeller + +#endif // FLUTTER_IMPELLER_COMPILER_INCLUDE_DIR_H_ diff --git a/impeller/compiler/includer.h b/impeller/compiler/includer.h index a3af915317ade..70123148006e2 100644 --- a/impeller/compiler/includer.h +++ b/impeller/compiler/includer.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_COMPILER_INCLUDER_H_ +#define FLUTTER_IMPELLER_COMPILER_INCLUDER_H_ #include @@ -58,3 +59,5 @@ class Includer final : public shaderc::CompileOptions::IncluderInterface { } // namespace compiler } // namespace impeller + +#endif // FLUTTER_IMPELLER_COMPILER_INCLUDER_H_ diff --git a/impeller/compiler/logger.h b/impeller/compiler/logger.h index d96de575ba390..11232d83a8449 100644 --- a/impeller/compiler/logger.h +++ b/impeller/compiler/logger.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_COMPILER_LOGGER_H_ +#define FLUTTER_IMPELLER_COMPILER_LOGGER_H_ #include #include @@ -43,3 +44,5 @@ class AutoLogger { } // namespace compiler } // namespace impeller + +#endif // FLUTTER_IMPELLER_COMPILER_LOGGER_H_ diff --git a/impeller/compiler/reflector.h b/impeller/compiler/reflector.h index bb1572793f1d4..981f004dfecd2 100644 --- a/impeller/compiler/reflector.h +++ b/impeller/compiler/reflector.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_COMPILER_REFLECTOR_H_ +#define FLUTTER_IMPELLER_COMPILER_REFLECTOR_H_ #include #include @@ -177,3 +178,5 @@ class Reflector { } // namespace compiler } // namespace impeller + +#endif // FLUTTER_IMPELLER_COMPILER_REFLECTOR_H_ diff --git a/impeller/compiler/runtime_stage_data.h b/impeller/compiler/runtime_stage_data.h index 45e3476fc84f5..0e650d6b98ac3 100644 --- a/impeller/compiler/runtime_stage_data.h +++ b/impeller/compiler/runtime_stage_data.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_COMPILER_RUNTIME_STAGE_DATA_H_ +#define FLUTTER_IMPELLER_COMPILER_RUNTIME_STAGE_DATA_H_ #include #include @@ -58,3 +59,5 @@ class RuntimeStageData { } // namespace compiler } // namespace impeller + +#endif // FLUTTER_IMPELLER_COMPILER_RUNTIME_STAGE_DATA_H_ diff --git a/impeller/compiler/source_options.h b/impeller/compiler/source_options.h index 5c9983284d738..89011f7158892 100644 --- a/impeller/compiler/source_options.h +++ b/impeller/compiler/source_options.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_COMPILER_SOURCE_OPTIONS_H_ +#define FLUTTER_IMPELLER_COMPILER_SOURCE_OPTIONS_H_ #include #include @@ -48,3 +49,5 @@ struct SourceOptions { } // namespace compiler } // namespace impeller + +#endif // FLUTTER_IMPELLER_COMPILER_SOURCE_OPTIONS_H_ diff --git a/impeller/compiler/spirv_compiler.h b/impeller/compiler/spirv_compiler.h index c688cd2b46a75..9f6463d4de542 100644 --- a/impeller/compiler/spirv_compiler.h +++ b/impeller/compiler/spirv_compiler.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_COMPILER_SPIRV_COMPILER_H_ +#define FLUTTER_IMPELLER_COMPILER_SPIRV_COMPILER_H_ #include #include @@ -75,3 +76,5 @@ class SPIRVCompiler { } // namespace compiler } // namespace impeller + +#endif // FLUTTER_IMPELLER_COMPILER_SPIRV_COMPILER_H_ diff --git a/impeller/compiler/spirv_sksl.h b/impeller/compiler/spirv_sksl.h index 8e4879d02e2f7..8b1a1b869536d 100644 --- a/impeller/compiler/spirv_sksl.h +++ b/impeller/compiler/spirv_sksl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_COMPILER_SPIRV_SKSL_H_ +#define FLUTTER_IMPELLER_COMPILER_SPIRV_SKSL_H_ #include #include @@ -78,3 +79,5 @@ class CompilerSkSL : public spirv_cross::CompilerGLSL { } // namespace compiler } // namespace impeller + +#endif // FLUTTER_IMPELLER_COMPILER_SPIRV_SKSL_H_ diff --git a/impeller/compiler/switches.h b/impeller/compiler/switches.h index c02e344fa4a88..1c6a561191400 100644 --- a/impeller/compiler/switches.h +++ b/impeller/compiler/switches.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_COMPILER_SWITCHES_H_ +#define FLUTTER_IMPELLER_COMPILER_SWITCHES_H_ #include #include @@ -52,3 +53,5 @@ struct Switches { } // namespace compiler } // namespace impeller + +#endif // FLUTTER_IMPELLER_COMPILER_SWITCHES_H_ diff --git a/impeller/compiler/types.h b/impeller/compiler/types.h index 0af2a5c403352..5b55e7a9589b4 100644 --- a/impeller/compiler/types.h +++ b/impeller/compiler/types.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_COMPILER_TYPES_H_ +#define FLUTTER_IMPELLER_COMPILER_TYPES_H_ #include #include @@ -79,3 +80,5 @@ spirv_cross::CompilerMSL::Options::Platform TargetPlatformToMSLPlatform( } // namespace compiler } // namespace impeller + +#endif // FLUTTER_IMPELLER_COMPILER_TYPES_H_ diff --git a/impeller/compiler/uniform_sorter.h b/impeller/compiler/uniform_sorter.h index 5279aaecb6cf5..3493f60b38b33 100644 --- a/impeller/compiler/uniform_sorter.h +++ b/impeller/compiler/uniform_sorter.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_COMPILER_UNIFORM_SORTER_H_ +#define FLUTTER_IMPELLER_COMPILER_UNIFORM_SORTER_H_ #include @@ -25,3 +26,5 @@ std::vector SortUniforms( bool include = true); } // namespace impeller + +#endif // FLUTTER_IMPELLER_COMPILER_UNIFORM_SORTER_H_ diff --git a/impeller/compiler/utilities.h b/impeller/compiler/utilities.h index d1d27436ac08e..dbbd53d440840 100644 --- a/impeller/compiler/utilities.h +++ b/impeller/compiler/utilities.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_COMPILER_UTILITIES_H_ +#define FLUTTER_IMPELLER_COMPILER_UTILITIES_H_ #include #include @@ -31,3 +32,5 @@ bool StringStartsWith(const std::string& target, const std::string& prefix); } // namespace compiler } // namespace impeller + +#endif // FLUTTER_IMPELLER_COMPILER_UTILITIES_H_ diff --git a/impeller/core/allocator.h b/impeller/core/allocator.h index 07c1c93bf69ea..adcbc656703eb 100644 --- a/impeller/core/allocator.h +++ b/impeller/core/allocator.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_CORE_ALLOCATOR_H_ +#define FLUTTER_IMPELLER_CORE_ALLOCATOR_H_ #include "flutter/fml/mapping.h" #include "impeller/core/device_buffer_descriptor.h" @@ -63,3 +64,5 @@ class Allocator { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_CORE_ALLOCATOR_H_ diff --git a/impeller/core/buffer.h b/impeller/core/buffer.h index d29e32e1be70b..0664f1afc53b3 100644 --- a/impeller/core/buffer.h +++ b/impeller/core/buffer.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_CORE_BUFFER_H_ +#define FLUTTER_IMPELLER_CORE_BUFFER_H_ #include @@ -20,3 +21,5 @@ class Buffer { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_CORE_BUFFER_H_ diff --git a/impeller/core/buffer_view.h b/impeller/core/buffer_view.h index 1a272a8b29fcd..551bb0b625e58 100644 --- a/impeller/core/buffer_view.h +++ b/impeller/core/buffer_view.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_CORE_BUFFER_VIEW_H_ +#define FLUTTER_IMPELLER_CORE_BUFFER_VIEW_H_ #include "impeller/core/buffer.h" #include "impeller/core/range.h" @@ -18,3 +19,5 @@ struct BufferView { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_CORE_BUFFER_VIEW_H_ diff --git a/impeller/core/capture.h b/impeller/core/capture.h index 5f41321c2cb0d..9e5c0d9318417 100644 --- a/impeller/core/capture.h +++ b/impeller/core/capture.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_CORE_CAPTURE_H_ +#define FLUTTER_IMPELLER_CORE_CAPTURE_H_ #include #include @@ -295,3 +296,5 @@ class CaptureContext { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_CORE_CAPTURE_H_ diff --git a/impeller/core/device_buffer.h b/impeller/core/device_buffer.h index ac0d454df28c2..c3ed289922d30 100644 --- a/impeller/core/device_buffer.h +++ b/impeller/core/device_buffer.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_CORE_DEVICE_BUFFER_H_ +#define FLUTTER_IMPELLER_CORE_DEVICE_BUFFER_H_ #include #include @@ -60,3 +61,5 @@ class DeviceBuffer : public Buffer, }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_CORE_DEVICE_BUFFER_H_ diff --git a/impeller/core/device_buffer_descriptor.h b/impeller/core/device_buffer_descriptor.h index 976b8f7b0acac..d1bf458942273 100644 --- a/impeller/core/device_buffer_descriptor.h +++ b/impeller/core/device_buffer_descriptor.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_CORE_DEVICE_BUFFER_DESCRIPTOR_H_ +#define FLUTTER_IMPELLER_CORE_DEVICE_BUFFER_DESCRIPTOR_H_ #include @@ -16,3 +17,5 @@ struct DeviceBufferDescriptor { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_CORE_DEVICE_BUFFER_DESCRIPTOR_H_ diff --git a/impeller/core/formats.h b/impeller/core/formats.h index 071fc3c88457a..5d5d64299f2c4 100644 --- a/impeller/core/formats.h +++ b/impeller/core/formats.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_CORE_FORMATS_H_ +#define FLUTTER_IMPELLER_CORE_FORMATS_H_ #include #include @@ -679,3 +680,5 @@ struct hash { }; } // namespace std + +#endif // FLUTTER_IMPELLER_CORE_FORMATS_H_ diff --git a/impeller/core/host_buffer.h b/impeller/core/host_buffer.h index 58d5f111b530e..5c3a69c75dcbf 100644 --- a/impeller/core/host_buffer.h +++ b/impeller/core/host_buffer.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_CORE_HOST_BUFFER_H_ +#define FLUTTER_IMPELLER_CORE_HOST_BUFFER_H_ #include #include @@ -162,3 +163,5 @@ class HostBuffer final : public Buffer { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_CORE_HOST_BUFFER_H_ diff --git a/impeller/core/platform.h b/impeller/core/platform.h index 417a0f90c1a4d..824738c02d8a7 100644 --- a/impeller/core/platform.h +++ b/impeller/core/platform.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_CORE_PLATFORM_H_ +#define FLUTTER_IMPELLER_CORE_PLATFORM_H_ #include @@ -20,3 +21,5 @@ constexpr size_t DefaultUniformAlignment() { } } // namespace impeller + +#endif // FLUTTER_IMPELLER_CORE_PLATFORM_H_ diff --git a/impeller/core/range.h b/impeller/core/range.h index e1a28878136ce..d0971725c6928 100644 --- a/impeller/core/range.h +++ b/impeller/core/range.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_CORE_RANGE_H_ +#define FLUTTER_IMPELLER_CORE_RANGE_H_ #include @@ -25,3 +26,5 @@ struct Range { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_CORE_RANGE_H_ diff --git a/impeller/core/resource_binder.h b/impeller/core/resource_binder.h index a3bbb532f9522..6a6172710d700 100644 --- a/impeller/core/resource_binder.h +++ b/impeller/core/resource_binder.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_CORE_RESOURCE_BINDER_H_ +#define FLUTTER_IMPELLER_CORE_RESOURCE_BINDER_H_ #include @@ -35,3 +36,5 @@ struct ResourceBinder { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_CORE_RESOURCE_BINDER_H_ diff --git a/impeller/core/runtime_types.h b/impeller/core/runtime_types.h index 67d66e978425e..4fb210d728ebf 100644 --- a/impeller/core/runtime_types.h +++ b/impeller/core/runtime_types.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_CORE_RUNTIME_TYPES_H_ +#define FLUTTER_IMPELLER_CORE_RUNTIME_TYPES_H_ #include #include @@ -50,3 +51,5 @@ struct RuntimeUniformDescription { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_CORE_RUNTIME_TYPES_H_ diff --git a/impeller/core/sampler.h b/impeller/core/sampler.h index afc3968c4cc23..0c06ad17d3a3c 100644 --- a/impeller/core/sampler.h +++ b/impeller/core/sampler.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_CORE_SAMPLER_H_ +#define FLUTTER_IMPELLER_CORE_SAMPLER_H_ #include @@ -36,3 +37,5 @@ using SamplerMap = std::unordered_map>; } // namespace impeller + +#endif // FLUTTER_IMPELLER_CORE_SAMPLER_H_ diff --git a/impeller/core/sampler_descriptor.h b/impeller/core/sampler_descriptor.h index 45163b1cc2bdc..0e92745ec311f 100644 --- a/impeller/core/sampler_descriptor.h +++ b/impeller/core/sampler_descriptor.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_CORE_SAMPLER_DESCRIPTOR_H_ +#define FLUTTER_IMPELLER_CORE_SAMPLER_DESCRIPTOR_H_ #include "impeller/base/comparable.h" #include "impeller/core/formats.h" @@ -47,3 +48,5 @@ struct SamplerDescriptor final : public Comparable { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_CORE_SAMPLER_DESCRIPTOR_H_ diff --git a/impeller/core/shader_types.h b/impeller/core/shader_types.h index 83fd120baf7ba..8b267dbe48e28 100644 --- a/impeller/core/shader_types.h +++ b/impeller/core/shader_types.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_CORE_SHADER_TYPES_H_ +#define FLUTTER_IMPELLER_CORE_SHADER_TYPES_H_ #include #include @@ -185,3 +186,5 @@ inline constexpr Vector4 ToVector(Color color) { } } // namespace impeller + +#endif // FLUTTER_IMPELLER_CORE_SHADER_TYPES_H_ diff --git a/impeller/core/texture.h b/impeller/core/texture.h index 8c6e3238b6448..b28dbb27ab5f3 100644 --- a/impeller/core/texture.h +++ b/impeller/core/texture.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_CORE_TEXTURE_H_ +#define FLUTTER_IMPELLER_CORE_TEXTURE_H_ #include @@ -73,3 +74,5 @@ class Texture { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_CORE_TEXTURE_H_ diff --git a/impeller/core/texture_descriptor.h b/impeller/core/texture_descriptor.h index e168895c673f4..8c1868f3ce1e0 100644 --- a/impeller/core/texture_descriptor.h +++ b/impeller/core/texture_descriptor.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_CORE_TEXTURE_DESCRIPTOR_H_ +#define FLUTTER_IMPELLER_CORE_TEXTURE_DESCRIPTOR_H_ #include "impeller/core/formats.h" #include "impeller/geometry/size.h" @@ -89,3 +90,5 @@ struct TextureDescriptor { std::string TextureDescriptorToString(const TextureDescriptor& desc); } // namespace impeller + +#endif // FLUTTER_IMPELLER_CORE_TEXTURE_DESCRIPTOR_H_ diff --git a/impeller/core/vertex_buffer.h b/impeller/core/vertex_buffer.h index 7beac43d3c9b0..b88654ce9e552 100644 --- a/impeller/core/vertex_buffer.h +++ b/impeller/core/vertex_buffer.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_CORE_VERTEX_BUFFER_H_ +#define FLUTTER_IMPELLER_CORE_VERTEX_BUFFER_H_ #include "impeller/core/buffer_view.h" #include "impeller/core/formats.h" @@ -34,3 +35,5 @@ struct VertexBuffer { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_CORE_VERTEX_BUFFER_H_ diff --git a/impeller/display_list/dl_dispatcher.cc b/impeller/display_list/dl_dispatcher.cc index 465b71f49cf26..dca79aba9ee85 100644 --- a/impeller/display_list/dl_dispatcher.cc +++ b/impeller/display_list/dl_dispatcher.cc @@ -725,22 +725,40 @@ void DlDispatcher::clipRect(const SkRect& rect, ClipOp clip_op, bool is_aa) { } // |flutter::DlOpReceiver| -void DlDispatcher::clipRRect(const SkRRect& rrect, ClipOp clip_op, bool is_aa) { +void DlDispatcher::clipRRect(const SkRRect& rrect, ClipOp sk_op, bool is_aa) { + auto clip_op = ToClipOperation(sk_op); if (rrect.isRect()) { - canvas_.ClipRect(skia_conversions::ToRect(rrect.rect()), - ToClipOperation(clip_op)); + canvas_.ClipRect(skia_conversions::ToRect(rrect.rect()), clip_op); + } else if (rrect.isOval()) { + canvas_.ClipOval(skia_conversions::ToRect(rrect.rect()), clip_op); } else if (rrect.isSimple()) { canvas_.ClipRRect(skia_conversions::ToRect(rrect.rect()), - skia_conversions::ToPoint(rrect.getSimpleRadii()), - ToClipOperation(clip_op)); + skia_conversions::ToSize(rrect.getSimpleRadii()), + clip_op); } else { - canvas_.ClipPath(skia_conversions::ToPath(rrect), ToClipOperation(clip_op)); + canvas_.ClipPath(skia_conversions::ToPath(rrect), clip_op); } } // |flutter::DlOpReceiver| -void DlDispatcher::clipPath(const SkPath& path, ClipOp clip_op, bool is_aa) { - canvas_.ClipPath(skia_conversions::ToPath(path), ToClipOperation(clip_op)); +void DlDispatcher::clipPath(const SkPath& path, ClipOp sk_op, bool is_aa) { + auto clip_op = ToClipOperation(sk_op); + + SkRect rect; + if (path.isRect(&rect)) { + canvas_.ClipRect(skia_conversions::ToRect(rect), clip_op); + } else if (path.isOval(&rect)) { + canvas_.ClipOval(skia_conversions::ToRect(rect), clip_op); + } else { + SkRRect rrect; + if (path.isRRect(&rrect) && rrect.isSimple()) { + canvas_.ClipRRect(skia_conversions::ToRect(rrect.rect()), + skia_conversions::ToSize(rrect.getSimpleRadii()), + clip_op); + } else { + canvas_.ClipPath(skia_conversions::ToPath(path), clip_op); + } + } } // |flutter::DlOpReceiver| @@ -782,8 +800,7 @@ void DlDispatcher::drawCircle(const SkPoint& center, SkScalar radius) { void DlDispatcher::drawRRect(const SkRRect& rrect) { if (rrect.isSimple()) { canvas_.DrawRRect(skia_conversions::ToRect(rrect.rect()), - skia_conversions::ToPoint(rrect.getSimpleRadii()), - paint_); + skia_conversions::ToSize(rrect.getSimpleRadii()), paint_); } else { canvas_.DrawPath(skia_conversions::ToPath(rrect), paint_); } @@ -817,7 +834,7 @@ void DlDispatcher::SimplifyOrDrawPath(CanvasType& canvas, SkRRect rrect; if (path.isRRect(&rrect) && rrect.isSimple()) { canvas.DrawRRect(skia_conversions::ToRect(rrect.rect()), - skia_conversions::ToPoint(rrect.getSimpleRadii()), paint); + skia_conversions::ToSize(rrect.getSimpleRadii()), paint); return; } diff --git a/impeller/display_list/dl_dispatcher.h b/impeller/display_list/dl_dispatcher.h index 10ed7fc6104e5..a0a1fcfb8d3ad 100644 --- a/impeller/display_list/dl_dispatcher.h +++ b/impeller/display_list/dl_dispatcher.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_DISPLAY_LIST_DL_DISPATCHER_H_ +#define FLUTTER_IMPELLER_DISPLAY_LIST_DL_DISPATCHER_H_ #include "flutter/display_list/dl_op_receiver.h" #include "impeller/aiks/canvas_type.h" @@ -235,3 +236,5 @@ class DlDispatcher final : public flutter::DlOpReceiver { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_DISPLAY_LIST_DL_DISPATCHER_H_ diff --git a/impeller/display_list/dl_image_impeller.h b/impeller/display_list/dl_image_impeller.h index 8f9e51443b00e..920c21fc8f138 100644 --- a/impeller/display_list/dl_image_impeller.h +++ b/impeller/display_list/dl_image_impeller.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_DISPLAY_LIST_DL_IMAGE_IMPELLER_H_ +#define FLUTTER_IMPELLER_DISPLAY_LIST_DL_IMAGE_IMPELLER_H_ #include "flutter/display_list/image/dl_image.h" #include "impeller/core/texture.h" @@ -63,3 +64,5 @@ class DlImageImpeller final : public flutter::DlImage { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_DISPLAY_LIST_DL_IMAGE_IMPELLER_H_ diff --git a/impeller/display_list/dl_playground.h b/impeller/display_list/dl_playground.h index 7b47c3643750d..b49b1a556e156 100644 --- a/impeller/display_list/dl_playground.h +++ b/impeller/display_list/dl_playground.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_DISPLAY_LIST_DL_PLAYGROUND_H_ +#define FLUTTER_IMPELLER_DISPLAY_LIST_DL_PLAYGROUND_H_ #include "flutter/display_list/display_list.h" #include "flutter/display_list/dl_builder.h" @@ -37,3 +38,5 @@ class DlPlayground : public PlaygroundTest { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_DISPLAY_LIST_DL_PLAYGROUND_H_ diff --git a/impeller/display_list/dl_vertices_geometry.h b/impeller/display_list/dl_vertices_geometry.h index 466ed932a7ce4..e7502cdc83dbe 100644 --- a/impeller/display_list/dl_vertices_geometry.h +++ b/impeller/display_list/dl_vertices_geometry.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_DISPLAY_LIST_DL_VERTICES_GEOMETRY_H_ +#define FLUTTER_IMPELLER_DISPLAY_LIST_DL_VERTICES_GEOMETRY_H_ #include "flutter/display_list/dl_vertices.h" @@ -14,3 +15,5 @@ std::shared_ptr MakeVertices( const flutter::DlVertices* vertices); } // namespace impeller + +#endif // FLUTTER_IMPELLER_DISPLAY_LIST_DL_VERTICES_GEOMETRY_H_ diff --git a/impeller/display_list/nine_patch_converter.h b/impeller/display_list/nine_patch_converter.h index 44afe97d2fe06..2d0974baa1ebb 100644 --- a/impeller/display_list/nine_patch_converter.h +++ b/impeller/display_list/nine_patch_converter.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_DISPLAY_LIST_NINE_PATCH_CONVERTER_H_ +#define FLUTTER_IMPELLER_DISPLAY_LIST_NINE_PATCH_CONVERTER_H_ #include @@ -43,3 +44,5 @@ class NinePatchConverter { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_DISPLAY_LIST_NINE_PATCH_CONVERTER_H_ diff --git a/impeller/display_list/skia_conversions.cc b/impeller/display_list/skia_conversions.cc index a0b5eaf0ddd78..f356e9973a57a 100644 --- a/impeller/display_list/skia_conversions.cc +++ b/impeller/display_list/skia_conversions.cc @@ -141,6 +141,10 @@ Point ToPoint(const SkPoint& point) { return Point::MakeXY(point.fX, point.fY); } +Size ToSize(const SkPoint& point) { + return Size(point.fX, point.fY); +} + Color ToColor(const flutter::DlColor& color) { return { static_cast(color.getRedF()), // diff --git a/impeller/display_list/skia_conversions.h b/impeller/display_list/skia_conversions.h index 4eed60fb124d2..a0fe839d29b87 100644 --- a/impeller/display_list/skia_conversions.h +++ b/impeller/display_list/skia_conversions.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_DISPLAY_LIST_SKIA_CONVERSIONS_H_ +#define FLUTTER_IMPELLER_DISPLAY_LIST_SKIA_CONVERSIONS_H_ #include "display_list/dl_color.h" #include "display_list/effects/dl_color_source.h" @@ -33,6 +34,8 @@ std::vector ToPoints(const SkPoint points[], int count); Point ToPoint(const SkPoint& point); +Size ToSize(const SkPoint& point); + Color ToColor(const flutter::DlColor& color); std::vector ToRSXForms(const SkRSXform xform[], int count); @@ -68,3 +71,5 @@ void ConvertStops(const flutter::DlGradientColorSourceBase* gradient, } // namespace skia_conversions } // namespace impeller + +#endif // FLUTTER_IMPELLER_DISPLAY_LIST_SKIA_CONVERSIONS_H_ diff --git a/impeller/display_list/skia_conversions_unittests.cc b/impeller/display_list/skia_conversions_unittests.cc index eaf1f571ab7f5..e31005e322c9f 100644 --- a/impeller/display_list/skia_conversions_unittests.cc +++ b/impeller/display_list/skia_conversions_unittests.cc @@ -11,6 +11,24 @@ namespace impeller { namespace testing { +TEST(SkiaConversionsTest, SkPointToPoint) { + for (int x = -100; x < 100; x += 4) { + for (int y = -100; y < 100; y += 4) { + EXPECT_EQ(skia_conversions::ToPoint(SkPoint::Make(x * 0.25f, y * 0.25f)), + Point(x * 0.25f, y * 0.25f)); + } + } +} + +TEST(SkiaConversionsTest, SkPointToSize) { + for (int x = -100; x < 100; x += 4) { + for (int y = -100; y < 100; y += 4) { + EXPECT_EQ(skia_conversions::ToSize(SkPoint::Make(x * 0.25f, y * 0.25f)), + Size(x * 0.25f, y * 0.25f)); + } + } +} + TEST(SkiaConversionsTest, ToColor) { // Create a color with alpha, red, green, and blue values that are all // trivially divisible by 255 so that we can test the conversion results in diff --git a/impeller/entity/BUILD.gn b/impeller/entity/BUILD.gn index 6c3f9ff273dd6..f324e6a1fa133 100644 --- a/impeller/entity/BUILD.gn +++ b/impeller/entity/BUILD.gn @@ -207,6 +207,8 @@ impeller_component("entity") { "geometry/point_field_geometry.h", "geometry/rect_geometry.cc", "geometry/rect_geometry.h", + "geometry/round_rect_geometry.cc", + "geometry/round_rect_geometry.h", "geometry/stroke_path_geometry.cc", "geometry/stroke_path_geometry.h", "geometry/vertices_geometry.cc", diff --git a/impeller/entity/contents/anonymous_contents.h b/impeller/entity/contents/anonymous_contents.h index a02769b809f2c..0efbfa7487e77 100644 --- a/impeller/entity/contents/anonymous_contents.h +++ b/impeller/entity/contents/anonymous_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_ANONYMOUS_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_ANONYMOUS_CONTENTS_H_ #include #include @@ -40,3 +41,5 @@ class AnonymousContents final : public Contents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_ANONYMOUS_CONTENTS_H_ diff --git a/impeller/entity/contents/atlas_contents.h b/impeller/entity/contents/atlas_contents.h index 3e6c5958564bf..12e5e232d3f25 100644 --- a/impeller/entity/contents/atlas_contents.h +++ b/impeller/entity/contents/atlas_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_ATLAS_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_ATLAS_CONTENTS_H_ #include #include @@ -161,3 +162,5 @@ class AtlasColorContents final : public Contents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_ATLAS_CONTENTS_H_ diff --git a/impeller/entity/contents/checkerboard_contents.h b/impeller/entity/contents/checkerboard_contents.h index 1c8682a28764b..43b2ae79424ad 100644 --- a/impeller/entity/contents/checkerboard_contents.h +++ b/impeller/entity/contents/checkerboard_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_CHECKERBOARD_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_CHECKERBOARD_CONTENTS_H_ #include "impeller/entity/contents/contents.h" @@ -40,3 +41,5 @@ class CheckerboardContents final : public Contents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_CHECKERBOARD_CONTENTS_H_ diff --git a/impeller/entity/contents/clip_contents.h b/impeller/entity/contents/clip_contents.h index eaf156b018ecd..b519cc255e112 100644 --- a/impeller/entity/contents/clip_contents.h +++ b/impeller/entity/contents/clip_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_CLIP_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_CLIP_CONTENTS_H_ #include #include @@ -100,3 +101,5 @@ class ClipRestoreContents final : public Contents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_CLIP_CONTENTS_H_ diff --git a/impeller/entity/contents/color_source_contents.h b/impeller/entity/contents/color_source_contents.h index a35d4d2277e2a..ca21097664a4f 100644 --- a/impeller/entity/contents/color_source_contents.h +++ b/impeller/entity/contents/color_source_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_COLOR_SOURCE_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_COLOR_SOURCE_CONTENTS_H_ #include "flutter/fml/macros.h" #include "impeller/entity/contents/contents.h" @@ -113,3 +114,5 @@ class ColorSourceContents : public Contents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_COLOR_SOURCE_CONTENTS_H_ diff --git a/impeller/entity/contents/conical_gradient_contents.h b/impeller/entity/contents/conical_gradient_contents.h index 52a4a36697403..db3b86b98e630 100644 --- a/impeller/entity/contents/conical_gradient_contents.h +++ b/impeller/entity/contents/conical_gradient_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_CONICAL_GRADIENT_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_CONICAL_GRADIENT_CONTENTS_H_ #include #include @@ -70,3 +71,5 @@ class ConicalGradientContents final : public ColorSourceContents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_CONICAL_GRADIENT_CONTENTS_H_ diff --git a/impeller/entity/contents/content_context.h b/impeller/entity/contents/content_context.h index e23ddcc1c06f1..b9ee0ffc939ac 100644 --- a/impeller/entity/contents/content_context.h +++ b/impeller/entity/contents/content_context.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_CONTENT_CONTEXT_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_CONTENT_CONTEXT_H_ #include #include @@ -909,3 +910,5 @@ class ContentContext { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_CONTENT_CONTEXT_H_ diff --git a/impeller/entity/contents/contents.h b/impeller/entity/contents/contents.h index d1dbb3349beb2..9a9ea86609184 100644 --- a/impeller/entity/contents/contents.h +++ b/impeller/entity/contents/contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_CONTENTS_H_ #include #include @@ -201,3 +202,5 @@ class Contents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_CONTENTS_H_ diff --git a/impeller/entity/contents/filters/blend_filter_contents.h b/impeller/entity/contents/filters/blend_filter_contents.h index 8a3841b32ce85..562f306034ebd 100644 --- a/impeller/entity/contents/filters/blend_filter_contents.h +++ b/impeller/entity/contents/filters/blend_filter_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_BLEND_FILTER_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_BLEND_FILTER_CONTENTS_H_ #include #include "impeller/entity/contents/filters/color_filter_contents.h" @@ -101,3 +102,5 @@ class BlendFilterContents : public ColorFilterContents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_BLEND_FILTER_CONTENTS_H_ diff --git a/impeller/entity/contents/filters/border_mask_blur_filter_contents.h b/impeller/entity/contents/filters/border_mask_blur_filter_contents.h index 90b8e2a44c1a2..10be38dbb72ed 100644 --- a/impeller/entity/contents/filters/border_mask_blur_filter_contents.h +++ b/impeller/entity/contents/filters/border_mask_blur_filter_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_BORDER_MASK_BLUR_FILTER_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_BORDER_MASK_BLUR_FILTER_CONTENTS_H_ #include #include @@ -56,3 +57,5 @@ class BorderMaskBlurFilterContents final : public FilterContents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_BORDER_MASK_BLUR_FILTER_CONTENTS_H_ diff --git a/impeller/entity/contents/filters/color_filter_contents.h b/impeller/entity/contents/filters/color_filter_contents.h index 7fc77d7e32666..14d9cb8aa5959 100644 --- a/impeller/entity/contents/filters/color_filter_contents.h +++ b/impeller/entity/contents/filters/color_filter_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_COLOR_FILTER_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_COLOR_FILTER_CONTENTS_H_ #include "impeller/entity/contents/filters/filter_contents.h" @@ -59,3 +60,5 @@ class ColorFilterContents : public FilterContents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_COLOR_FILTER_CONTENTS_H_ diff --git a/impeller/entity/contents/filters/color_matrix_filter_contents.h b/impeller/entity/contents/filters/color_matrix_filter_contents.h index 6c5c253941a96..e394125f79b9a 100644 --- a/impeller/entity/contents/filters/color_matrix_filter_contents.h +++ b/impeller/entity/contents/filters/color_matrix_filter_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_COLOR_MATRIX_FILTER_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_COLOR_MATRIX_FILTER_CONTENTS_H_ #include #include @@ -41,3 +42,5 @@ class ColorMatrixFilterContents final : public ColorFilterContents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_COLOR_MATRIX_FILTER_CONTENTS_H_ diff --git a/impeller/entity/contents/filters/directional_gaussian_blur_filter_contents.h b/impeller/entity/contents/filters/directional_gaussian_blur_filter_contents.h index ff15c388c713b..2ea5df044f2cb 100644 --- a/impeller/entity/contents/filters/directional_gaussian_blur_filter_contents.h +++ b/impeller/entity/contents/filters/directional_gaussian_blur_filter_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_DIRECTIONAL_GAUSSIAN_BLUR_FILTER_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_DIRECTIONAL_GAUSSIAN_BLUR_FILTER_CONTENTS_H_ #include #include @@ -104,3 +105,5 @@ class DirectionalGaussianBlurFilterContents final : public FilterContents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_DIRECTIONAL_GAUSSIAN_BLUR_FILTER_CONTENTS_H_ diff --git a/impeller/entity/contents/filters/filter_contents.h b/impeller/entity/contents/filters/filter_contents.h index b6aba377766ed..3e210d8f0fb70 100644 --- a/impeller/entity/contents/filters/filter_contents.h +++ b/impeller/entity/contents/filters/filter_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_FILTER_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_FILTER_CONTENTS_H_ #include #include @@ -239,3 +240,5 @@ class FilterContents : public Contents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_FILTER_CONTENTS_H_ diff --git a/impeller/entity/contents/filters/gaussian_blur_filter_contents.h b/impeller/entity/contents/filters/gaussian_blur_filter_contents.h index 7d390ddf87e78..143c6f5ab0c6a 100644 --- a/impeller/entity/contents/filters/gaussian_blur_filter_contents.h +++ b/impeller/entity/contents/filters/gaussian_blur_filter_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_GAUSSIAN_BLUR_FILTER_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_GAUSSIAN_BLUR_FILTER_CONTENTS_H_ #include #include "impeller/entity/contents/filters/filter_contents.h" @@ -71,3 +72,5 @@ class GaussianBlurFilterContents final : public FilterContents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_GAUSSIAN_BLUR_FILTER_CONTENTS_H_ diff --git a/impeller/entity/contents/filters/inputs/contents_filter_input.h b/impeller/entity/contents/filters/inputs/contents_filter_input.h index 983161fa728a3..8d381b76530ed 100644 --- a/impeller/entity/contents/filters/inputs/contents_filter_input.h +++ b/impeller/entity/contents/filters/inputs/contents_filter_input.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_INPUTS_CONTENTS_FILTER_INPUT_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_INPUTS_CONTENTS_FILTER_INPUT_H_ #include "impeller/entity/contents/filters/inputs/filter_input.h" @@ -41,3 +42,5 @@ class ContentsFilterInput final : public FilterInput { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_INPUTS_CONTENTS_FILTER_INPUT_H_ diff --git a/impeller/entity/contents/filters/inputs/filter_contents_filter_input.h b/impeller/entity/contents/filters/inputs/filter_contents_filter_input.h index ca3137ac4615a..965d45b3b1698 100644 --- a/impeller/entity/contents/filters/inputs/filter_contents_filter_input.h +++ b/impeller/entity/contents/filters/inputs/filter_contents_filter_input.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_INPUTS_FILTER_CONTENTS_FILTER_INPUT_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_INPUTS_FILTER_CONTENTS_FILTER_INPUT_H_ #include "impeller/entity/contents/filters/inputs/filter_input.h" @@ -66,3 +67,5 @@ class FilterContentsFilterInput final : public FilterInput { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_INPUTS_FILTER_CONTENTS_FILTER_INPUT_H_ diff --git a/impeller/entity/contents/filters/inputs/filter_input.h b/impeller/entity/contents/filters/inputs/filter_input.h index 9d1dd5189edd7..20a7136b446fd 100644 --- a/impeller/entity/contents/filters/inputs/filter_input.h +++ b/impeller/entity/contents/filters/inputs/filter_input.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_INPUTS_FILTER_INPUT_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_INPUTS_FILTER_INPUT_H_ #include #include @@ -92,3 +93,5 @@ class FilterInput { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_INPUTS_FILTER_INPUT_H_ diff --git a/impeller/entity/contents/filters/inputs/placeholder_filter_input.h b/impeller/entity/contents/filters/inputs/placeholder_filter_input.h index 09d5be61f1a6a..a6305bc22b236 100644 --- a/impeller/entity/contents/filters/inputs/placeholder_filter_input.h +++ b/impeller/entity/contents/filters/inputs/placeholder_filter_input.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_INPUTS_PLACEHOLDER_FILTER_INPUT_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_INPUTS_PLACEHOLDER_FILTER_INPUT_H_ #include "impeller/entity/contents/filters/inputs/filter_input.h" @@ -39,3 +40,5 @@ class PlaceholderFilterInput final : public FilterInput { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_INPUTS_PLACEHOLDER_FILTER_INPUT_H_ diff --git a/impeller/entity/contents/filters/inputs/texture_filter_input.h b/impeller/entity/contents/filters/inputs/texture_filter_input.h index 757f570800d16..320eb1b191f6d 100644 --- a/impeller/entity/contents/filters/inputs/texture_filter_input.h +++ b/impeller/entity/contents/filters/inputs/texture_filter_input.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_INPUTS_TEXTURE_FILTER_INPUT_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_INPUTS_TEXTURE_FILTER_INPUT_H_ #include "impeller/entity/contents/filters/inputs/filter_input.h" @@ -41,3 +42,5 @@ class TextureFilterInput final : public FilterInput { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_INPUTS_TEXTURE_FILTER_INPUT_H_ diff --git a/impeller/entity/contents/filters/linear_to_srgb_filter_contents.h b/impeller/entity/contents/filters/linear_to_srgb_filter_contents.h index e70a98c151d2c..d43703896aacf 100644 --- a/impeller/entity/contents/filters/linear_to_srgb_filter_contents.h +++ b/impeller/entity/contents/filters/linear_to_srgb_filter_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_LINEAR_TO_SRGB_FILTER_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_LINEAR_TO_SRGB_FILTER_CONTENTS_H_ #include "impeller/entity/contents/filters/color_filter_contents.h" #include "impeller/entity/contents/filters/inputs/filter_input.h" @@ -32,3 +33,5 @@ class LinearToSrgbFilterContents final : public ColorFilterContents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_LINEAR_TO_SRGB_FILTER_CONTENTS_H_ diff --git a/impeller/entity/contents/filters/local_matrix_filter_contents.h b/impeller/entity/contents/filters/local_matrix_filter_contents.h index 5d9e547a35e5b..0340058a021bc 100644 --- a/impeller/entity/contents/filters/local_matrix_filter_contents.h +++ b/impeller/entity/contents/filters/local_matrix_filter_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_LOCAL_MATRIX_FILTER_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_LOCAL_MATRIX_FILTER_CONTENTS_H_ #include "impeller/entity/contents/filters/filter_contents.h" #include "impeller/entity/contents/filters/inputs/filter_input.h" @@ -44,3 +45,5 @@ class LocalMatrixFilterContents final : public FilterContents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_LOCAL_MATRIX_FILTER_CONTENTS_H_ diff --git a/impeller/entity/contents/filters/matrix_filter_contents.h b/impeller/entity/contents/filters/matrix_filter_contents.h index bb498ea402443..dd6334e4169c8 100644 --- a/impeller/entity/contents/filters/matrix_filter_contents.h +++ b/impeller/entity/contents/filters/matrix_filter_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_MATRIX_FILTER_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_MATRIX_FILTER_CONTENTS_H_ #include "impeller/entity/contents/filters/filter_contents.h" #include "impeller/entity/contents/filters/inputs/filter_input.h" @@ -56,3 +57,5 @@ class MatrixFilterContents final : public FilterContents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_MATRIX_FILTER_CONTENTS_H_ diff --git a/impeller/entity/contents/filters/morphology_filter_contents.h b/impeller/entity/contents/filters/morphology_filter_contents.h index 91482f4673312..db3c23071ce09 100644 --- a/impeller/entity/contents/filters/morphology_filter_contents.h +++ b/impeller/entity/contents/filters/morphology_filter_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_MORPHOLOGY_FILTER_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_MORPHOLOGY_FILTER_CONTENTS_H_ #include #include @@ -56,3 +57,5 @@ class DirectionalMorphologyFilterContents final : public FilterContents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_MORPHOLOGY_FILTER_CONTENTS_H_ diff --git a/impeller/entity/contents/filters/srgb_to_linear_filter_contents.h b/impeller/entity/contents/filters/srgb_to_linear_filter_contents.h index 4e1b374943eff..dfadcffbf0c42 100644 --- a/impeller/entity/contents/filters/srgb_to_linear_filter_contents.h +++ b/impeller/entity/contents/filters/srgb_to_linear_filter_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_SRGB_TO_LINEAR_FILTER_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_SRGB_TO_LINEAR_FILTER_CONTENTS_H_ #include "impeller/entity/contents/filters/color_filter_contents.h" #include "impeller/entity/contents/filters/inputs/filter_input.h" @@ -32,3 +33,5 @@ class SrgbToLinearFilterContents final : public ColorFilterContents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_SRGB_TO_LINEAR_FILTER_CONTENTS_H_ diff --git a/impeller/entity/contents/filters/yuv_to_rgb_filter_contents.h b/impeller/entity/contents/filters/yuv_to_rgb_filter_contents.h index ef3ae2e522c93..efa903f0d9d35 100644 --- a/impeller/entity/contents/filters/yuv_to_rgb_filter_contents.h +++ b/impeller/entity/contents/filters/yuv_to_rgb_filter_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_YUV_TO_RGB_FILTER_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_YUV_TO_RGB_FILTER_CONTENTS_H_ #include "impeller/entity/contents/filters/filter_contents.h" @@ -39,3 +40,5 @@ class YUVToRGBFilterContents final : public FilterContents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_YUV_TO_RGB_FILTER_CONTENTS_H_ diff --git a/impeller/entity/contents/framebuffer_blend_contents.h b/impeller/entity/contents/framebuffer_blend_contents.h index ac5b57229f3b0..5335055bd3f61 100644 --- a/impeller/entity/contents/framebuffer_blend_contents.h +++ b/impeller/entity/contents/framebuffer_blend_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_FRAMEBUFFER_BLEND_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_FRAMEBUFFER_BLEND_CONTENTS_H_ #include @@ -57,3 +58,5 @@ class FramebufferBlendContents final : public ColorSourceContents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FRAMEBUFFER_BLEND_CONTENTS_H_ diff --git a/impeller/entity/contents/gradient_generator.h b/impeller/entity/contents/gradient_generator.h index 24321d861218f..8c3c02e9d9527 100644 --- a/impeller/entity/contents/gradient_generator.h +++ b/impeller/entity/contents/gradient_generator.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_GRADIENT_GENERATOR_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_GRADIENT_GENERATOR_H_ #include #include @@ -45,3 +46,5 @@ std::vector CreateGradientColors(const std::vector& colors, const std::vector& stops); } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_GRADIENT_GENERATOR_H_ diff --git a/impeller/entity/contents/linear_gradient_contents.h b/impeller/entity/contents/linear_gradient_contents.h index e73fa8eed8ca1..75b24a3ab9f4d 100644 --- a/impeller/entity/contents/linear_gradient_contents.h +++ b/impeller/entity/contents/linear_gradient_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_LINEAR_GRADIENT_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_LINEAR_GRADIENT_CONTENTS_H_ #include #include @@ -71,3 +72,5 @@ class LinearGradientContents final : public ColorSourceContents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_LINEAR_GRADIENT_CONTENTS_H_ diff --git a/impeller/entity/contents/radial_gradient_contents.h b/impeller/entity/contents/radial_gradient_contents.h index 8e5ae3e121670..87bd981942a1e 100644 --- a/impeller/entity/contents/radial_gradient_contents.h +++ b/impeller/entity/contents/radial_gradient_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_RADIAL_GRADIENT_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_RADIAL_GRADIENT_CONTENTS_H_ #include #include @@ -69,3 +70,5 @@ class RadialGradientContents final : public ColorSourceContents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_RADIAL_GRADIENT_CONTENTS_H_ diff --git a/impeller/entity/contents/runtime_effect_contents.h b/impeller/entity/contents/runtime_effect_contents.h index ada5f582654bf..c92b6eff24cb4 100644 --- a/impeller/entity/contents/runtime_effect_contents.h +++ b/impeller/entity/contents/runtime_effect_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_RUNTIME_EFFECT_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_RUNTIME_EFFECT_CONTENTS_H_ #include #include @@ -41,3 +42,5 @@ class RuntimeEffectContents final : public ColorSourceContents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_RUNTIME_EFFECT_CONTENTS_H_ diff --git a/impeller/entity/contents/scene_contents.h b/impeller/entity/contents/scene_contents.h index b1f443cd7502d..e5b249baf97ff 100644 --- a/impeller/entity/contents/scene_contents.h +++ b/impeller/entity/contents/scene_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_SCENE_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_SCENE_CONTENTS_H_ #if !IMPELLER_ENABLE_3D static_assert(false); @@ -39,3 +40,5 @@ class SceneContents final : public ColorSourceContents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_SCENE_CONTENTS_H_ diff --git a/impeller/entity/contents/solid_color_contents.h b/impeller/entity/contents/solid_color_contents.h index d0cc492712702..8fb7fc946176a 100644 --- a/impeller/entity/contents/solid_color_contents.h +++ b/impeller/entity/contents/solid_color_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_SOLID_COLOR_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_SOLID_COLOR_CONTENTS_H_ #include #include @@ -63,3 +64,5 @@ class SolidColorContents final : public ColorSourceContents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_SOLID_COLOR_CONTENTS_H_ diff --git a/impeller/entity/contents/solid_rrect_blur_contents.h b/impeller/entity/contents/solid_rrect_blur_contents.h index 41930406a8bc1..6d697b257e586 100644 --- a/impeller/entity/contents/solid_rrect_blur_contents.h +++ b/impeller/entity/contents/solid_rrect_blur_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_SOLID_RRECT_BLUR_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_SOLID_RRECT_BLUR_CONTENTS_H_ #include #include @@ -60,3 +61,5 @@ class SolidRRectBlurContents final : public Contents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_SOLID_RRECT_BLUR_CONTENTS_H_ diff --git a/impeller/entity/contents/sweep_gradient_contents.h b/impeller/entity/contents/sweep_gradient_contents.h index 1760cb3de9f0d..d46fbee8579a4 100644 --- a/impeller/entity/contents/sweep_gradient_contents.h +++ b/impeller/entity/contents/sweep_gradient_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_SWEEP_GRADIENT_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_SWEEP_GRADIENT_CONTENTS_H_ #include #include @@ -72,3 +73,5 @@ class SweepGradientContents final : public ColorSourceContents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_SWEEP_GRADIENT_CONTENTS_H_ diff --git a/impeller/entity/contents/test/contents_test_helpers.h b/impeller/entity/contents/test/contents_test_helpers.h index e65b5636ef8d5..afcef40c84075 100644 --- a/impeller/entity/contents/test/contents_test_helpers.h +++ b/impeller/entity/contents/test/contents_test_helpers.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_TEST_CONTENTS_TEST_HELPERS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_TEST_CONTENTS_TEST_HELPERS_H_ #include "impeller/renderer/command.h" @@ -43,3 +44,5 @@ typename T::FragInfo* GetFragInfo(const Command& command) { } } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_TEST_CONTENTS_TEST_HELPERS_H_ diff --git a/impeller/entity/contents/text_contents.h b/impeller/entity/contents/text_contents.h index 22a0bd04e6fb2..c7deaa3642d30 100644 --- a/impeller/entity/contents/text_contents.h +++ b/impeller/entity/contents/text_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_TEXT_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_TEXT_CONTENTS_H_ #include #include @@ -80,3 +81,5 @@ class TextContents final : public Contents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_TEXT_CONTENTS_H_ diff --git a/impeller/entity/contents/texture_contents.h b/impeller/entity/contents/texture_contents.h index 1cee26ac20e4f..5c9921fd303bc 100644 --- a/impeller/entity/contents/texture_contents.h +++ b/impeller/entity/contents/texture_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_TEXTURE_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_TEXTURE_CONTENTS_H_ #include #include @@ -94,3 +95,5 @@ class TextureContents final : public Contents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_TEXTURE_CONTENTS_H_ diff --git a/impeller/entity/contents/tiled_texture_contents.h b/impeller/entity/contents/tiled_texture_contents.h index 90ee30af73283..b0a4af1dab9b2 100644 --- a/impeller/entity/contents/tiled_texture_contents.h +++ b/impeller/entity/contents/tiled_texture_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_TILED_TEXTURE_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_TILED_TEXTURE_CONTENTS_H_ #include #include @@ -83,3 +84,5 @@ class TiledTextureContents final : public ColorSourceContents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_TILED_TEXTURE_CONTENTS_H_ diff --git a/impeller/entity/contents/vertices_contents.h b/impeller/entity/contents/vertices_contents.h index 8aedfdf9097c6..b5d3590f02421 100644 --- a/impeller/entity/contents/vertices_contents.h +++ b/impeller/entity/contents/vertices_contents.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_VERTICES_CONTENTS_H_ +#define FLUTTER_IMPELLER_ENTITY_CONTENTS_VERTICES_CONTENTS_H_ #include #include @@ -108,3 +109,5 @@ class VerticesUVContents final : public Contents { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_VERTICES_CONTENTS_H_ diff --git a/impeller/entity/entity.h b/impeller/entity/entity.h index c5d98b5a11768..72671320dc785 100644 --- a/impeller/entity/entity.h +++ b/impeller/entity/entity.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_ENTITY_H_ +#define FLUTTER_IMPELLER_ENTITY_ENTITY_H_ #include @@ -128,3 +129,5 @@ class Entity { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_ENTITY_H_ diff --git a/impeller/entity/entity_pass.h b/impeller/entity/entity_pass.h index 08b34377a446f..1ff08f077ebba 100644 --- a/impeller/entity/entity_pass.h +++ b/impeller/entity/entity_pass.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_ENTITY_PASS_H_ +#define FLUTTER_IMPELLER_ENTITY_ENTITY_PASS_H_ #include #include @@ -335,3 +336,5 @@ class EntityPassClipRecorder { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_ENTITY_PASS_H_ diff --git a/impeller/entity/entity_pass_delegate.h b/impeller/entity/entity_pass_delegate.h index 8708edf18b451..72a38af65eebc 100644 --- a/impeller/entity/entity_pass_delegate.h +++ b/impeller/entity/entity_pass_delegate.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_ENTITY_PASS_DELEGATE_H_ +#define FLUTTER_IMPELLER_ENTITY_ENTITY_PASS_DELEGATE_H_ #include @@ -45,3 +46,5 @@ class EntityPassDelegate { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_ENTITY_PASS_DELEGATE_H_ diff --git a/impeller/entity/entity_pass_target.h b/impeller/entity/entity_pass_target.h index 76e90ece6f083..204944e4b3a35 100644 --- a/impeller/entity/entity_pass_target.h +++ b/impeller/entity/entity_pass_target.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_ENTITY_PASS_TARGET_H_ +#define FLUTTER_IMPELLER_ENTITY_ENTITY_PASS_TARGET_H_ #include "fml/macros.h" #include "impeller/renderer/render_target.h" @@ -43,3 +44,5 @@ class EntityPassTarget { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_ENTITY_PASS_TARGET_H_ diff --git a/impeller/entity/entity_playground.h b/impeller/entity/entity_playground.h index 10604f607237c..41dc21658ef2b 100644 --- a/impeller/entity/entity_playground.h +++ b/impeller/entity/entity_playground.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_ENTITY_PLAYGROUND_H_ +#define FLUTTER_IMPELLER_ENTITY_ENTITY_PLAYGROUND_H_ #include "impeller/playground/playground_test.h" @@ -43,3 +44,5 @@ class EntityPlayground : public PlaygroundTest { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_ENTITY_PLAYGROUND_H_ diff --git a/impeller/entity/geometry/circle_geometry.h b/impeller/entity/geometry/circle_geometry.h index d74c41b99c522..be75f891317d1 100644 --- a/impeller/entity/geometry/circle_geometry.h +++ b/impeller/entity/geometry/circle_geometry.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_GEOMETRY_CIRCLE_GEOMETRY_H_ +#define FLUTTER_IMPELLER_ENTITY_GEOMETRY_CIRCLE_GEOMETRY_H_ #include "impeller/entity/geometry/geometry.h" @@ -55,3 +56,5 @@ class CircleGeometry final : public Geometry { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_GEOMETRY_CIRCLE_GEOMETRY_H_ diff --git a/impeller/entity/geometry/cover_geometry.h b/impeller/entity/geometry/cover_geometry.h index 653b0c5f9769f..3d7675648e5dd 100644 --- a/impeller/entity/geometry/cover_geometry.h +++ b/impeller/entity/geometry/cover_geometry.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_GEOMETRY_COVER_GEOMETRY_H_ +#define FLUTTER_IMPELLER_ENTITY_GEOMETRY_COVER_GEOMETRY_H_ #include "impeller/entity/geometry/geometry.h" @@ -46,3 +47,5 @@ class CoverGeometry final : public Geometry { static_assert(std::is_trivially_destructible::value); } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_GEOMETRY_COVER_GEOMETRY_H_ diff --git a/impeller/entity/geometry/ellipse_geometry.h b/impeller/entity/geometry/ellipse_geometry.h index cd294a67bde12..892d03568e6de 100644 --- a/impeller/entity/geometry/ellipse_geometry.h +++ b/impeller/entity/geometry/ellipse_geometry.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_GEOMETRY_ELLIPSE_GEOMETRY_H_ +#define FLUTTER_IMPELLER_ENTITY_GEOMETRY_ELLIPSE_GEOMETRY_H_ #include "impeller/entity/geometry/geometry.h" @@ -51,3 +52,5 @@ class EllipseGeometry final : public Geometry { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_GEOMETRY_ELLIPSE_GEOMETRY_H_ diff --git a/impeller/entity/geometry/fill_path_geometry.h b/impeller/entity/geometry/fill_path_geometry.h index 690db3ea521b7..a1210846b311b 100644 --- a/impeller/entity/geometry/fill_path_geometry.h +++ b/impeller/entity/geometry/fill_path_geometry.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_GEOMETRY_FILL_PATH_GEOMETRY_H_ +#define FLUTTER_IMPELLER_ENTITY_GEOMETRY_FILL_PATH_GEOMETRY_H_ #include @@ -50,3 +51,5 @@ class FillPathGeometry final : public Geometry { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_GEOMETRY_FILL_PATH_GEOMETRY_H_ diff --git a/impeller/entity/geometry/geometry.cc b/impeller/entity/geometry/geometry.cc index 44f3d91ee9291..a9855033e2769 100644 --- a/impeller/entity/geometry/geometry.cc +++ b/impeller/entity/geometry/geometry.cc @@ -14,6 +14,7 @@ #include "impeller/entity/geometry/line_geometry.h" #include "impeller/entity/geometry/point_field_geometry.h" #include "impeller/entity/geometry/rect_geometry.h" +#include "impeller/entity/geometry/round_rect_geometry.h" #include "impeller/entity/geometry/stroke_path_geometry.h" #include "impeller/geometry/rect.h" @@ -204,6 +205,11 @@ std::shared_ptr Geometry::MakeStrokedCircle(const Point& center, return std::make_shared(center, radius, stroke_width); } +std::shared_ptr Geometry::MakeRoundRect(const Rect& rect, + const Size& radii) { + return std::make_shared(rect, radii); +} + bool Geometry::CoversArea(const Matrix& transform, const Rect& rect) const { return false; } diff --git a/impeller/entity/geometry/geometry.h b/impeller/entity/geometry/geometry.h index 353bd2b5e730b..a958f8e5aacaa 100644 --- a/impeller/entity/geometry/geometry.h +++ b/impeller/entity/geometry/geometry.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_GEOMETRY_GEOMETRY_H_ +#define FLUTTER_IMPELLER_ENTITY_GEOMETRY_GEOMETRY_H_ #include "impeller/core/formats.h" #include "impeller/core/vertex_buffer.h" @@ -85,6 +86,9 @@ class Geometry { Scalar radius, Scalar stroke_width); + static std::shared_ptr MakeRoundRect(const Rect& rect, + const Size& radii); + static std::shared_ptr MakePointField(std::vector points, Scalar radius, bool round); @@ -131,3 +135,5 @@ class Geometry { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_GEOMETRY_GEOMETRY_H_ diff --git a/impeller/entity/geometry/geometry_unittests.cc b/impeller/entity/geometry/geometry_unittests.cc index 759870fc59bee..170a01ff98e85 100644 --- a/impeller/entity/geometry/geometry_unittests.cc +++ b/impeller/entity/geometry/geometry_unittests.cc @@ -62,5 +62,14 @@ TEST(EntityGeometryTest, LineGeometryCoverage) { } } +TEST(EntityGeometryTest, RoundRectGeometryCoversArea) { + auto geometry = + Geometry::MakeRoundRect(Rect::MakeLTRB(0, 0, 100, 100), Size(20, 20)); + EXPECT_FALSE(geometry->CoversArea({}, Rect::MakeLTRB(15, 15, 85, 85))); + EXPECT_TRUE(geometry->CoversArea({}, Rect::MakeLTRB(20, 20, 80, 80))); + EXPECT_TRUE(geometry->CoversArea({}, Rect::MakeLTRB(30, 1, 70, 99))); + EXPECT_TRUE(geometry->CoversArea({}, Rect::MakeLTRB(1, 30, 99, 70))); +} + } // namespace testing } // namespace impeller diff --git a/impeller/entity/geometry/line_geometry.h b/impeller/entity/geometry/line_geometry.h index 19bf5665aed21..58032074ed5d9 100644 --- a/impeller/entity/geometry/line_geometry.h +++ b/impeller/entity/geometry/line_geometry.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_GEOMETRY_LINE_GEOMETRY_H_ +#define FLUTTER_IMPELLER_ENTITY_GEOMETRY_LINE_GEOMETRY_H_ #include #include "impeller/entity/geometry/geometry.h" @@ -76,3 +77,5 @@ class LineGeometry final : public Geometry { static_assert(std::is_trivially_destructible::value); } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_GEOMETRY_LINE_GEOMETRY_H_ diff --git a/impeller/entity/geometry/point_field_geometry.h b/impeller/entity/geometry/point_field_geometry.h index 944db2df960b6..9d43f07cb9fbe 100644 --- a/impeller/entity/geometry/point_field_geometry.h +++ b/impeller/entity/geometry/point_field_geometry.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_GEOMETRY_POINT_FIELD_GEOMETRY_H_ +#define FLUTTER_IMPELLER_ENTITY_GEOMETRY_POINT_FIELD_GEOMETRY_H_ #include "impeller/entity/geometry/geometry.h" @@ -57,3 +58,5 @@ class PointFieldGeometry final : public Geometry { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_GEOMETRY_POINT_FIELD_GEOMETRY_H_ diff --git a/impeller/entity/geometry/rect_geometry.h b/impeller/entity/geometry/rect_geometry.h index 35f1762ed2a11..91842a027633e 100644 --- a/impeller/entity/geometry/rect_geometry.h +++ b/impeller/entity/geometry/rect_geometry.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_GEOMETRY_RECT_GEOMETRY_H_ +#define FLUTTER_IMPELLER_ENTITY_GEOMETRY_RECT_GEOMETRY_H_ #include "impeller/entity/geometry/geometry.h" @@ -49,3 +50,5 @@ class RectGeometry final : public Geometry { static_assert(std::is_trivially_destructible::value); } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_GEOMETRY_RECT_GEOMETRY_H_ diff --git a/impeller/entity/geometry/round_rect_geometry.cc b/impeller/entity/geometry/round_rect_geometry.cc new file mode 100644 index 0000000000000..c6c47d0c54cbe --- /dev/null +++ b/impeller/entity/geometry/round_rect_geometry.cc @@ -0,0 +1,85 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include + +#include "flutter/impeller/entity/geometry/round_rect_geometry.h" + +#include "flutter/impeller/entity/geometry/line_geometry.h" + +namespace impeller { + +RoundRectGeometry::RoundRectGeometry(const Rect& bounds, const Size& radii) + : bounds_(bounds), radii_(radii) {} + +GeometryResult RoundRectGeometry::GetPositionBuffer( + const ContentContext& renderer, + const Entity& entity, + RenderPass& pass) const { + return ComputePositionGeometry(renderer.GetTessellator()->FilledRoundRect( + entity.GetTransform(), bounds_, radii_), + entity, pass); +} + +// |Geometry| +GeometryResult RoundRectGeometry::GetPositionUVBuffer( + Rect texture_coverage, + Matrix effect_transform, + const ContentContext& renderer, + const Entity& entity, + RenderPass& pass) const { + return ComputePositionUVGeometry( + renderer.GetTessellator()->FilledRoundRect(entity.GetTransform(), bounds_, + radii_), + texture_coverage.GetNormalizingTransform() * effect_transform, entity, + pass); +} + +GeometryVertexType RoundRectGeometry::GetVertexType() const { + return GeometryVertexType::kPosition; +} + +std::optional RoundRectGeometry::GetCoverage( + const Matrix& transform) const { + return bounds_.TransformBounds(transform); +} + +bool RoundRectGeometry::CoversArea(const Matrix& transform, + const Rect& rect) const { + if (!transform.IsTranslationScaleOnly()) { + return false; + } + bool flat_on_tb = bounds_.GetSize().width > radii_.width * 2; + bool flat_on_lr = bounds_.GetSize().height > radii_.height * 2; + if (!flat_on_tb && !flat_on_lr) { + return false; + } + // We either transform the bounds and delta-transform the radii, + // or we compute the vertical and horizontal bounds and then + // transform each. Either way there are 2 transform operations. + // We could also get a weaker answer by computing just the + // "inner rect" and only doing a coverage analysis on that, + // but this process will produce more culling results. + if (flat_on_tb) { + Rect vertical_bounds = bounds_.Expand(Size{-radii_.width, 0}); + Rect coverage = vertical_bounds.TransformBounds(transform); + if (coverage.Contains(rect)) { + return true; + } + } + if (flat_on_lr) { + Rect horizontal_bounds = bounds_.Expand(Size{0, -radii_.height}); + Rect coverage = horizontal_bounds.TransformBounds(transform); + if (coverage.Contains(rect)) { + return true; + } + } + return false; +} + +bool RoundRectGeometry::IsAxisAlignedRect() const { + return false; +} + +} // namespace impeller diff --git a/impeller/entity/geometry/round_rect_geometry.h b/impeller/entity/geometry/round_rect_geometry.h new file mode 100644 index 0000000000000..78f0523a20f1f --- /dev/null +++ b/impeller/entity/geometry/round_rect_geometry.h @@ -0,0 +1,57 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef FLUTTER_IMPELLER_ENTITY_GEOMETRY_ROUND_RECT_GEOMETRY_H_ +#define FLUTTER_IMPELLER_ENTITY_GEOMETRY_ROUND_RECT_GEOMETRY_H_ + +#include "impeller/entity/geometry/geometry.h" + +namespace impeller { + +// Geometry class that can generate vertices (with or without texture +// coordinates) for filled ellipses. Generating vertices for a stroked +// ellipse would require a lot more work since the line width must be +// applied perpendicular to the distorted ellipse shape. +class RoundRectGeometry final : public Geometry { + public: + explicit RoundRectGeometry(const Rect& bounds, const Size& radii); + + ~RoundRectGeometry() = default; + + // |Geometry| + bool CoversArea(const Matrix& transform, const Rect& rect) const override; + + // |Geometry| + bool IsAxisAlignedRect() const override; + + private: + // |Geometry| + GeometryResult GetPositionBuffer(const ContentContext& renderer, + const Entity& entity, + RenderPass& pass) const override; + + // |Geometry| + GeometryVertexType GetVertexType() const override; + + // |Geometry| + std::optional GetCoverage(const Matrix& transform) const override; + + // |Geometry| + GeometryResult GetPositionUVBuffer(Rect texture_coverage, + Matrix effect_transform, + const ContentContext& renderer, + const Entity& entity, + RenderPass& pass) const override; + + const Rect bounds_; + const Size radii_; + + RoundRectGeometry(const RoundRectGeometry&) = delete; + + RoundRectGeometry& operator=(const RoundRectGeometry&) = delete; +}; + +} // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_GEOMETRY_ROUND_RECT_GEOMETRY_H_ diff --git a/impeller/entity/geometry/stroke_path_geometry.h b/impeller/entity/geometry/stroke_path_geometry.h index 32db2d0d8b979..ef08a98ed5fe6 100644 --- a/impeller/entity/geometry/stroke_path_geometry.h +++ b/impeller/entity/geometry/stroke_path_geometry.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_GEOMETRY_STROKE_PATH_GEOMETRY_H_ +#define FLUTTER_IMPELLER_ENTITY_GEOMETRY_STROKE_PATH_GEOMETRY_H_ #include "impeller/entity/geometry/geometry.h" @@ -94,3 +95,5 @@ class StrokePathGeometry final : public Geometry { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_GEOMETRY_STROKE_PATH_GEOMETRY_H_ diff --git a/impeller/entity/geometry/vertices_geometry.h b/impeller/entity/geometry/vertices_geometry.h index 1e32961fd5eb5..8f4d2be485e62 100644 --- a/impeller/entity/geometry/vertices_geometry.h +++ b/impeller/entity/geometry/vertices_geometry.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_GEOMETRY_VERTICES_GEOMETRY_H_ +#define FLUTTER_IMPELLER_ENTITY_GEOMETRY_VERTICES_GEOMETRY_H_ #include "impeller/entity/geometry/geometry.h" @@ -69,3 +70,5 @@ class VerticesGeometry final : public Geometry { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_GEOMETRY_VERTICES_GEOMETRY_H_ diff --git a/impeller/entity/inline_pass_context.h b/impeller/entity/inline_pass_context.h index 4da816478a705..595d291b5a1c8 100644 --- a/impeller/entity/inline_pass_context.h +++ b/impeller/entity/inline_pass_context.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_INLINE_PASS_CONTEXT_H_ +#define FLUTTER_IMPELLER_ENTITY_INLINE_PASS_CONTEXT_H_ #include @@ -60,3 +61,5 @@ class InlinePassContext { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_INLINE_PASS_CONTEXT_H_ diff --git a/impeller/entity/render_target_cache.h b/impeller/entity/render_target_cache.h index 4be1c1daebd29..b59bd43983711 100644 --- a/impeller/entity/render_target_cache.h +++ b/impeller/entity/render_target_cache.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_ENTITY_RENDER_TARGET_CACHE_H_ +#define FLUTTER_IMPELLER_ENTITY_RENDER_TARGET_CACHE_H_ #include "impeller/renderer/render_target.h" @@ -45,3 +46,5 @@ class RenderTargetCache : public RenderTargetAllocator { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_ENTITY_RENDER_TARGET_CACHE_H_ diff --git a/impeller/fixtures/golden_paths.h b/impeller/fixtures/golden_paths.h index 95fae57792ef3..16767f766b776 100644 --- a/impeller/fixtures/golden_paths.h +++ b/impeller/fixtures/golden_paths.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_FIXTURES_GOLDEN_PATHS_H_ +#define FLUTTER_IMPELLER_FIXTURES_GOLDEN_PATHS_H_ #include @@ -67,3 +68,5 @@ std::vector golden_cubic_and_quad_points = { } // namespace testing } // namespace impeller + +#endif // FLUTTER_IMPELLER_FIXTURES_GOLDEN_PATHS_H_ diff --git a/impeller/fixtures/types.h b/impeller/fixtures/types.h index aca0e96ad79b3..e26dbee0682bd 100644 --- a/impeller/fixtures/types.h +++ b/impeller/fixtures/types.h @@ -2,10 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_FIXTURES_TYPES_H_ +#define FLUTTER_IMPELLER_FIXTURES_TYPES_H_ struct Uniforms { mat4 model; mat4 view; mat4 projection; }; + +#endif // FLUTTER_IMPELLER_FIXTURES_TYPES_H_ diff --git a/impeller/geometry/color.h b/impeller/geometry/color.h index e31a82031b293..6aa8b502ae665 100644 --- a/impeller/geometry/color.h +++ b/impeller/geometry/color.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GEOMETRY_COLOR_H_ +#define FLUTTER_IMPELLER_GEOMETRY_COLOR_H_ #include #include @@ -954,3 +955,5 @@ inline std::ostream& operator<<(std::ostream& out, const impeller::Color& c) { } } // namespace std + +#endif // FLUTTER_IMPELLER_GEOMETRY_COLOR_H_ diff --git a/impeller/geometry/constants.h b/impeller/geometry/constants.h index eb600e90da6fd..2fa8e037db8a8 100644 --- a/impeller/geometry/constants.h +++ b/impeller/geometry/constants.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GEOMETRY_CONSTANTS_H_ +#define FLUTTER_IMPELLER_GEOMETRY_CONSTANTS_H_ namespace impeller { @@ -55,3 +56,5 @@ constexpr float kPhi = 1.61803398874989484820f; constexpr float kEhCloseEnough = 1e-3f; } // namespace impeller + +#endif // FLUTTER_IMPELLER_GEOMETRY_CONSTANTS_H_ diff --git a/impeller/geometry/geometry_asserts.h b/impeller/geometry/geometry_asserts.h index de38b445fb7cd..f5eeac9550c35 100644 --- a/impeller/geometry/geometry_asserts.h +++ b/impeller/geometry/geometry_asserts.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GEOMETRY_GEOMETRY_ASSERTS_H_ +#define FLUTTER_IMPELLER_GEOMETRY_GEOMETRY_ASSERTS_H_ #include #include @@ -175,3 +176,5 @@ inline ::testing::AssertionResult ColorsNear(std::vector a, #define EXPECT_ARRAY_4_NEAR(a, b) EXPECT_PRED2(&::Array4Near, a, b) #define EXPECT_COLOR_BUFFER_NEAR(a, b) EXPECT_PRED2(&::ColorBufferNear, a, b) #define EXPECT_COLORS_NEAR(a, b) EXPECT_PRED2(&::ColorsNear, a, b) + +#endif // FLUTTER_IMPELLER_GEOMETRY_GEOMETRY_ASSERTS_H_ diff --git a/impeller/geometry/gradient.h b/impeller/geometry/gradient.h index 5aca0be745f41..8d6e70a2e3f3c 100644 --- a/impeller/geometry/gradient.h +++ b/impeller/geometry/gradient.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GEOMETRY_GRADIENT_H_ +#define FLUTTER_IMPELLER_GEOMETRY_GRADIENT_H_ #include #include @@ -32,3 +33,5 @@ GradientData CreateGradientBuffer(const std::vector& colors, const std::vector& stops); } // namespace impeller + +#endif // FLUTTER_IMPELLER_GEOMETRY_GRADIENT_H_ diff --git a/impeller/geometry/half.h b/impeller/geometry/half.h index d5aef60e0d3e3..8ab60a0f57ae7 100644 --- a/impeller/geometry/half.h +++ b/impeller/geometry/half.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GEOMETRY_HALF_H_ +#define FLUTTER_IMPELLER_GEOMETRY_HALF_H_ #include @@ -190,3 +191,5 @@ inline std::ostream& operator<<(std::ostream& out, // NOLINTEND(google-explicit-constructor) } // namespace std + +#endif // FLUTTER_IMPELLER_GEOMETRY_HALF_H_ diff --git a/impeller/geometry/matrix.h b/impeller/geometry/matrix.h index 2a4e222c17ca1..dab9186e69626 100644 --- a/impeller/geometry/matrix.h +++ b/impeller/geometry/matrix.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GEOMETRY_MATRIX_H_ +#define FLUTTER_IMPELLER_GEOMETRY_MATRIX_H_ #include #include @@ -527,3 +528,5 @@ inline std::ostream& operator<<(std::ostream& out, const impeller::Matrix& m) { } } // namespace std + +#endif // FLUTTER_IMPELLER_GEOMETRY_MATRIX_H_ diff --git a/impeller/geometry/matrix_decomposition.h b/impeller/geometry/matrix_decomposition.h index 31c01ec5c6266..a5b6592f26149 100644 --- a/impeller/geometry/matrix_decomposition.h +++ b/impeller/geometry/matrix_decomposition.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GEOMETRY_MATRIX_DECOMPOSITION_H_ +#define FLUTTER_IMPELLER_GEOMETRY_MATRIX_DECOMPOSITION_H_ #include "impeller/geometry/quaternion.h" #include "impeller/geometry/scalar.h" @@ -30,3 +31,5 @@ struct MatrixDecomposition { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_GEOMETRY_MATRIX_DECOMPOSITION_H_ diff --git a/impeller/geometry/path.h b/impeller/geometry/path.h index 0b1e5962a2ba3..f4f5800ab12e3 100644 --- a/impeller/geometry/path.h +++ b/impeller/geometry/path.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GEOMETRY_PATH_H_ +#define FLUTTER_IMPELLER_GEOMETRY_PATH_H_ #include #include @@ -234,3 +235,5 @@ class Path { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_GEOMETRY_PATH_H_ diff --git a/impeller/geometry/path_builder.cc b/impeller/geometry/path_builder.cc index da92208247c83..616b165aed2e6 100644 --- a/impeller/geometry/path_builder.cc +++ b/impeller/geometry/path_builder.cc @@ -139,8 +139,8 @@ PathBuilder& PathBuilder::AddRoundedRect(Rect rect, Scalar radius) { : AddRoundedRect(rect, RoundingRadii(radius)); } -PathBuilder& PathBuilder::AddRoundedRect(Rect rect, Point radii) { - return radii.x <= 0 || radii.y <= 0 +PathBuilder& PathBuilder::AddRoundedRect(Rect rect, Size radii) { + return radii.width <= 0 || radii.height <= 0 ? AddRect(rect) : AddRoundedRect(rect, RoundingRadii(radii)); } diff --git a/impeller/geometry/path_builder.h b/impeller/geometry/path_builder.h index 1502944f00bfd..826d2abfc2990 100644 --- a/impeller/geometry/path_builder.h +++ b/impeller/geometry/path_builder.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GEOMETRY_PATH_BUILDER_H_ +#define FLUTTER_IMPELLER_GEOMETRY_PATH_BUILDER_H_ #include "impeller/geometry/path.h" #include "impeller/geometry/rect.h" @@ -132,6 +133,12 @@ class PathBuilder { top_right(radii), bottom_right(radii) {} + explicit RoundingRadii(Size radii) + : top_left(radii), + bottom_left(radii), + top_right(radii), + bottom_right(radii) {} + bool AreAllZero() const { return top_left.IsZero() && // bottom_left.IsZero() && // @@ -142,7 +149,7 @@ class PathBuilder { PathBuilder& AddRoundedRect(Rect rect, RoundingRadii radii); - PathBuilder& AddRoundedRect(Rect rect, Point radii); + PathBuilder& AddRoundedRect(Rect rect, Size radii); PathBuilder& AddRoundedRect(Rect rect, Scalar radius); @@ -168,3 +175,5 @@ class PathBuilder { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_GEOMETRY_PATH_BUILDER_H_ diff --git a/impeller/geometry/path_component.h b/impeller/geometry/path_component.h index c47b55cbec4f0..8bf1018925a18 100644 --- a/impeller/geometry/path_component.h +++ b/impeller/geometry/path_component.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GEOMETRY_PATH_COMPONENT_H_ +#define FLUTTER_IMPELLER_GEOMETRY_PATH_COMPONENT_H_ #include #include @@ -184,3 +185,5 @@ static_assert(!std::is_polymorphic::value); static_assert(!std::is_polymorphic::value); } // namespace impeller + +#endif // FLUTTER_IMPELLER_GEOMETRY_PATH_COMPONENT_H_ diff --git a/impeller/geometry/path_unittests.cc b/impeller/geometry/path_unittests.cc index 157bf907a0f5c..6f626f691205d 100644 --- a/impeller/geometry/path_unittests.cc +++ b/impeller/geometry/path_unittests.cc @@ -79,6 +79,17 @@ TEST(PathTest, PathBuilderSetsCorrectContourPropertiesForAddCommands) { ASSERT_TRUE(contour.is_closed); } + { + Path path = + PathBuilder{} + .AddRoundedRect(Rect::MakeXYWH(100, 100, 100, 100), Size(10, 20)) + .TakePath(); + ContourComponent contour; + path.GetContourComponentAtIndex(0, contour); + ASSERT_POINT_NEAR(contour.destination, Point(110, 100)); + ASSERT_TRUE(contour.is_closed); + } + // Open shapes. { Point p(100, 100); diff --git a/impeller/geometry/point.h b/impeller/geometry/point.h index f8a00c1252d5c..ad978a08abb47 100644 --- a/impeller/geometry/point.h +++ b/impeller/geometry/point.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GEOMETRY_POINT_H_ +#define FLUTTER_IMPELLER_GEOMETRY_POINT_H_ #include #include @@ -323,3 +324,5 @@ inline std::ostream& operator<<(std::ostream& out, } } // namespace std + +#endif // FLUTTER_IMPELLER_GEOMETRY_POINT_H_ diff --git a/impeller/geometry/quaternion.h b/impeller/geometry/quaternion.h index 3a5738250fc1e..408f5c04edb64 100644 --- a/impeller/geometry/quaternion.h +++ b/impeller/geometry/quaternion.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GEOMETRY_QUATERNION_H_ +#define FLUTTER_IMPELLER_GEOMETRY_QUATERNION_H_ #include @@ -97,3 +98,5 @@ inline std::ostream& operator<<(std::ostream& out, } } // namespace std + +#endif // FLUTTER_IMPELLER_GEOMETRY_QUATERNION_H_ diff --git a/impeller/geometry/rect.h b/impeller/geometry/rect.h index 8d0fc5da499c2..c371512ccf9cb 100644 --- a/impeller/geometry/rect.h +++ b/impeller/geometry/rect.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GEOMETRY_RECT_H_ +#define FLUTTER_IMPELLER_GEOMETRY_RECT_H_ #include #include @@ -356,6 +357,15 @@ struct TRect { size.height + amount.y * 2); } + /// @brief Returns a rectangle with expanded edges in all directions. + /// Negative expansion results in shrinking. + constexpr TRect Expand(TSize amount) const { + return TRect(origin.x - amount.width, // + origin.y - amount.height, // + size.width + amount.width * 2, // + size.height + amount.height * 2); + } + /// @brief Returns a new rectangle that represents the projection of the /// source rectangle onto this rectangle. In other words, the source /// rectangle is redefined in terms of the corrdinate space of this @@ -427,3 +437,5 @@ inline std::ostream& operator<<(std::ostream& out, } } // namespace std + +#endif // FLUTTER_IMPELLER_GEOMETRY_RECT_H_ diff --git a/impeller/geometry/rect_unittests.cc b/impeller/geometry/rect_unittests.cc index dcac4d8734ade..6cf2e971863dd 100644 --- a/impeller/geometry/rect_unittests.cc +++ b/impeller/geometry/rect_unittests.cc @@ -267,5 +267,25 @@ TEST(RectTest, GetCenter) { EXPECT_EQ(IRect::MakeXYWH(10, 30, 20, 19).GetCenter(), Point(20, 39.5)); } +TEST(RectTest, Expand) { + auto rect = Rect::MakeLTRB(100, 100, 200, 200); + + // Expand(T amount) + EXPECT_EQ(rect.Expand(10), Rect::MakeLTRB(90, 90, 210, 210)); + EXPECT_EQ(rect.Expand(-10), Rect::MakeLTRB(110, 110, 190, 190)); + + // Expand(Point amount) + EXPECT_EQ(rect.Expand(Point{10, 10}), Rect::MakeLTRB(90, 90, 210, 210)); + EXPECT_EQ(rect.Expand(Point{10, -10}), Rect::MakeLTRB(90, 110, 210, 190)); + EXPECT_EQ(rect.Expand(Point{-10, 10}), Rect::MakeLTRB(110, 90, 190, 210)); + EXPECT_EQ(rect.Expand(Point{-10, -10}), Rect::MakeLTRB(110, 110, 190, 190)); + + // Expand(Size amount) + EXPECT_EQ(rect.Expand(Size{10, 10}), Rect::MakeLTRB(90, 90, 210, 210)); + EXPECT_EQ(rect.Expand(Size{10, -10}), Rect::MakeLTRB(90, 110, 210, 190)); + EXPECT_EQ(rect.Expand(Size{-10, 10}), Rect::MakeLTRB(110, 90, 190, 210)); + EXPECT_EQ(rect.Expand(Size{-10, -10}), Rect::MakeLTRB(110, 110, 190, 190)); +} + } // namespace testing } // namespace impeller diff --git a/impeller/geometry/scalar.h b/impeller/geometry/scalar.h index ffdc58e33664a..2600a49c42dc5 100644 --- a/impeller/geometry/scalar.h +++ b/impeller/geometry/scalar.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GEOMETRY_SCALAR_H_ +#define FLUTTER_IMPELLER_GEOMETRY_SCALAR_H_ #include #include @@ -57,3 +58,5 @@ struct Degrees { // NOLINTEND(google-explicit-constructor) } // namespace impeller + +#endif // FLUTTER_IMPELLER_GEOMETRY_SCALAR_H_ diff --git a/impeller/geometry/shear.h b/impeller/geometry/shear.h index 155f7ea7fae43..c94e26e5f0cb5 100644 --- a/impeller/geometry/shear.h +++ b/impeller/geometry/shear.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GEOMETRY_SHEAR_H_ +#define FLUTTER_IMPELLER_GEOMETRY_SHEAR_H_ #include @@ -30,3 +31,5 @@ struct Shear { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_GEOMETRY_SHEAR_H_ diff --git a/impeller/geometry/sigma.h b/impeller/geometry/sigma.h index c909128be4baa..9ea85498dbae4 100644 --- a/impeller/geometry/sigma.h +++ b/impeller/geometry/sigma.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GEOMETRY_SIGMA_H_ +#define FLUTTER_IMPELLER_GEOMETRY_SIGMA_H_ #include "impeller/geometry/scalar.h" @@ -55,3 +56,5 @@ struct Radius { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_GEOMETRY_SIGMA_H_ diff --git a/impeller/geometry/size.h b/impeller/geometry/size.h index d8f26994cc371..5c1c9c96c9528 100644 --- a/impeller/geometry/size.h +++ b/impeller/geometry/size.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GEOMETRY_SIZE_H_ +#define FLUTTER_IMPELLER_GEOMETRY_SIZE_H_ #include #include @@ -68,6 +69,8 @@ struct TSize { return {width - s.width, height - s.height}; } + constexpr TSize operator-() const { return {-width, -height}; } + constexpr TSize Min(const TSize& o) const { return { std::min(width, o.width), @@ -148,3 +151,5 @@ inline std::ostream& operator<<(std::ostream& out, } } // namespace std + +#endif // FLUTTER_IMPELLER_GEOMETRY_SIZE_H_ diff --git a/impeller/geometry/size_unittests.cc b/impeller/geometry/size_unittests.cc index e0857f0190fa9..9c1a65eebc00e 100644 --- a/impeller/geometry/size_unittests.cc +++ b/impeller/geometry/size_unittests.cc @@ -74,5 +74,12 @@ TEST(SizeTest, MaxDimension) { EXPECT_EQ(ISize(21, 20).MaxDimension(), 21); } +TEST(SizeTest, NegationOperator) { + EXPECT_EQ(-Size(10, 20), Size(-10, -20)); + EXPECT_EQ(-Size(-10, 20), Size(10, -20)); + EXPECT_EQ(-Size(10, -20), Size(-10, 20)); + EXPECT_EQ(-Size(-10, -20), Size(10, 20)); +} + } // namespace testing } // namespace impeller diff --git a/impeller/geometry/trig.h b/impeller/geometry/trig.h index 332c8ee1dd627..da43375744f77 100644 --- a/impeller/geometry/trig.h +++ b/impeller/geometry/trig.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GEOMETRY_TRIG_H_ +#define FLUTTER_IMPELLER_GEOMETRY_TRIG_H_ #include #include @@ -37,3 +38,5 @@ struct Trig { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_GEOMETRY_TRIG_H_ diff --git a/impeller/geometry/type_traits.h b/impeller/geometry/type_traits.h index 4e884d16c1eca..7fc0ac436040d 100644 --- a/impeller/geometry/type_traits.h +++ b/impeller/geometry/type_traits.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GEOMETRY_TYPE_TRAITS_H_ +#define FLUTTER_IMPELLER_GEOMETRY_TYPE_TRAITS_H_ #include @@ -18,3 +19,5 @@ template using MixedOp = typename MixedOp_::type; } // namespace impeller + +#endif // FLUTTER_IMPELLER_GEOMETRY_TYPE_TRAITS_H_ diff --git a/impeller/geometry/vector.h b/impeller/geometry/vector.h index b319776ff25df..eadf913297ac4 100644 --- a/impeller/geometry/vector.h +++ b/impeller/geometry/vector.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GEOMETRY_VECTOR_H_ +#define FLUTTER_IMPELLER_GEOMETRY_VECTOR_H_ #include #include @@ -329,3 +330,5 @@ inline std::ostream& operator<<(std::ostream& out, const impeller::Vector4& p) { // NOLINTEND(google-explicit-constructor) } // namespace std + +#endif // FLUTTER_IMPELLER_GEOMETRY_VECTOR_H_ diff --git a/impeller/golden_tests/BUILD.gn b/impeller/golden_tests/BUILD.gn index 0e1c7bd216e17..5b679c6a7e0d6 100644 --- a/impeller/golden_tests/BUILD.gn +++ b/impeller/golden_tests/BUILD.gn @@ -75,8 +75,8 @@ if (is_mac) { "//flutter/impeller/aiks", "//flutter/impeller/aiks:aiks_unittests_golden", "//flutter/impeller/fixtures", + "//flutter/third_party/swiftshader", "//third_party/googletest:gtest", - "//third_party/swiftshader", ] } } diff --git a/impeller/golden_tests/golden_digest.h b/impeller/golden_tests/golden_digest.h index 4ed422b8aa73d..aaa4e8fa00c2a 100644 --- a/impeller/golden_tests/golden_digest.h +++ b/impeller/golden_tests/golden_digest.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GOLDEN_TESTS_GOLDEN_DIGEST_H_ +#define FLUTTER_IMPELLER_GOLDEN_TESTS_GOLDEN_DIGEST_H_ #include #include @@ -51,3 +52,5 @@ class GoldenDigest { }; } // namespace testing } // namespace impeller + +#endif // FLUTTER_IMPELLER_GOLDEN_TESTS_GOLDEN_DIGEST_H_ diff --git a/impeller/golden_tests/golden_playground_test.h b/impeller/golden_tests/golden_playground_test.h index 4488dea7bba8b..d28ee1f3ae94e 100644 --- a/impeller/golden_tests/golden_playground_test.h +++ b/impeller/golden_tests/golden_playground_test.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GOLDEN_TESTS_GOLDEN_PLAYGROUND_TEST_H_ +#define FLUTTER_IMPELLER_GOLDEN_TESTS_GOLDEN_PLAYGROUND_TEST_H_ #include @@ -79,3 +80,5 @@ class GoldenPlaygroundTest }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_GOLDEN_TESTS_GOLDEN_PLAYGROUND_TEST_H_ diff --git a/impeller/golden_tests/metal_screenshot.h b/impeller/golden_tests/metal_screenshot.h index 3b4814746bf5d..d2f9dab09b52c 100644 --- a/impeller/golden_tests/metal_screenshot.h +++ b/impeller/golden_tests/metal_screenshot.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GOLDEN_TESTS_METAL_SCREENSHOT_H_ +#define FLUTTER_IMPELLER_GOLDEN_TESTS_METAL_SCREENSHOT_H_ #include #include @@ -39,3 +40,5 @@ class MetalScreenshot { }; } // namespace testing } // namespace impeller + +#endif // FLUTTER_IMPELLER_GOLDEN_TESTS_METAL_SCREENSHOT_H_ diff --git a/impeller/golden_tests/metal_screenshotter.h b/impeller/golden_tests/metal_screenshotter.h index c013cf27d3f48..292053dd660be 100644 --- a/impeller/golden_tests/metal_screenshotter.h +++ b/impeller/golden_tests/metal_screenshotter.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GOLDEN_TESTS_METAL_SCREENSHOTTER_H_ +#define FLUTTER_IMPELLER_GOLDEN_TESTS_METAL_SCREENSHOTTER_H_ #include "flutter/fml/macros.h" #include "flutter/impeller/aiks/picture.h" @@ -32,3 +33,5 @@ class MetalScreenshotter { } // namespace testing } // namespace impeller + +#endif // FLUTTER_IMPELLER_GOLDEN_TESTS_METAL_SCREENSHOTTER_H_ diff --git a/impeller/golden_tests/working_directory.h b/impeller/golden_tests/working_directory.h index fc507c97a864b..e6de4ef36f8ab 100644 --- a/impeller/golden_tests/working_directory.h +++ b/impeller/golden_tests/working_directory.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_GOLDEN_TESTS_WORKING_DIRECTORY_H_ +#define FLUTTER_IMPELLER_GOLDEN_TESTS_WORKING_DIRECTORY_H_ #include @@ -35,3 +36,5 @@ class WorkingDirectory { } // namespace testing } // namespace impeller + +#endif // FLUTTER_IMPELLER_GOLDEN_TESTS_WORKING_DIRECTORY_H_ diff --git a/impeller/image/backends/skia/compressed_image_skia.h b/impeller/image/backends/skia/compressed_image_skia.h index 4b940fdbf855d..1db71c2bdb855 100644 --- a/impeller/image/backends/skia/compressed_image_skia.h +++ b/impeller/image/backends/skia/compressed_image_skia.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_IMAGE_BACKENDS_SKIA_COMPRESSED_IMAGE_SKIA_H_ +#define FLUTTER_IMPELLER_IMAGE_BACKENDS_SKIA_COMPRESSED_IMAGE_SKIA_H_ #include "flutter/fml/macros.h" #include "impeller/image/compressed_image.h" @@ -28,3 +29,5 @@ class CompressedImageSkia final : public CompressedImage { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_IMAGE_BACKENDS_SKIA_COMPRESSED_IMAGE_SKIA_H_ diff --git a/impeller/image/compressed_image.h b/impeller/image/compressed_image.h index c758a632b94ad..69d69db81f928 100644 --- a/impeller/image/compressed_image.h +++ b/impeller/image/compressed_image.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_IMAGE_COMPRESSED_IMAGE_H_ +#define FLUTTER_IMPELLER_IMAGE_COMPRESSED_IMAGE_H_ #include @@ -30,3 +31,5 @@ class CompressedImage { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_IMAGE_COMPRESSED_IMAGE_H_ diff --git a/impeller/image/decompressed_image.h b/impeller/image/decompressed_image.h index 56bf9b15c5c4c..d6643b1a43119 100644 --- a/impeller/image/decompressed_image.h +++ b/impeller/image/decompressed_image.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_IMAGE_DECOMPRESSED_IMAGE_H_ +#define FLUTTER_IMPELLER_IMAGE_DECOMPRESSED_IMAGE_H_ #include #include @@ -49,3 +50,5 @@ class DecompressedImage { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_IMAGE_DECOMPRESSED_IMAGE_H_ diff --git a/impeller/playground/backend/gles/playground_impl_gles.h b/impeller/playground/backend/gles/playground_impl_gles.h index c16547583c9f2..d1e328230c47a 100644 --- a/impeller/playground/backend/gles/playground_impl_gles.h +++ b/impeller/playground/backend/gles/playground_impl_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_PLAYGROUND_BACKEND_GLES_PLAYGROUND_IMPL_GLES_H_ +#define FLUTTER_IMPELLER_PLAYGROUND_BACKEND_GLES_PLAYGROUND_IMPL_GLES_H_ #include "flutter/fml/macros.h" #include "impeller/playground/playground_impl.h" @@ -39,3 +40,5 @@ class PlaygroundImplGLES final : public PlaygroundImpl { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_PLAYGROUND_BACKEND_GLES_PLAYGROUND_IMPL_GLES_H_ diff --git a/impeller/playground/backend/metal/playground_impl_mtl.h b/impeller/playground/backend/metal/playground_impl_mtl.h index b9cf12cde43f2..937db7a753c42 100644 --- a/impeller/playground/backend/metal/playground_impl_mtl.h +++ b/impeller/playground/backend/metal/playground_impl_mtl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_PLAYGROUND_BACKEND_METAL_PLAYGROUND_IMPL_MTL_H_ +#define FLUTTER_IMPELLER_PLAYGROUND_BACKEND_METAL_PLAYGROUND_IMPL_MTL_H_ #include @@ -48,3 +49,5 @@ class PlaygroundImplMTL final : public PlaygroundImpl { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_PLAYGROUND_BACKEND_METAL_PLAYGROUND_IMPL_MTL_H_ diff --git a/impeller/playground/backend/vulkan/playground_impl_vk.h b/impeller/playground/backend/vulkan/playground_impl_vk.h index 0fa614224a42e..eed479b85947d 100644 --- a/impeller/playground/backend/vulkan/playground_impl_vk.h +++ b/impeller/playground/backend/vulkan/playground_impl_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_PLAYGROUND_BACKEND_VULKAN_PLAYGROUND_IMPL_VK_H_ +#define FLUTTER_IMPELLER_PLAYGROUND_BACKEND_VULKAN_PLAYGROUND_IMPL_VK_H_ #include "flutter/fml/macros.h" #include "impeller/playground/playground_impl.h" @@ -46,3 +47,5 @@ class PlaygroundImplVK final : public PlaygroundImpl { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_PLAYGROUND_BACKEND_VULKAN_PLAYGROUND_IMPL_VK_H_ diff --git a/impeller/playground/compute_playground_test.h b/impeller/playground/compute_playground_test.h index 3af883b66e261..1d426a2ae7eb5 100644 --- a/impeller/playground/compute_playground_test.h +++ b/impeller/playground/compute_playground_test.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_PLAYGROUND_COMPUTE_PLAYGROUND_TEST_H_ +#define FLUTTER_IMPELLER_PLAYGROUND_COMPUTE_PLAYGROUND_TEST_H_ #include @@ -66,3 +67,5 @@ class ComputePlaygroundTest info) { return PlaygroundBackendToString(info.param); }); } // namespace impeller + +#endif // FLUTTER_IMPELLER_PLAYGROUND_COMPUTE_PLAYGROUND_TEST_H_ diff --git a/impeller/playground/imgui/imgui_impl_impeller.h b/impeller/playground/imgui/imgui_impl_impeller.h index 8b60efc31b5bd..cfb624a61c5a9 100644 --- a/impeller/playground/imgui/imgui_impl_impeller.h +++ b/impeller/playground/imgui/imgui_impl_impeller.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_PLAYGROUND_IMGUI_IMGUI_IMPL_IMPELLER_H_ +#define FLUTTER_IMPELLER_PLAYGROUND_IMGUI_IMGUI_IMPL_IMPELLER_H_ #include @@ -23,3 +24,5 @@ IMGUI_IMPL_API void ImGui_ImplImpeller_Shutdown(); IMGUI_IMPL_API void ImGui_ImplImpeller_RenderDrawData( ImDrawData* draw_data, impeller::RenderPass& renderpass); + +#endif // FLUTTER_IMPELLER_PLAYGROUND_IMGUI_IMGUI_IMPL_IMPELLER_H_ diff --git a/impeller/playground/playground.h b/impeller/playground/playground.h index ee961485f0400..c9de5cc9cc185 100644 --- a/impeller/playground/playground.h +++ b/impeller/playground/playground.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_PLAYGROUND_PLAYGROUND_H_ +#define FLUTTER_IMPELLER_PLAYGROUND_PLAYGROUND_H_ #include #include @@ -113,3 +114,5 @@ class Playground { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_PLAYGROUND_PLAYGROUND_H_ diff --git a/impeller/playground/playground_impl.h b/impeller/playground/playground_impl.h index 6f43819c6d849..499859f62508d 100644 --- a/impeller/playground/playground_impl.h +++ b/impeller/playground/playground_impl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_PLAYGROUND_PLAYGROUND_IMPL_H_ +#define FLUTTER_IMPELLER_PLAYGROUND_PLAYGROUND_IMPL_H_ #include @@ -44,3 +45,5 @@ class PlaygroundImpl { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_PLAYGROUND_PLAYGROUND_IMPL_H_ diff --git a/impeller/playground/playground_test.h b/impeller/playground/playground_test.h index 7aba4ee891463..2d2539afa474c 100644 --- a/impeller/playground/playground_test.h +++ b/impeller/playground/playground_test.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_PLAYGROUND_PLAYGROUND_TEST_H_ +#define FLUTTER_IMPELLER_PLAYGROUND_PLAYGROUND_TEST_H_ #include @@ -68,3 +69,5 @@ class PlaygroundTest : public Playground, }); } // namespace impeller + +#endif // FLUTTER_IMPELLER_PLAYGROUND_PLAYGROUND_TEST_H_ diff --git a/impeller/playground/switches.h b/impeller/playground/switches.h index 662f7b153b381..1e28a37b195c9 100644 --- a/impeller/playground/switches.h +++ b/impeller/playground/switches.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_PLAYGROUND_SWITCHES_H_ +#define FLUTTER_IMPELLER_PLAYGROUND_SWITCHES_H_ #include #include @@ -26,3 +27,5 @@ struct PlaygroundSwitches { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_PLAYGROUND_SWITCHES_H_ diff --git a/impeller/playground/widgets.h b/impeller/playground/widgets.h index e80d960d70455..59957451b1ddf 100644 --- a/impeller/playground/widgets.h +++ b/impeller/playground/widgets.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_PLAYGROUND_WIDGETS_H_ +#define FLUTTER_IMPELLER_PLAYGROUND_WIDGETS_H_ #include @@ -73,3 +74,5 @@ \ std::make_tuple(position_a, position_b); \ }) + +#endif // FLUTTER_IMPELLER_PLAYGROUND_WIDGETS_H_ diff --git a/impeller/renderer/backend/gles/allocator_gles.h b/impeller/renderer/backend/gles/allocator_gles.h index e36b3515b7c79..a78980382b65d 100644 --- a/impeller/renderer/backend/gles/allocator_gles.h +++ b/impeller/renderer/backend/gles/allocator_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_ALLOCATOR_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_ALLOCATOR_GLES_H_ #include "flutter/fml/macros.h" #include "impeller/core/allocator.h" @@ -43,3 +44,5 @@ class AllocatorGLES final : public Allocator { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_ALLOCATOR_GLES_H_ diff --git a/impeller/renderer/backend/gles/blit_command_gles.h b/impeller/renderer/backend/gles/blit_command_gles.h index 570b1f19d30fb..5fa9c802f3a5b 100644 --- a/impeller/renderer/backend/gles/blit_command_gles.h +++ b/impeller/renderer/backend/gles/blit_command_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_BLIT_COMMAND_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_BLIT_COMMAND_GLES_H_ #include "impeller/base/backend_cast.h" #include "impeller/renderer/backend/gles/reactor_gles.h" @@ -49,3 +50,5 @@ struct BlitGenerateMipmapCommandGLES : public BlitEncodeGLES, }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_BLIT_COMMAND_GLES_H_ diff --git a/impeller/renderer/backend/gles/blit_pass_gles.h b/impeller/renderer/backend/gles/blit_pass_gles.h index 857a9ca153880..b38fa0da634c1 100644 --- a/impeller/renderer/backend/gles/blit_pass_gles.h +++ b/impeller/renderer/backend/gles/blit_pass_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_BLIT_PASS_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_BLIT_PASS_GLES_H_ #include @@ -72,3 +73,5 @@ class BlitPassGLES final : public BlitPass, }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_BLIT_PASS_GLES_H_ diff --git a/impeller/renderer/backend/gles/buffer_bindings_gles.h b/impeller/renderer/backend/gles/buffer_bindings_gles.h index c30e4e631b887..17f5a5a7b175c 100644 --- a/impeller/renderer/backend/gles/buffer_bindings_gles.h +++ b/impeller/renderer/backend/gles/buffer_bindings_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_BUFFER_BINDINGS_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_BUFFER_BINDINGS_GLES_H_ #include #include @@ -81,3 +82,5 @@ class BufferBindingsGLES { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_BUFFER_BINDINGS_GLES_H_ diff --git a/impeller/renderer/backend/gles/capabilities_gles.h b/impeller/renderer/backend/gles/capabilities_gles.h index 921d3a4287cac..baa6d76d378c2 100644 --- a/impeller/renderer/backend/gles/capabilities_gles.h +++ b/impeller/renderer/backend/gles/capabilities_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_CAPABILITIES_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_CAPABILITIES_GLES_H_ #include @@ -123,3 +124,5 @@ class CapabilitiesGLES final }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_CAPABILITIES_GLES_H_ diff --git a/impeller/renderer/backend/gles/command_buffer_gles.h b/impeller/renderer/backend/gles/command_buffer_gles.h index 6cc4ff3c68dad..23441a1a78e4f 100644 --- a/impeller/renderer/backend/gles/command_buffer_gles.h +++ b/impeller/renderer/backend/gles/command_buffer_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_COMMAND_BUFFER_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_COMMAND_BUFFER_GLES_H_ #include "flutter/fml/macros.h" #include "impeller/renderer/backend/gles/reactor_gles.h" @@ -52,3 +53,5 @@ class CommandBufferGLES final : public CommandBuffer { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_COMMAND_BUFFER_GLES_H_ diff --git a/impeller/renderer/backend/gles/context_gles.h b/impeller/renderer/backend/gles/context_gles.h index 5bfb5d399749d..a81b10ec75fb3 100644 --- a/impeller/renderer/backend/gles/context_gles.h +++ b/impeller/renderer/backend/gles/context_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_CONTEXT_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_CONTEXT_GLES_H_ #include #include @@ -96,3 +97,5 @@ class ContextGLES final : public Context, }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_CONTEXT_GLES_H_ diff --git a/impeller/renderer/backend/gles/description_gles.h b/impeller/renderer/backend/gles/description_gles.h index 1ef07ed36e506..dac13cab61422 100644 --- a/impeller/renderer/backend/gles/description_gles.h +++ b/impeller/renderer/backend/gles/description_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_DESCRIPTION_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_DESCRIPTION_GLES_H_ #include #include @@ -48,3 +49,5 @@ class DescriptionGLES { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_DESCRIPTION_GLES_H_ diff --git a/impeller/renderer/backend/gles/device_buffer_gles.h b/impeller/renderer/backend/gles/device_buffer_gles.h index 65661059bab96..8aee746127fea 100644 --- a/impeller/renderer/backend/gles/device_buffer_gles.h +++ b/impeller/renderer/backend/gles/device_buffer_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_DEVICE_BUFFER_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_DEVICE_BUFFER_GLES_H_ #include #include @@ -65,3 +66,5 @@ class DeviceBufferGLES final }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_DEVICE_BUFFER_GLES_H_ diff --git a/impeller/renderer/backend/gles/formats_gles.h b/impeller/renderer/backend/gles/formats_gles.h index b4296fbfe264a..02adb19941fce 100644 --- a/impeller/renderer/backend/gles/formats_gles.h +++ b/impeller/renderer/backend/gles/formats_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_FORMATS_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_FORMATS_GLES_H_ #include @@ -197,3 +198,5 @@ constexpr std::optional ToTextureTarget(TextureType type) { std::string DebugToFramebufferError(int status); } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_FORMATS_GLES_H_ diff --git a/impeller/renderer/backend/gles/gles.h b/impeller/renderer/backend/gles/gles.h index 9022cd02cfe88..b3a512e0d23f5 100644 --- a/impeller/renderer/backend/gles/gles.h +++ b/impeller/renderer/backend/gles/gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_GLES_H_ // IWYU pragma: begin_exports #include "GLES3/gl3.h" @@ -14,3 +15,5 @@ #define GL_GLEXT_PROTOTYPES #include "GLES2/gl2ext.h" // IWYU pragma: end_exports + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_GLES_H_ diff --git a/impeller/renderer/backend/gles/gpu_tracer_gles.h b/impeller/renderer/backend/gles/gpu_tracer_gles.h index f0f4397480267..f6b0de8ab9be6 100644 --- a/impeller/renderer/backend/gles/gpu_tracer_gles.h +++ b/impeller/renderer/backend/gles/gpu_tracer_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_GPU_TRACER_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_GPU_TRACER_GLES_H_ #include #include @@ -50,3 +51,5 @@ class GPUTracerGLES { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_GPU_TRACER_GLES_H_ diff --git a/impeller/renderer/backend/gles/handle_gles.h b/impeller/renderer/backend/gles/handle_gles.h index 3340310f41db6..a6fefd5923187 100644 --- a/impeller/renderer/backend/gles/handle_gles.h +++ b/impeller/renderer/backend/gles/handle_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_HANDLE_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_HANDLE_GLES_H_ #include #include @@ -89,3 +90,5 @@ inline std::ostream& operator<<(std::ostream& out, } } // namespace std + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_HANDLE_GLES_H_ diff --git a/impeller/renderer/backend/gles/pipeline_gles.h b/impeller/renderer/backend/gles/pipeline_gles.h index 6ea8fe1102689..9dfed8d807434 100644 --- a/impeller/renderer/backend/gles/pipeline_gles.h +++ b/impeller/renderer/backend/gles/pipeline_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_PIPELINE_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_PIPELINE_GLES_H_ #include "flutter/fml/macros.h" #include "impeller/base/backend_cast.h" @@ -54,3 +55,5 @@ class PipelineGLES final }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_PIPELINE_GLES_H_ diff --git a/impeller/renderer/backend/gles/pipeline_library_gles.h b/impeller/renderer/backend/gles/pipeline_library_gles.h index 74831525ae150..410fcb991a90c 100644 --- a/impeller/renderer/backend/gles/pipeline_library_gles.h +++ b/impeller/renderer/backend/gles/pipeline_library_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_PIPELINE_LIBRARY_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_PIPELINE_LIBRARY_GLES_H_ #include "flutter/fml/macros.h" #include "impeller/renderer/backend/gles/reactor_gles.h" @@ -46,3 +47,5 @@ class PipelineLibraryGLES final : public PipelineLibrary { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_PIPELINE_LIBRARY_GLES_H_ diff --git a/impeller/renderer/backend/gles/proc_table_gles.h b/impeller/renderer/backend/gles/proc_table_gles.h index 03af427d8bacf..7e2bfd0f339d9 100644 --- a/impeller/renderer/backend/gles/proc_table_gles.h +++ b/impeller/renderer/backend/gles/proc_table_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_PROC_TABLE_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_PROC_TABLE_GLES_H_ #include #include @@ -276,3 +277,5 @@ class ProcTableGLES { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_PROC_TABLE_GLES_H_ diff --git a/impeller/renderer/backend/gles/reactor_gles.h b/impeller/renderer/backend/gles/reactor_gles.h index 5922076943801..eff7c349819d9 100644 --- a/impeller/renderer/backend/gles/reactor_gles.h +++ b/impeller/renderer/backend/gles/reactor_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_REACTOR_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_REACTOR_GLES_H_ #include #include @@ -271,3 +272,5 @@ class ReactorGLES { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_REACTOR_GLES_H_ diff --git a/impeller/renderer/backend/gles/render_pass_gles.h b/impeller/renderer/backend/gles/render_pass_gles.h index 30bcd7474e47b..2a003e6bdc66e 100644 --- a/impeller/renderer/backend/gles/render_pass_gles.h +++ b/impeller/renderer/backend/gles/render_pass_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_RENDER_PASS_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_RENDER_PASS_GLES_H_ #include @@ -45,3 +46,5 @@ class RenderPassGLES final }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_RENDER_PASS_GLES_H_ diff --git a/impeller/renderer/backend/gles/sampler_gles.h b/impeller/renderer/backend/gles/sampler_gles.h index 62583054acc76..58b7f66cd5669 100644 --- a/impeller/renderer/backend/gles/sampler_gles.h +++ b/impeller/renderer/backend/gles/sampler_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_SAMPLER_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_SAMPLER_GLES_H_ #include "flutter/fml/macros.h" #include "impeller/base/backend_cast.h" @@ -36,3 +37,5 @@ class SamplerGLES final : public Sampler, }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_SAMPLER_GLES_H_ diff --git a/impeller/renderer/backend/gles/sampler_library_gles.h b/impeller/renderer/backend/gles/sampler_library_gles.h index 06e60c8594506..47b5f429ce58d 100644 --- a/impeller/renderer/backend/gles/sampler_library_gles.h +++ b/impeller/renderer/backend/gles/sampler_library_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_SAMPLER_LIBRARY_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_SAMPLER_LIBRARY_GLES_H_ #include "flutter/fml/macros.h" #include "impeller/core/sampler_descriptor.h" @@ -35,3 +36,5 @@ class SamplerLibraryGLES final : public SamplerLibrary { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_SAMPLER_LIBRARY_GLES_H_ diff --git a/impeller/renderer/backend/gles/shader_function_gles.h b/impeller/renderer/backend/gles/shader_function_gles.h index 1888bdfd2a3d4..97bf2a49dc573 100644 --- a/impeller/renderer/backend/gles/shader_function_gles.h +++ b/impeller/renderer/backend/gles/shader_function_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_SHADER_FUNCTION_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_SHADER_FUNCTION_GLES_H_ #include @@ -40,3 +41,5 @@ class ShaderFunctionGLES final }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_SHADER_FUNCTION_GLES_H_ diff --git a/impeller/renderer/backend/gles/shader_library_gles.h b/impeller/renderer/backend/gles/shader_library_gles.h index b2acd2228182f..8c10a638c8237 100644 --- a/impeller/renderer/backend/gles/shader_library_gles.h +++ b/impeller/renderer/backend/gles/shader_library_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_SHADER_LIBRARY_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_SHADER_LIBRARY_GLES_H_ #include @@ -52,3 +53,5 @@ class ShaderLibraryGLES final : public ShaderLibrary { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_SHADER_LIBRARY_GLES_H_ diff --git a/impeller/renderer/backend/gles/surface_gles.h b/impeller/renderer/backend/gles/surface_gles.h index e4eb8bc891b37..1b040598d3994 100644 --- a/impeller/renderer/backend/gles/surface_gles.h +++ b/impeller/renderer/backend/gles/surface_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_SURFACE_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_SURFACE_GLES_H_ #include #include @@ -42,3 +43,5 @@ class SurfaceGLES final : public Surface { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_SURFACE_GLES_H_ diff --git a/impeller/renderer/backend/gles/texture_gles.h b/impeller/renderer/backend/gles/texture_gles.h index 5ade7d3a0c7cb..704d0ef3a8503 100644 --- a/impeller/renderer/backend/gles/texture_gles.h +++ b/impeller/renderer/backend/gles/texture_gles.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_TEXTURE_GLES_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_TEXTURE_GLES_H_ #include "impeller/base/backend_cast.h" #include "impeller/core/texture.h" @@ -95,3 +96,5 @@ class TextureGLES final : public Texture, }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_TEXTURE_GLES_H_ diff --git a/impeller/renderer/backend/metal/allocator_mtl.h b/impeller/renderer/backend/metal/allocator_mtl.h index fc0dc5ee62029..2d097e16b8b76 100644 --- a/impeller/renderer/backend/metal/allocator_mtl.h +++ b/impeller/renderer/backend/metal/allocator_mtl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_ALLOCATOR_MTL_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_ALLOCATOR_MTL_H_ #include @@ -53,3 +54,5 @@ class AllocatorMTL final : public Allocator { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_ALLOCATOR_MTL_H_ diff --git a/impeller/renderer/backend/metal/blit_command_mtl.h b/impeller/renderer/backend/metal/blit_command_mtl.h index 86062e9c04cde..90dad1956090c 100644 --- a/impeller/renderer/backend/metal/blit_command_mtl.h +++ b/impeller/renderer/backend/metal/blit_command_mtl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_BLIT_COMMAND_MTL_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_BLIT_COMMAND_MTL_H_ #include @@ -61,3 +62,5 @@ struct BlitCopyBufferToTextureCommandMTL }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_BLIT_COMMAND_MTL_H_ diff --git a/impeller/renderer/backend/metal/blit_pass_mtl.h b/impeller/renderer/backend/metal/blit_pass_mtl.h index 4a2ef0caf8dd2..68d0c2d409648 100644 --- a/impeller/renderer/backend/metal/blit_pass_mtl.h +++ b/impeller/renderer/backend/metal/blit_pass_mtl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_BLIT_PASS_MTL_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_BLIT_PASS_MTL_H_ #include @@ -68,3 +69,5 @@ class BlitPassMTL final : public BlitPass { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_BLIT_PASS_MTL_H_ diff --git a/impeller/renderer/backend/metal/command_buffer_mtl.h b/impeller/renderer/backend/metal/command_buffer_mtl.h index 7e167fa2b3a5d..735142b59a2a3 100644 --- a/impeller/renderer/backend/metal/command_buffer_mtl.h +++ b/impeller/renderer/backend/metal/command_buffer_mtl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_COMMAND_BUFFER_MTL_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_COMMAND_BUFFER_MTL_H_ #include @@ -59,3 +60,5 @@ class CommandBufferMTL final : public CommandBuffer { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_COMMAND_BUFFER_MTL_H_ diff --git a/impeller/renderer/backend/metal/compute_pass_mtl.h b/impeller/renderer/backend/metal/compute_pass_mtl.h index 7c06e8647884f..812749639def4 100644 --- a/impeller/renderer/backend/metal/compute_pass_mtl.h +++ b/impeller/renderer/backend/metal/compute_pass_mtl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_COMPUTE_PASS_MTL_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_COMPUTE_PASS_MTL_H_ #include @@ -48,3 +49,5 @@ class ComputePassMTL final : public ComputePass { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_COMPUTE_PASS_MTL_H_ diff --git a/impeller/renderer/backend/metal/compute_pipeline_mtl.h b/impeller/renderer/backend/metal/compute_pipeline_mtl.h index 39ca1b3bac0d6..1ab1277c04cce 100644 --- a/impeller/renderer/backend/metal/compute_pipeline_mtl.h +++ b/impeller/renderer/backend/metal/compute_pipeline_mtl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_COMPUTE_PIPELINE_MTL_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_COMPUTE_PIPELINE_MTL_H_ #include @@ -41,3 +42,5 @@ class ComputePipelineMTL final }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_COMPUTE_PIPELINE_MTL_H_ diff --git a/impeller/renderer/backend/metal/context_mtl.h b/impeller/renderer/backend/metal/context_mtl.h index 91b30a9c8aa5d..a3ce8d7fa3c4f 100644 --- a/impeller/renderer/backend/metal/context_mtl.h +++ b/impeller/renderer/backend/metal/context_mtl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_CONTEXT_MTL_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_CONTEXT_MTL_H_ #include @@ -145,3 +146,5 @@ class ContextMTL final : public Context, }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_CONTEXT_MTL_H_ diff --git a/impeller/renderer/backend/metal/device_buffer_mtl.h b/impeller/renderer/backend/metal/device_buffer_mtl.h index 0547deaa7a9ed..93e548895ef8c 100644 --- a/impeller/renderer/backend/metal/device_buffer_mtl.h +++ b/impeller/renderer/backend/metal/device_buffer_mtl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_DEVICE_BUFFER_MTL_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_DEVICE_BUFFER_MTL_H_ #include @@ -57,3 +58,5 @@ class DeviceBufferMTL final : public DeviceBuffer, }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_DEVICE_BUFFER_MTL_H_ diff --git a/impeller/renderer/backend/metal/formats_mtl.h b/impeller/renderer/backend/metal/formats_mtl.h index 95212ce7d6881..f476688709333 100644 --- a/impeller/renderer/backend/metal/formats_mtl.h +++ b/impeller/renderer/backend/metal/formats_mtl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_FORMATS_MTL_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_FORMATS_MTL_H_ #include @@ -399,3 +400,5 @@ MTLDepthStencilDescriptor* ToMTLDepthStencilDescriptor( MTLTextureDescriptor* ToMTLTextureDescriptor(const TextureDescriptor& desc); } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_FORMATS_MTL_H_ diff --git a/impeller/renderer/backend/metal/gpu_tracer_mtl.h b/impeller/renderer/backend/metal/gpu_tracer_mtl.h index ac2c3916d0207..94ada1b97d47d 100644 --- a/impeller/renderer/backend/metal/gpu_tracer_mtl.h +++ b/impeller/renderer/backend/metal/gpu_tracer_mtl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_GPU_TRACER_MTL_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_GPU_TRACER_MTL_H_ #include @@ -46,3 +47,5 @@ class GPUTracerMTL : public std::enable_shared_from_this { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_GPU_TRACER_MTL_H_ diff --git a/impeller/renderer/backend/metal/lazy_drawable_holder.h b/impeller/renderer/backend/metal/lazy_drawable_holder.h index 5062e453e5d00..c01975b978a1e 100644 --- a/impeller/renderer/backend/metal/lazy_drawable_holder.h +++ b/impeller/renderer/backend/metal/lazy_drawable_holder.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_LAZY_DRAWABLE_HOLDER_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_LAZY_DRAWABLE_HOLDER_H_ #include @@ -28,3 +29,5 @@ std::shared_ptr CreateTextureFromDrawableFuture( const std::shared_future>& drawble_future); } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_LAZY_DRAWABLE_HOLDER_H_ diff --git a/impeller/renderer/backend/metal/pipeline_library_mtl.h b/impeller/renderer/backend/metal/pipeline_library_mtl.h index 06489545e9210..7b12ebbd74b90 100644 --- a/impeller/renderer/backend/metal/pipeline_library_mtl.h +++ b/impeller/renderer/backend/metal/pipeline_library_mtl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_PIPELINE_LIBRARY_MTL_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_PIPELINE_LIBRARY_MTL_H_ #include @@ -50,3 +51,5 @@ class PipelineLibraryMTL final : public PipelineLibrary { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_PIPELINE_LIBRARY_MTL_H_ diff --git a/impeller/renderer/backend/metal/pipeline_mtl.h b/impeller/renderer/backend/metal/pipeline_mtl.h index d7a03d6b71c29..b9aca9df8a599 100644 --- a/impeller/renderer/backend/metal/pipeline_mtl.h +++ b/impeller/renderer/backend/metal/pipeline_mtl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_PIPELINE_MTL_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_PIPELINE_MTL_H_ #include @@ -44,3 +45,5 @@ class PipelineMTL final }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_PIPELINE_MTL_H_ diff --git a/impeller/renderer/backend/metal/render_pass_mtl.h b/impeller/renderer/backend/metal/render_pass_mtl.h index 6a3d7469df170..69c78573e8add 100644 --- a/impeller/renderer/backend/metal/render_pass_mtl.h +++ b/impeller/renderer/backend/metal/render_pass_mtl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_RENDER_PASS_MTL_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_RENDER_PASS_MTL_H_ #include @@ -47,3 +48,5 @@ class RenderPassMTL final : public RenderPass { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_RENDER_PASS_MTL_H_ diff --git a/impeller/renderer/backend/metal/sampler_library_mtl.h b/impeller/renderer/backend/metal/sampler_library_mtl.h index 84bf62e493c49..c787666572729 100644 --- a/impeller/renderer/backend/metal/sampler_library_mtl.h +++ b/impeller/renderer/backend/metal/sampler_library_mtl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SAMPLER_LIBRARY_MTL_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SAMPLER_LIBRARY_MTL_H_ #include @@ -41,3 +42,5 @@ class SamplerLibraryMTL final }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SAMPLER_LIBRARY_MTL_H_ diff --git a/impeller/renderer/backend/metal/sampler_mtl.h b/impeller/renderer/backend/metal/sampler_mtl.h index 55ee66b4a0b4c..3a9a0fe6b273f 100644 --- a/impeller/renderer/backend/metal/sampler_mtl.h +++ b/impeller/renderer/backend/metal/sampler_mtl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SAMPLER_MTL_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SAMPLER_MTL_H_ #include @@ -40,3 +41,5 @@ class SamplerMTL final : public Sampler, }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SAMPLER_MTL_H_ diff --git a/impeller/renderer/backend/metal/shader_function_mtl.h b/impeller/renderer/backend/metal/shader_function_mtl.h index fc3008d36fa8d..7375421b02e74 100644 --- a/impeller/renderer/backend/metal/shader_function_mtl.h +++ b/impeller/renderer/backend/metal/shader_function_mtl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SHADER_FUNCTION_MTL_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SHADER_FUNCTION_MTL_H_ #include @@ -44,3 +45,5 @@ class ShaderFunctionMTL final }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SHADER_FUNCTION_MTL_H_ diff --git a/impeller/renderer/backend/metal/shader_library_mtl.h b/impeller/renderer/backend/metal/shader_library_mtl.h index c401696c7ec45..756cf5fe4c95f 100644 --- a/impeller/renderer/backend/metal/shader_library_mtl.h +++ b/impeller/renderer/backend/metal/shader_library_mtl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SHADER_LIBRARY_MTL_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SHADER_LIBRARY_MTL_H_ #include #include @@ -64,3 +65,5 @@ class ShaderLibraryMTL final : public ShaderLibrary { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SHADER_LIBRARY_MTL_H_ diff --git a/impeller/renderer/backend/metal/surface_mtl.h b/impeller/renderer/backend/metal/surface_mtl.h index 1a21d72eefcaf..a933ecff87a36 100644 --- a/impeller/renderer/backend/metal/surface_mtl.h +++ b/impeller/renderer/backend/metal/surface_mtl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SURFACE_MTL_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SURFACE_MTL_H_ #include #include @@ -87,3 +88,5 @@ class SurfaceMTL final : public Surface { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SURFACE_MTL_H_ diff --git a/impeller/renderer/backend/metal/texture_mtl.h b/impeller/renderer/backend/metal/texture_mtl.h index 632b0491e56b3..0e6992af5b534 100644 --- a/impeller/renderer/backend/metal/texture_mtl.h +++ b/impeller/renderer/backend/metal/texture_mtl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_TEXTURE_MTL_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_TEXTURE_MTL_H_ #include @@ -73,3 +74,5 @@ class TextureMTL final : public Texture, }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_TEXTURE_MTL_H_ diff --git a/impeller/renderer/backend/metal/texture_wrapper_mtl.h b/impeller/renderer/backend/metal/texture_wrapper_mtl.h index e6fe71f0f22e6..1402bd79dc1ff 100644 --- a/impeller/renderer/backend/metal/texture_wrapper_mtl.h +++ b/impeller/renderer/backend/metal/texture_wrapper_mtl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_TEXTURE_WRAPPER_MTL_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_TEXTURE_WRAPPER_MTL_H_ #include "impeller/core/texture.h" @@ -14,3 +15,5 @@ std::shared_ptr WrapTextureMTL( std::function deletion_proc = nullptr); } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_TEXTURE_WRAPPER_MTL_H_ diff --git a/impeller/renderer/backend/metal/vertex_descriptor_mtl.h b/impeller/renderer/backend/metal/vertex_descriptor_mtl.h index e153e2f1494d0..65c4a9545c446 100644 --- a/impeller/renderer/backend/metal/vertex_descriptor_mtl.h +++ b/impeller/renderer/backend/metal/vertex_descriptor_mtl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_VERTEX_DESCRIPTOR_MTL_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_VERTEX_DESCRIPTOR_MTL_H_ #include @@ -35,3 +36,5 @@ class VertexDescriptorMTL { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_VERTEX_DESCRIPTOR_MTL_H_ diff --git a/impeller/renderer/backend/vulkan/allocator_vk.h b/impeller/renderer/backend/vulkan/allocator_vk.h index 1977b79115358..51be4d8eb9521 100644 --- a/impeller/renderer/backend/vulkan/allocator_vk.h +++ b/impeller/renderer/backend/vulkan/allocator_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_ALLOCATOR_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_ALLOCATOR_VK_H_ #include "flutter/fml/macros.h" #include "flutter/fml/memory/ref_ptr.h" @@ -69,3 +70,5 @@ class AllocatorVK final : public Allocator { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_ALLOCATOR_VK_H_ diff --git a/impeller/renderer/backend/vulkan/android_hardware_buffer_texture_source_vk.h b/impeller/renderer/backend/vulkan/android_hardware_buffer_texture_source_vk.h index 7580c4ff60c8b..1efe7fa52aaea 100644 --- a/impeller/renderer/backend/vulkan/android_hardware_buffer_texture_source_vk.h +++ b/impeller/renderer/backend/vulkan/android_hardware_buffer_texture_source_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_ANDROID_HARDWARE_BUFFER_TEXTURE_SOURCE_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_ANDROID_HARDWARE_BUFFER_TEXTURE_SOURCE_VK_H_ #include "flutter/fml/build_config.h" #include "vulkan/vulkan_core.h" @@ -57,3 +58,5 @@ class AndroidHardwareBufferTextureSourceVK final : public TextureSourceVK { } // namespace impeller #endif + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_ANDROID_HARDWARE_BUFFER_TEXTURE_SOURCE_VK_H_ diff --git a/impeller/renderer/backend/vulkan/barrier_vk.h b/impeller/renderer/backend/vulkan/barrier_vk.h index 9dc7bd02681b9..b4bc2257899b1 100644 --- a/impeller/renderer/backend/vulkan/barrier_vk.h +++ b/impeller/renderer/backend/vulkan/barrier_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_BARRIER_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_BARRIER_VK_H_ #include "flutter/fml/macros.h" #include "impeller/renderer/backend/vulkan/vk.h" @@ -43,3 +44,5 @@ struct BarrierVK { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_BARRIER_VK_H_ diff --git a/impeller/renderer/backend/vulkan/binding_helpers_vk.h b/impeller/renderer/backend/vulkan/binding_helpers_vk.h index 14d3145a8d26b..b232d360cf4d4 100644 --- a/impeller/renderer/backend/vulkan/binding_helpers_vk.h +++ b/impeller/renderer/backend/vulkan/binding_helpers_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_BINDING_HELPERS_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_BINDING_HELPERS_VK_H_ #include @@ -26,3 +27,5 @@ fml::StatusOr> AllocateAndBindDescriptorSets( const std::vector& commands); } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_BINDING_HELPERS_VK_H_ diff --git a/impeller/renderer/backend/vulkan/blit_command_vk.h b/impeller/renderer/backend/vulkan/blit_command_vk.h index dbbf5881556a3..7fa7589e55be7 100644 --- a/impeller/renderer/backend/vulkan/blit_command_vk.h +++ b/impeller/renderer/backend/vulkan/blit_command_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_BLIT_COMMAND_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_BLIT_COMMAND_VK_H_ #include #include "impeller/base/backend_cast.h" @@ -62,3 +63,5 @@ struct BlitGenerateMipmapCommandVK : public BlitGenerateMipmapCommand, }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_BLIT_COMMAND_VK_H_ diff --git a/impeller/renderer/backend/vulkan/blit_pass_vk.h b/impeller/renderer/backend/vulkan/blit_pass_vk.h index 1175dcab96bd8..2fc0c26380986 100644 --- a/impeller/renderer/backend/vulkan/blit_pass_vk.h +++ b/impeller/renderer/backend/vulkan/blit_pass_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_BLIT_PASS_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_BLIT_PASS_VK_H_ #include "flutter/fml/macros.h" #include "flutter/impeller/base/config.h" @@ -67,3 +68,5 @@ class BlitPassVK final : public BlitPass { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_BLIT_PASS_VK_H_ diff --git a/impeller/renderer/backend/vulkan/capabilities_vk.h b/impeller/renderer/backend/vulkan/capabilities_vk.h index eb9eb08a6f7a0..4cb7ce8996600 100644 --- a/impeller/renderer/backend/vulkan/capabilities_vk.h +++ b/impeller/renderer/backend/vulkan/capabilities_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_CAPABILITIES_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_CAPABILITIES_VK_H_ #include #include @@ -124,3 +125,5 @@ class CapabilitiesVK final : public Capabilities, }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_CAPABILITIES_VK_H_ diff --git a/impeller/renderer/backend/vulkan/command_buffer_vk.h b/impeller/renderer/backend/vulkan/command_buffer_vk.h index 405aba0b57fa9..b1ede05b724f0 100644 --- a/impeller/renderer/backend/vulkan/command_buffer_vk.h +++ b/impeller/renderer/backend/vulkan/command_buffer_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMMAND_BUFFER_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMMAND_BUFFER_VK_H_ #include "flutter/fml/macros.h" #include "impeller/base/backend_cast.h" @@ -61,3 +62,5 @@ class CommandBufferVK final }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMMAND_BUFFER_VK_H_ diff --git a/impeller/renderer/backend/vulkan/command_encoder_vk.h b/impeller/renderer/backend/vulkan/command_encoder_vk.h index 5455647b74221..612c63f213034 100644 --- a/impeller/renderer/backend/vulkan/command_encoder_vk.h +++ b/impeller/renderer/backend/vulkan/command_encoder_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMMAND_ENCODER_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMMAND_ENCODER_VK_H_ #include #include @@ -104,3 +105,5 @@ class CommandEncoderVK { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMMAND_ENCODER_VK_H_ diff --git a/impeller/renderer/backend/vulkan/command_pool_vk.h b/impeller/renderer/backend/vulkan/command_pool_vk.h index 04a799040186f..6fb1bcadcd3e2 100644 --- a/impeller/renderer/backend/vulkan/command_pool_vk.h +++ b/impeller/renderer/backend/vulkan/command_pool_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMMAND_POOL_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMMAND_POOL_VK_H_ #include #include @@ -146,3 +147,5 @@ class CommandPoolRecyclerVK final }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMMAND_POOL_VK_H_ diff --git a/impeller/renderer/backend/vulkan/compute_pass_vk.h b/impeller/renderer/backend/vulkan/compute_pass_vk.h index 0944e9529ff6a..caf88577bc5dd 100644 --- a/impeller/renderer/backend/vulkan/compute_pass_vk.h +++ b/impeller/renderer/backend/vulkan/compute_pass_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMPUTE_PASS_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMPUTE_PASS_VK_H_ #include "flutter/fml/macros.h" #include "impeller/renderer/backend/vulkan/command_encoder_vk.h" @@ -39,4 +40,5 @@ class ComputePassVK final : public ComputePass { const ISize& thread_group_size) const override; }; -} // namespace impeller \ No newline at end of file +} // namespace impeller +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMPUTE_PASS_VK_H_ diff --git a/impeller/renderer/backend/vulkan/compute_pipeline_vk.h b/impeller/renderer/backend/vulkan/compute_pipeline_vk.h index bf6d53a2f940a..3ad7117b454c1 100644 --- a/impeller/renderer/backend/vulkan/compute_pipeline_vk.h +++ b/impeller/renderer/backend/vulkan/compute_pipeline_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMPUTE_PIPELINE_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMPUTE_PIPELINE_VK_H_ #include @@ -53,3 +54,5 @@ class ComputePipelineVK final }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMPUTE_PIPELINE_VK_H_ diff --git a/impeller/renderer/backend/vulkan/context_vk.h b/impeller/renderer/backend/vulkan/context_vk.h index 33bfcfa346916..2bb9927dca65d 100644 --- a/impeller/renderer/backend/vulkan/context_vk.h +++ b/impeller/renderer/backend/vulkan/context_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_CONTEXT_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_CONTEXT_VK_H_ #include @@ -216,3 +217,5 @@ class ContextVK final : public Context, }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_CONTEXT_VK_H_ diff --git a/impeller/renderer/backend/vulkan/debug_report_vk.h b/impeller/renderer/backend/vulkan/debug_report_vk.h index a81d0a27a5543..b6ca88f3f4512 100644 --- a/impeller/renderer/backend/vulkan/debug_report_vk.h +++ b/impeller/renderer/backend/vulkan/debug_report_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_DEBUG_REPORT_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_DEBUG_REPORT_VK_H_ #include "flutter/fml/macros.h" #include "impeller/renderer/backend/vulkan/vk.h" @@ -44,3 +45,5 @@ class DebugReportVK { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_DEBUG_REPORT_VK_H_ diff --git a/impeller/renderer/backend/vulkan/descriptor_pool_vk.h b/impeller/renderer/backend/vulkan/descriptor_pool_vk.h index 8d2fb7c45ccb2..f4965ec224f6a 100644 --- a/impeller/renderer/backend/vulkan/descriptor_pool_vk.h +++ b/impeller/renderer/backend/vulkan/descriptor_pool_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_DESCRIPTOR_POOL_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_DESCRIPTOR_POOL_VK_H_ #include @@ -119,3 +120,5 @@ class DescriptorPoolRecyclerVK final }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_DESCRIPTOR_POOL_VK_H_ diff --git a/impeller/renderer/backend/vulkan/device_buffer_vk.h b/impeller/renderer/backend/vulkan/device_buffer_vk.h index 70022dd40d2c7..c2e617dff3b8f 100644 --- a/impeller/renderer/backend/vulkan/device_buffer_vk.h +++ b/impeller/renderer/backend/vulkan/device_buffer_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_DEVICE_BUFFER_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_DEVICE_BUFFER_VK_H_ #include @@ -74,3 +75,5 @@ class DeviceBufferVK final : public DeviceBuffer, }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_DEVICE_BUFFER_VK_H_ diff --git a/impeller/renderer/backend/vulkan/device_holder.h b/impeller/renderer/backend/vulkan/device_holder.h index f113cbc331f72..bd26e09e2029b 100644 --- a/impeller/renderer/backend/vulkan/device_holder.h +++ b/impeller/renderer/backend/vulkan/device_holder.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_DEVICE_HOLDER_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_DEVICE_HOLDER_H_ #include "impeller/renderer/backend/vulkan/vk.h" // IWYU pragma: keep. @@ -16,3 +17,5 @@ class DeviceHolder { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_DEVICE_HOLDER_H_ diff --git a/impeller/renderer/backend/vulkan/fence_waiter_vk.h b/impeller/renderer/backend/vulkan/fence_waiter_vk.h index c58c9e0783fab..eb32e3a6554ab 100644 --- a/impeller/renderer/backend/vulkan/fence_waiter_vk.h +++ b/impeller/renderer/backend/vulkan/fence_waiter_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_FENCE_WAITER_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_FENCE_WAITER_VK_H_ #include #include @@ -56,3 +57,5 @@ class FenceWaiterVK { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_FENCE_WAITER_VK_H_ diff --git a/impeller/renderer/backend/vulkan/formats_vk.h b/impeller/renderer/backend/vulkan/formats_vk.h index 42fca4f9a6094..bf0ce5fb6a760 100644 --- a/impeller/renderer/backend/vulkan/formats_vk.h +++ b/impeller/renderer/backend/vulkan/formats_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_FORMATS_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_FORMATS_VK_H_ #include @@ -665,3 +666,5 @@ constexpr vk::ImageAspectFlags ToImageAspectFlags(PixelFormat format) { } } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_FORMATS_VK_H_ diff --git a/impeller/renderer/backend/vulkan/limits_vk.h b/impeller/renderer/backend/vulkan/limits_vk.h index 14e2dce906e49..4303d7d94db60 100644 --- a/impeller/renderer/backend/vulkan/limits_vk.h +++ b/impeller/renderer/backend/vulkan/limits_vk.h @@ -1,4 +1,5 @@ -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_LIMITS_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_LIMITS_VK_H_ #include @@ -12,3 +13,5 @@ constexpr size_t kImageSizeThresholdForDedicatedMemoryAllocation = 4 * 1024 * 1024; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_LIMITS_VK_H_ diff --git a/impeller/renderer/backend/vulkan/pass_bindings_cache.h b/impeller/renderer/backend/vulkan/pass_bindings_cache.h index 22b3a0e463cf0..9eccee0ee0ee0 100644 --- a/impeller/renderer/backend/vulkan/pass_bindings_cache.h +++ b/impeller/renderer/backend/vulkan/pass_bindings_cache.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_PASS_BINDINGS_CACHE_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_PASS_BINDINGS_CACHE_H_ #include #include @@ -45,3 +46,5 @@ class PassBindingsCache { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_PASS_BINDINGS_CACHE_H_ diff --git a/impeller/renderer/backend/vulkan/pipeline_cache_vk.h b/impeller/renderer/backend/vulkan/pipeline_cache_vk.h index 070d636ab092b..398b5f2555732 100644 --- a/impeller/renderer/backend/vulkan/pipeline_cache_vk.h +++ b/impeller/renderer/backend/vulkan/pipeline_cache_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_PIPELINE_CACHE_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_PIPELINE_CACHE_VK_H_ #include "flutter/fml/file.h" #include "flutter/fml/macros.h" @@ -48,3 +49,5 @@ class PipelineCacheVK { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_PIPELINE_CACHE_VK_H_ diff --git a/impeller/renderer/backend/vulkan/pipeline_library_vk.h b/impeller/renderer/backend/vulkan/pipeline_library_vk.h index 923dad397a731..7866b4909d6a0 100644 --- a/impeller/renderer/backend/vulkan/pipeline_library_vk.h +++ b/impeller/renderer/backend/vulkan/pipeline_library_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_PIPELINE_LIBRARY_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_PIPELINE_LIBRARY_VK_H_ #include @@ -80,3 +81,5 @@ class PipelineLibraryVK final }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_PIPELINE_LIBRARY_VK_H_ diff --git a/impeller/renderer/backend/vulkan/pipeline_vk.h b/impeller/renderer/backend/vulkan/pipeline_vk.h index 0b6b3b6e036e4..ffe245152c4da 100644 --- a/impeller/renderer/backend/vulkan/pipeline_vk.h +++ b/impeller/renderer/backend/vulkan/pipeline_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_PIPELINE_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_PIPELINE_VK_H_ #include @@ -55,3 +56,5 @@ class PipelineVK final }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_PIPELINE_VK_H_ diff --git a/impeller/renderer/backend/vulkan/queue_vk.h b/impeller/renderer/backend/vulkan/queue_vk.h index 8fde3b712ae3a..7345429b6d387 100644 --- a/impeller/renderer/backend/vulkan/queue_vk.h +++ b/impeller/renderer/backend/vulkan/queue_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_QUEUE_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_QUEUE_VK_H_ #include @@ -72,3 +73,5 @@ struct QueuesVK { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_QUEUE_VK_H_ diff --git a/impeller/renderer/backend/vulkan/render_pass_vk.h b/impeller/renderer/backend/vulkan/render_pass_vk.h index b7164d9d6c1f0..a173aafe35736 100644 --- a/impeller/renderer/backend/vulkan/render_pass_vk.h +++ b/impeller/renderer/backend/vulkan/render_pass_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_RENDER_PASS_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_RENDER_PASS_VK_H_ #include "flutter/fml/macros.h" #include "impeller/renderer/backend/vulkan/context_vk.h" @@ -56,3 +57,5 @@ class RenderPassVK final : public RenderPass { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_RENDER_PASS_VK_H_ diff --git a/impeller/renderer/backend/vulkan/resource_manager_vk.h b/impeller/renderer/backend/vulkan/resource_manager_vk.h index 088314e3e8947..4d8ef36a1c1bd 100644 --- a/impeller/renderer/backend/vulkan/resource_manager_vk.h +++ b/impeller/renderer/backend/vulkan/resource_manager_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_RESOURCE_MANAGER_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_RESOURCE_MANAGER_VK_H_ #include #include @@ -208,3 +209,5 @@ class UniqueResourceVKT final { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_RESOURCE_MANAGER_VK_H_ diff --git a/impeller/renderer/backend/vulkan/sampler_library_vk.h b/impeller/renderer/backend/vulkan/sampler_library_vk.h index 3be467040bf0d..a18e65ef159a5 100644 --- a/impeller/renderer/backend/vulkan/sampler_library_vk.h +++ b/impeller/renderer/backend/vulkan/sampler_library_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SAMPLER_LIBRARY_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SAMPLER_LIBRARY_VK_H_ #include "flutter/fml/macros.h" #include "impeller/base/backend_cast.h" @@ -39,3 +40,5 @@ class SamplerLibraryVK final }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SAMPLER_LIBRARY_VK_H_ diff --git a/impeller/renderer/backend/vulkan/sampler_vk.h b/impeller/renderer/backend/vulkan/sampler_vk.h index 3cc48a229f2a3..871f3699d4868 100644 --- a/impeller/renderer/backend/vulkan/sampler_vk.h +++ b/impeller/renderer/backend/vulkan/sampler_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SAMPLER_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SAMPLER_VK_H_ #include "flutter/fml/macros.h" #include "impeller/base/backend_cast.h" @@ -40,3 +41,5 @@ class SamplerVK final : public Sampler, public BackendCast { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SAMPLER_VK_H_ diff --git a/impeller/renderer/backend/vulkan/shader_function_vk.h b/impeller/renderer/backend/vulkan/shader_function_vk.h index 713a4fded6359..1d7505707d6a9 100644 --- a/impeller/renderer/backend/vulkan/shader_function_vk.h +++ b/impeller/renderer/backend/vulkan/shader_function_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SHADER_FUNCTION_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SHADER_FUNCTION_VK_H_ #include "flutter/fml/macros.h" #include "impeller/base/backend_cast.h" @@ -40,3 +41,5 @@ class ShaderFunctionVK final }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SHADER_FUNCTION_VK_H_ diff --git a/impeller/renderer/backend/vulkan/shader_library_vk.h b/impeller/renderer/backend/vulkan/shader_library_vk.h index 67e266aa80355..ea3f063a2537d 100644 --- a/impeller/renderer/backend/vulkan/shader_library_vk.h +++ b/impeller/renderer/backend/vulkan/shader_library_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SHADER_LIBRARY_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SHADER_LIBRARY_VK_H_ #include "flutter/fml/macros.h" #include "impeller/base/comparable.h" @@ -57,3 +58,5 @@ class ShaderLibraryVK final : public ShaderLibrary { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SHADER_LIBRARY_VK_H_ diff --git a/impeller/renderer/backend/vulkan/shared_object_vk.h b/impeller/renderer/backend/vulkan/shared_object_vk.h index f91f018c94e2a..7b4bbdce8686b 100644 --- a/impeller/renderer/backend/vulkan/shared_object_vk.h +++ b/impeller/renderer/backend/vulkan/shared_object_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SHARED_OBJECT_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SHARED_OBJECT_VK_H_ #include @@ -51,3 +52,5 @@ template using SharedHandleVK = std::shared_ptr>; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SHARED_OBJECT_VK_H_ diff --git a/impeller/renderer/backend/vulkan/surface_context_vk.h b/impeller/renderer/backend/vulkan/surface_context_vk.h index 9bb65484802c3..5c8a327685dba 100644 --- a/impeller/renderer/backend/vulkan/surface_context_vk.h +++ b/impeller/renderer/backend/vulkan/surface_context_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SURFACE_CONTEXT_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SURFACE_CONTEXT_VK_H_ #include @@ -71,3 +72,5 @@ class SurfaceContextVK : public Context, }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SURFACE_CONTEXT_VK_H_ diff --git a/impeller/renderer/backend/vulkan/surface_vk.h b/impeller/renderer/backend/vulkan/surface_vk.h index 510923252f208..fef4187f3e696 100644 --- a/impeller/renderer/backend/vulkan/surface_vk.h +++ b/impeller/renderer/backend/vulkan/surface_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SURFACE_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SURFACE_VK_H_ #include @@ -39,3 +40,5 @@ class SurfaceVK final : public Surface { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SURFACE_VK_H_ diff --git a/impeller/renderer/backend/vulkan/swapchain_image_vk.h b/impeller/renderer/backend/vulkan/swapchain_image_vk.h index 2eb1dc8d5483d..9ad316a8ec0c0 100644 --- a/impeller/renderer/backend/vulkan/swapchain_image_vk.h +++ b/impeller/renderer/backend/vulkan/swapchain_image_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_IMAGE_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_IMAGE_VK_H_ #include "flutter/fml/macros.h" #include "impeller/geometry/size.h" @@ -51,3 +52,5 @@ class SwapchainImageVK final : public TextureSourceVK { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_IMAGE_VK_H_ diff --git a/impeller/renderer/backend/vulkan/swapchain_impl_vk.h b/impeller/renderer/backend/vulkan/swapchain_impl_vk.h index f8ce74e120545..87ed948b215f2 100644 --- a/impeller/renderer/backend/vulkan/swapchain_impl_vk.h +++ b/impeller/renderer/backend/vulkan/swapchain_impl_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_IMPL_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_IMPL_VK_H_ #include #include @@ -90,3 +91,5 @@ class SwapchainImplVK final }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_IMPL_VK_H_ diff --git a/impeller/renderer/backend/vulkan/swapchain_vk.h b/impeller/renderer/backend/vulkan/swapchain_vk.h index c69e5df46cd9f..2e724bae8ff29 100644 --- a/impeller/renderer/backend/vulkan/swapchain_vk.h +++ b/impeller/renderer/backend/vulkan/swapchain_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_VK_H_ #include @@ -46,3 +47,5 @@ class SwapchainVK { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_VK_H_ diff --git a/impeller/renderer/backend/vulkan/test/mock_vulkan.h b/impeller/renderer/backend/vulkan/test/mock_vulkan.h index e48764d5bfeca..4c68492c5cb00 100644 --- a/impeller/renderer/backend/vulkan/test/mock_vulkan.h +++ b/impeller/renderer/backend/vulkan/test/mock_vulkan.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_TEST_MOCK_VULKAN_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_TEST_MOCK_VULKAN_H_ #include #include @@ -95,3 +96,5 @@ class MockVulkanContextBuilder { } // namespace testing } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_TEST_MOCK_VULKAN_H_ diff --git a/impeller/renderer/backend/vulkan/texture_source_vk.h b/impeller/renderer/backend/vulkan/texture_source_vk.h index eaab485655acc..13f475b5dfc2c 100644 --- a/impeller/renderer/backend/vulkan/texture_source_vk.h +++ b/impeller/renderer/backend/vulkan/texture_source_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_TEXTURE_SOURCE_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_TEXTURE_SOURCE_VK_H_ #include "flutter/fml/macros.h" #include "flutter/fml/status.h" @@ -62,3 +63,5 @@ class TextureSourceVK { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_TEXTURE_SOURCE_VK_H_ diff --git a/impeller/renderer/backend/vulkan/texture_vk.h b/impeller/renderer/backend/vulkan/texture_vk.h index fe3d13890d39e..4df1dcc37b1bb 100644 --- a/impeller/renderer/backend/vulkan/texture_vk.h +++ b/impeller/renderer/backend/vulkan/texture_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_TEXTURE_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_TEXTURE_VK_H_ #include @@ -65,3 +66,5 @@ class TextureVK final : public Texture, public BackendCast { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_TEXTURE_VK_H_ diff --git a/impeller/renderer/backend/vulkan/vertex_descriptor_vk.h b/impeller/renderer/backend/vulkan/vertex_descriptor_vk.h index 31d3f447c7d61..1768211fbeac4 100644 --- a/impeller/renderer/backend/vulkan/vertex_descriptor_vk.h +++ b/impeller/renderer/backend/vulkan/vertex_descriptor_vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_VERTEX_DESCRIPTOR_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_VERTEX_DESCRIPTOR_VK_H_ #include "flutter/fml/macros.h" #include "impeller/core/shader_types.h" @@ -13,3 +14,5 @@ namespace impeller { vk::Format ToVertexDescriptorFormat(const ShaderStageIOSlot& input); } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_VERTEX_DESCRIPTOR_VK_H_ diff --git a/impeller/renderer/backend/vulkan/vk.h b/impeller/renderer/backend/vulkan/vk.h index 9c17b82725c88..ea992ce0e2d9d 100644 --- a/impeller/renderer/backend/vulkan/vk.h +++ b/impeller/renderer/backend/vulkan/vk.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_VK_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_VK_H_ #include "flutter/fml/build_config.h" #include "flutter/fml/logging.h" @@ -68,3 +69,5 @@ #include "vulkan/vulkan.hpp" // IWYU pragma: keep. static_assert(VK_HEADER_VERSION >= 215, "Vulkan headers must not be too old."); + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_VK_H_ diff --git a/impeller/renderer/backend/vulkan/vma.h b/impeller/renderer/backend/vulkan/vma.h index f33a396997f01..6787bee93c576 100644 --- a/impeller/renderer/backend/vulkan/vma.h +++ b/impeller/renderer/backend/vulkan/vma.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_VMA_H_ +#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_VMA_H_ #include "flutter/flutter_vma/flutter_vma.h" #include "flutter/fml/trace_event.h" @@ -132,3 +133,5 @@ struct ImageVMATraits { using UniqueImageVMA = fml::UniqueObject; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_VMA_H_ diff --git a/impeller/renderer/blit_command.h b/impeller/renderer/blit_command.h index 90124b58d86c9..7f456f659326b 100644 --- a/impeller/renderer/blit_command.h +++ b/impeller/renderer/blit_command.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BLIT_COMMAND_H_ +#define FLUTTER_IMPELLER_RENDERER_BLIT_COMMAND_H_ #include "impeller/core/device_buffer.h" #include "impeller/core/texture.h" @@ -39,3 +40,5 @@ struct BlitGenerateMipmapCommand : public BlitCommand { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BLIT_COMMAND_H_ diff --git a/impeller/renderer/blit_pass.h b/impeller/renderer/blit_pass.h index 8f6b071be6483..61f53b49dc5f1 100644 --- a/impeller/renderer/blit_pass.h +++ b/impeller/renderer/blit_pass.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_BLIT_PASS_H_ +#define FLUTTER_IMPELLER_RENDERER_BLIT_PASS_H_ #include #include @@ -163,3 +164,5 @@ class BlitPass { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_BLIT_PASS_H_ diff --git a/impeller/renderer/capabilities.h b/impeller/renderer/capabilities.h index 48f12a7d2432d..9f3f15cefe897 100644 --- a/impeller/renderer/capabilities.h +++ b/impeller/renderer/capabilities.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_CAPABILITIES_H_ +#define FLUTTER_IMPELLER_RENDERER_CAPABILITIES_H_ #include @@ -167,3 +168,5 @@ class CapabilitiesBuilder { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_CAPABILITIES_H_ diff --git a/impeller/renderer/command.h b/impeller/renderer/command.h index 6351a4599df9f..426b444cb9c2e 100644 --- a/impeller/renderer/command.h +++ b/impeller/renderer/command.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_COMMAND_H_ +#define FLUTTER_IMPELLER_RENDERER_COMMAND_H_ #include #include @@ -189,3 +190,5 @@ struct Command : public ResourceBinder { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_COMMAND_H_ diff --git a/impeller/renderer/command_buffer.h b/impeller/renderer/command_buffer.h index 61717d2922257..bbc0288cb7cac 100644 --- a/impeller/renderer/command_buffer.h +++ b/impeller/renderer/command_buffer.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_COMMAND_BUFFER_H_ +#define FLUTTER_IMPELLER_RENDERER_COMMAND_BUFFER_H_ #include #include @@ -148,3 +149,5 @@ class CommandBuffer { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_COMMAND_BUFFER_H_ diff --git a/impeller/renderer/compute_command.h b/impeller/renderer/compute_command.h index 1a2d51503698c..fb2639df664e8 100644 --- a/impeller/renderer/compute_command.h +++ b/impeller/renderer/compute_command.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_COMPUTE_COMMAND_H_ +#define FLUTTER_IMPELLER_RENDERER_COMPUTE_COMMAND_H_ #include #include @@ -69,3 +70,5 @@ struct ComputeCommand : public ResourceBinder { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_COMPUTE_COMMAND_H_ diff --git a/impeller/renderer/compute_pass.h b/impeller/renderer/compute_pass.h index 37358ded6f8b3..155f36e4b9513 100644 --- a/impeller/renderer/compute_pass.h +++ b/impeller/renderer/compute_pass.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_COMPUTE_PASS_H_ +#define FLUTTER_IMPELLER_RENDERER_COMPUTE_PASS_H_ #include #include @@ -80,3 +81,5 @@ class ComputePass { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_COMPUTE_PASS_H_ diff --git a/impeller/renderer/compute_pipeline_builder.h b/impeller/renderer/compute_pipeline_builder.h index 7a7d34cbcedcf..8029c0ff9ace2 100644 --- a/impeller/renderer/compute_pipeline_builder.h +++ b/impeller/renderer/compute_pipeline_builder.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_COMPUTE_PIPELINE_BUILDER_H_ +#define FLUTTER_IMPELLER_RENDERER_COMPUTE_PIPELINE_BUILDER_H_ #include "flutter/fml/logging.h" #include "flutter/fml/macros.h" @@ -83,3 +84,5 @@ struct ComputePipelineBuilder { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_COMPUTE_PIPELINE_BUILDER_H_ diff --git a/impeller/renderer/compute_pipeline_descriptor.h b/impeller/renderer/compute_pipeline_descriptor.h index 8a38f12d4f260..a92def4c78fd6 100644 --- a/impeller/renderer/compute_pipeline_descriptor.h +++ b/impeller/renderer/compute_pipeline_descriptor.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_COMPUTE_PIPELINE_DESCRIPTOR_H_ +#define FLUTTER_IMPELLER_RENDERER_COMPUTE_PIPELINE_DESCRIPTOR_H_ #include #include @@ -66,3 +67,5 @@ class ComputePipelineDescriptor final }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_COMPUTE_PIPELINE_DESCRIPTOR_H_ diff --git a/impeller/renderer/compute_tessellator.h b/impeller/renderer/compute_tessellator.h index 0b95c1044cad9..f8ccd0d8dfe2a 100644 --- a/impeller/renderer/compute_tessellator.h +++ b/impeller/renderer/compute_tessellator.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_COMPUTE_TESSELLATOR_H_ +#define FLUTTER_IMPELLER_RENDERER_COMPUTE_TESSELLATOR_H_ #include "flutter/fml/macros.h" #include "impeller/core/buffer_view.h" @@ -84,3 +85,5 @@ class ComputeTessellator { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_COMPUTE_TESSELLATOR_H_ diff --git a/impeller/renderer/context.h b/impeller/renderer/context.h index 9a24e435af1e3..36ad0c2e1899d 100644 --- a/impeller/renderer/context.h +++ b/impeller/renderer/context.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_CONTEXT_H_ +#define FLUTTER_IMPELLER_RENDERER_CONTEXT_H_ #include #include @@ -211,3 +212,5 @@ class Context { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_CONTEXT_H_ diff --git a/impeller/renderer/pipeline.h b/impeller/renderer/pipeline.h index 1c761c0a6ff03..63d0918b78a7b 100644 --- a/impeller/renderer/pipeline.h +++ b/impeller/renderer/pipeline.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_PIPELINE_H_ +#define FLUTTER_IMPELLER_RENDERER_PIPELINE_H_ #include @@ -170,3 +171,5 @@ class ComputePipelineT { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_PIPELINE_H_ diff --git a/impeller/renderer/pipeline_builder.h b/impeller/renderer/pipeline_builder.h index 163ce66e6f3c6..9b2fadca83e1e 100644 --- a/impeller/renderer/pipeline_builder.h +++ b/impeller/renderer/pipeline_builder.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_PIPELINE_BUILDER_H_ +#define FLUTTER_IMPELLER_RENDERER_PIPELINE_BUILDER_H_ #include "flutter/fml/logging.h" #include "flutter/fml/macros.h" @@ -120,3 +121,5 @@ struct PipelineBuilder { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_PIPELINE_BUILDER_H_ diff --git a/impeller/renderer/pipeline_descriptor.h b/impeller/renderer/pipeline_descriptor.h index 30149a0524420..460d7e1ee8d4c 100644 --- a/impeller/renderer/pipeline_descriptor.h +++ b/impeller/renderer/pipeline_descriptor.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_PIPELINE_DESCRIPTOR_H_ +#define FLUTTER_IMPELLER_RENDERER_PIPELINE_DESCRIPTOR_H_ #include #include @@ -167,3 +168,5 @@ class PipelineDescriptor final : public Comparable { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_PIPELINE_DESCRIPTOR_H_ diff --git a/impeller/renderer/pipeline_library.h b/impeller/renderer/pipeline_library.h index 3769f800caefb..d97861f5dc5d7 100644 --- a/impeller/renderer/pipeline_library.h +++ b/impeller/renderer/pipeline_library.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_PIPELINE_LIBRARY_H_ +#define FLUTTER_IMPELLER_RENDERER_PIPELINE_LIBRARY_H_ #include @@ -57,3 +58,5 @@ class PipelineLibrary : public std::enable_shared_from_this { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_PIPELINE_LIBRARY_H_ diff --git a/impeller/renderer/pool.h b/impeller/renderer/pool.h index 631284ff874e4..399236fd238b3 100644 --- a/impeller/renderer/pool.h +++ b/impeller/renderer/pool.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_POOL_H_ +#define FLUTTER_IMPELLER_RENDERER_POOL_H_ #include #include @@ -53,3 +54,5 @@ class Pool { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_POOL_H_ diff --git a/impeller/renderer/render_pass.h b/impeller/renderer/render_pass.h index 512c152d6e0bf..ff0d6d50c9be6 100644 --- a/impeller/renderer/render_pass.h +++ b/impeller/renderer/render_pass.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_RENDER_PASS_H_ +#define FLUTTER_IMPELLER_RENDERER_RENDER_PASS_H_ #include @@ -114,3 +115,5 @@ class RenderPass { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_RENDER_PASS_H_ diff --git a/impeller/renderer/render_target.h b/impeller/renderer/render_target.h index d808f9feeff1d..dbd115a5c7612 100644 --- a/impeller/renderer/render_target.h +++ b/impeller/renderer/render_target.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_RENDER_TARGET_H_ +#define FLUTTER_IMPELLER_RENDERER_RENDER_TARGET_H_ #include #include @@ -156,3 +157,5 @@ class RenderTarget final { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_RENDER_TARGET_H_ diff --git a/impeller/renderer/renderer.h b/impeller/renderer/renderer.h index 552a49d724e22..1e37761ab4ae5 100644 --- a/impeller/renderer/renderer.h +++ b/impeller/renderer/renderer.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_RENDERER_H_ +#define FLUTTER_IMPELLER_RENDERER_RENDERER_H_ #include #include @@ -47,3 +48,5 @@ class Renderer { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_RENDERER_H_ diff --git a/impeller/renderer/sampler_library.h b/impeller/renderer/sampler_library.h index f022488ce138a..86e98b938b5b6 100644 --- a/impeller/renderer/sampler_library.h +++ b/impeller/renderer/sampler_library.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_SAMPLER_LIBRARY_H_ +#define FLUTTER_IMPELLER_RENDERER_SAMPLER_LIBRARY_H_ #include "impeller/core/sampler.h" #include "impeller/core/sampler_descriptor.h" @@ -26,3 +27,5 @@ class SamplerLibrary { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_SAMPLER_LIBRARY_H_ diff --git a/impeller/renderer/shader_function.h b/impeller/renderer/shader_function.h index 280c64d117fd1..d762dd2ea5a6d 100644 --- a/impeller/renderer/shader_function.h +++ b/impeller/renderer/shader_function.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_SHADER_FUNCTION_H_ +#define FLUTTER_IMPELLER_RENDERER_SHADER_FUNCTION_H_ #include #include "flutter/fml/hash_combine.h" @@ -43,3 +44,5 @@ class ShaderFunction : public Comparable { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_SHADER_FUNCTION_H_ diff --git a/impeller/renderer/shader_key.h b/impeller/renderer/shader_key.h index 802908647b149..77f03cff730b0 100644 --- a/impeller/renderer/shader_key.h +++ b/impeller/renderer/shader_key.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_SHADER_KEY_H_ +#define FLUTTER_IMPELLER_RENDERER_SHADER_KEY_H_ #include #include @@ -43,3 +44,5 @@ using ShaderFunctionMap = ShaderKey::Equal>; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_SHADER_KEY_H_ diff --git a/impeller/renderer/shader_library.h b/impeller/renderer/shader_library.h index dd191f4994497..a28817c2d1632 100644 --- a/impeller/renderer/shader_library.h +++ b/impeller/renderer/shader_library.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_SHADER_LIBRARY_H_ +#define FLUTTER_IMPELLER_RENDERER_SHADER_LIBRARY_H_ #include #include @@ -45,3 +46,5 @@ class ShaderLibrary : public std::enable_shared_from_this { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_SHADER_LIBRARY_H_ diff --git a/impeller/renderer/snapshot.h b/impeller/renderer/snapshot.h index 0d9a57471aaaa..849b7ce04ca62 100644 --- a/impeller/renderer/snapshot.h +++ b/impeller/renderer/snapshot.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_SNAPSHOT_H_ +#define FLUTTER_IMPELLER_RENDERER_SNAPSHOT_H_ #include #include @@ -47,3 +48,5 @@ struct Snapshot { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_SNAPSHOT_H_ diff --git a/impeller/renderer/surface.h b/impeller/renderer/surface.h index 3ce7937f76d81..e0e4abe5faa5f 100644 --- a/impeller/renderer/surface.h +++ b/impeller/renderer/surface.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_SURFACE_H_ +#define FLUTTER_IMPELLER_RENDERER_SURFACE_H_ #include #include @@ -42,3 +43,5 @@ class Surface { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_SURFACE_H_ diff --git a/impeller/renderer/testing/mocks.h b/impeller/renderer/testing/mocks.h index 4af4bc1191e04..4960a57ef78fd 100644 --- a/impeller/renderer/testing/mocks.h +++ b/impeller/renderer/testing/mocks.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_TESTING_MOCKS_H_ +#define FLUTTER_IMPELLER_RENDERER_TESTING_MOCKS_H_ #include "gmock/gmock.h" #include "impeller/core/allocator.h" @@ -215,3 +216,5 @@ class MockSampler : public Sampler { } // namespace testing } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_TESTING_MOCKS_H_ diff --git a/impeller/renderer/vertex_buffer_builder.h b/impeller/renderer/vertex_buffer_builder.h index 2f92e24c96eec..78a780bae143d 100644 --- a/impeller/renderer/vertex_buffer_builder.h +++ b/impeller/renderer/vertex_buffer_builder.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_VERTEX_BUFFER_BUILDER_H_ +#define FLUTTER_IMPELLER_RENDERER_VERTEX_BUFFER_BUILDER_H_ #include #include @@ -160,3 +161,5 @@ class VertexBufferBuilder { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_VERTEX_BUFFER_BUILDER_H_ diff --git a/impeller/renderer/vertex_descriptor.h b/impeller/renderer/vertex_descriptor.h index 72d12e11df61e..5d1143f0ffc93 100644 --- a/impeller/renderer/vertex_descriptor.h +++ b/impeller/renderer/vertex_descriptor.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RENDERER_VERTEX_DESCRIPTOR_H_ +#define FLUTTER_IMPELLER_RENDERER_VERTEX_DESCRIPTOR_H_ #include @@ -75,3 +76,5 @@ class VertexDescriptor final : public Comparable { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RENDERER_VERTEX_DESCRIPTOR_H_ diff --git a/impeller/runtime_stage/runtime_stage.h b/impeller/runtime_stage/runtime_stage.h index 8ee501bbdb650..8b52bdcd50d73 100644 --- a/impeller/runtime_stage/runtime_stage.h +++ b/impeller/runtime_stage/runtime_stage.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RUNTIME_STAGE_RUNTIME_STAGE_H_ +#define FLUTTER_IMPELLER_RUNTIME_STAGE_RUNTIME_STAGE_H_ #include #include @@ -56,3 +57,5 @@ class RuntimeStage { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RUNTIME_STAGE_RUNTIME_STAGE_H_ diff --git a/impeller/runtime_stage/runtime_stage_playground.h b/impeller/runtime_stage/runtime_stage_playground.h index f1b35025941dd..86f9cc4bc42df 100644 --- a/impeller/runtime_stage/runtime_stage_playground.h +++ b/impeller/runtime_stage/runtime_stage_playground.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_RUNTIME_STAGE_RUNTIME_STAGE_PLAYGROUND_H_ +#define FLUTTER_IMPELLER_RUNTIME_STAGE_RUNTIME_STAGE_PLAYGROUND_H_ #include "flutter/fml/macros.h" #include "impeller/playground/playground_test.h" @@ -25,3 +26,5 @@ class RuntimeStagePlayground : public PlaygroundTest { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_RUNTIME_STAGE_RUNTIME_STAGE_PLAYGROUND_H_ diff --git a/impeller/scene/animation/animation.h b/impeller/scene/animation/animation.h index 37735412e8f1f..09ebfac3f8817 100644 --- a/impeller/scene/animation/animation.h +++ b/impeller/scene/animation/animation.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SCENE_ANIMATION_ANIMATION_H_ +#define FLUTTER_IMPELLER_SCENE_ANIMATION_ANIMATION_H_ #include #include @@ -77,3 +78,5 @@ class Animation final { } // namespace scene } // namespace impeller + +#endif // FLUTTER_IMPELLER_SCENE_ANIMATION_ANIMATION_H_ diff --git a/impeller/scene/animation/animation_clip.h b/impeller/scene/animation/animation_clip.h index 773284b047b3f..35c3339ae8514 100644 --- a/impeller/scene/animation/animation_clip.h +++ b/impeller/scene/animation/animation_clip.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SCENE_ANIMATION_ANIMATION_CLIP_H_ +#define FLUTTER_IMPELLER_SCENE_ANIMATION_ANIMATION_CLIP_H_ #include #include @@ -92,3 +93,5 @@ class AnimationClip final { } // namespace scene } // namespace impeller + +#endif // FLUTTER_IMPELLER_SCENE_ANIMATION_ANIMATION_CLIP_H_ diff --git a/impeller/scene/animation/animation_player.h b/impeller/scene/animation/animation_player.h index ebc77c3f2e662..44878e1c3803c 100644 --- a/impeller/scene/animation/animation_player.h +++ b/impeller/scene/animation/animation_player.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SCENE_ANIMATION_ANIMATION_PLAYER_H_ +#define FLUTTER_IMPELLER_SCENE_ANIMATION_ANIMATION_PLAYER_H_ #include #include @@ -52,3 +53,5 @@ class AnimationPlayer final { } // namespace scene } // namespace impeller + +#endif // FLUTTER_IMPELLER_SCENE_ANIMATION_ANIMATION_PLAYER_H_ diff --git a/impeller/scene/animation/animation_transforms.h b/impeller/scene/animation/animation_transforms.h index b15c9817781d4..59adb64938492 100644 --- a/impeller/scene/animation/animation_transforms.h +++ b/impeller/scene/animation/animation_transforms.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SCENE_ANIMATION_ANIMATION_TRANSFORMS_H_ +#define FLUTTER_IMPELLER_SCENE_ANIMATION_ANIMATION_TRANSFORMS_H_ #include "impeller/geometry/matrix_decomposition.h" @@ -16,3 +17,5 @@ struct AnimationTransforms { } // namespace scene } // namespace impeller + +#endif // FLUTTER_IMPELLER_SCENE_ANIMATION_ANIMATION_TRANSFORMS_H_ diff --git a/impeller/scene/animation/property_resolver.h b/impeller/scene/animation/property_resolver.h index 10df83e43309a..722318d32d88c 100644 --- a/impeller/scene/animation/property_resolver.h +++ b/impeller/scene/animation/property_resolver.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SCENE_ANIMATION_PROPERTY_RESOLVER_H_ +#define FLUTTER_IMPELLER_SCENE_ANIMATION_PROPERTY_RESOLVER_H_ #include #include @@ -139,3 +140,5 @@ class ScaleTimelineResolver final : public TimelineResolver { } // namespace scene } // namespace impeller + +#endif // FLUTTER_IMPELLER_SCENE_ANIMATION_PROPERTY_RESOLVER_H_ diff --git a/impeller/scene/camera.h b/impeller/scene/camera.h index 0b31e4f89ad28..3f833320dacb8 100644 --- a/impeller/scene/camera.h +++ b/impeller/scene/camera.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SCENE_CAMERA_H_ +#define FLUTTER_IMPELLER_SCENE_CAMERA_H_ #include @@ -32,3 +33,5 @@ class Camera { } // namespace scene } // namespace impeller + +#endif // FLUTTER_IMPELLER_SCENE_CAMERA_H_ diff --git a/impeller/scene/geometry.h b/impeller/scene/geometry.h index 0a4b9c040f876..de8f975633ef5 100644 --- a/impeller/scene/geometry.h +++ b/impeller/scene/geometry.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SCENE_GEOMETRY_H_ +#define FLUTTER_IMPELLER_SCENE_GEOMETRY_H_ #include @@ -141,3 +142,5 @@ class SkinnedVertexBufferGeometry final : public Geometry { } // namespace scene } // namespace impeller + +#endif // FLUTTER_IMPELLER_SCENE_GEOMETRY_H_ diff --git a/impeller/scene/importer/conversions.h b/impeller/scene/importer/conversions.h index cb11d3c42f147..6c911644261f9 100644 --- a/impeller/scene/importer/conversions.h +++ b/impeller/scene/importer/conversions.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SCENE_IMPORTER_CONVERSIONS_H_ +#define FLUTTER_IMPELLER_SCENE_IMPORTER_CONVERSIONS_H_ #include #include @@ -52,3 +53,5 @@ std::unique_ptr ToFBColor(const std::vector& c); } // namespace importer } // namespace scene } // namespace impeller + +#endif // FLUTTER_IMPELLER_SCENE_IMPORTER_CONVERSIONS_H_ diff --git a/impeller/scene/importer/importer.h b/impeller/scene/importer/importer.h index 6766adbce19da..af0934522e428 100644 --- a/impeller/scene/importer/importer.h +++ b/impeller/scene/importer/importer.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SCENE_IMPORTER_IMPORTER_H_ +#define FLUTTER_IMPELLER_SCENE_IMPORTER_IMPORTER_H_ #include #include @@ -19,3 +20,5 @@ bool ParseGLTF(const fml::Mapping& source_mapping, fb::SceneT& out_scene); } } // namespace scene } // namespace impeller + +#endif // FLUTTER_IMPELLER_SCENE_IMPORTER_IMPORTER_H_ diff --git a/impeller/scene/importer/switches.h b/impeller/scene/importer/switches.h index d9b298216cc48..3b5294442ad37 100644 --- a/impeller/scene/importer/switches.h +++ b/impeller/scene/importer/switches.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SCENE_IMPORTER_SWITCHES_H_ +#define FLUTTER_IMPELLER_SCENE_IMPORTER_SWITCHES_H_ #include #include @@ -36,3 +37,5 @@ struct Switches { } // namespace importer } // namespace scene } // namespace impeller + +#endif // FLUTTER_IMPELLER_SCENE_IMPORTER_SWITCHES_H_ diff --git a/impeller/scene/importer/types.h b/impeller/scene/importer/types.h index 308527fe33e06..0312618e5aa04 100644 --- a/impeller/scene/importer/types.h +++ b/impeller/scene/importer/types.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SCENE_IMPORTER_TYPES_H_ +#define FLUTTER_IMPELLER_SCENE_IMPORTER_TYPES_H_ namespace impeller { namespace scene { @@ -16,3 +17,5 @@ enum class SourceType { } // namespace importer } // namespace scene } // namespace impeller + +#endif // FLUTTER_IMPELLER_SCENE_IMPORTER_TYPES_H_ diff --git a/impeller/scene/importer/vertices_builder.h b/impeller/scene/importer/vertices_builder.h index 6022573ab78f7..4244a2563d3cb 100644 --- a/impeller/scene/importer/vertices_builder.h +++ b/impeller/scene/importer/vertices_builder.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SCENE_IMPORTER_VERTICES_BUILDER_H_ +#define FLUTTER_IMPELLER_SCENE_IMPORTER_VERTICES_BUILDER_H_ #include #include @@ -169,3 +170,5 @@ class SkinnedVerticesBuilder final : public VerticesBuilder { } // namespace importer } // namespace scene } // namespace impeller + +#endif // FLUTTER_IMPELLER_SCENE_IMPORTER_VERTICES_BUILDER_H_ diff --git a/impeller/scene/material.h b/impeller/scene/material.h index e3132cfb1c7c1..c8954d540aa2b 100644 --- a/impeller/scene/material.h +++ b/impeller/scene/material.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SCENE_MATERIAL_H_ +#define FLUTTER_IMPELLER_SCENE_MATERIAL_H_ #include @@ -137,3 +138,5 @@ class PhysicallyBasedMaterial final : public Material { } // namespace scene } // namespace impeller + +#endif // FLUTTER_IMPELLER_SCENE_MATERIAL_H_ diff --git a/impeller/scene/mesh.h b/impeller/scene/mesh.h index e72a598f83190..008938324cbde 100644 --- a/impeller/scene/mesh.h +++ b/impeller/scene/mesh.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SCENE_MESH_H_ +#define FLUTTER_IMPELLER_SCENE_MESH_H_ #include #include @@ -47,3 +48,5 @@ class Mesh final { } // namespace scene } // namespace impeller + +#endif // FLUTTER_IMPELLER_SCENE_MESH_H_ diff --git a/impeller/scene/node.h b/impeller/scene/node.h index b08684af5bb9b..0e2649aef268a 100644 --- a/impeller/scene/node.h +++ b/impeller/scene/node.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SCENE_NODE_H_ +#define FLUTTER_IMPELLER_SCENE_NODE_H_ #include #include @@ -137,3 +138,5 @@ class Node final { } // namespace scene } // namespace impeller + +#endif // FLUTTER_IMPELLER_SCENE_NODE_H_ diff --git a/impeller/scene/pipeline_key.h b/impeller/scene/pipeline_key.h index d059a48e47ae0..56f41f3658a26 100644 --- a/impeller/scene/pipeline_key.h +++ b/impeller/scene/pipeline_key.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SCENE_PIPELINE_KEY_H_ +#define FLUTTER_IMPELLER_SCENE_PIPELINE_KEY_H_ #include "flutter/fml/hash_combine.h" @@ -40,3 +41,5 @@ struct PipelineKey { } // namespace scene } // namespace impeller + +#endif // FLUTTER_IMPELLER_SCENE_PIPELINE_KEY_H_ diff --git a/impeller/scene/scene.h b/impeller/scene/scene.h index b5d3b09ecf4be..4cd5c0895e2e6 100644 --- a/impeller/scene/scene.h +++ b/impeller/scene/scene.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SCENE_SCENE_H_ +#define FLUTTER_IMPELLER_SCENE_SCENE_H_ #include #include @@ -43,3 +44,5 @@ class Scene { } // namespace scene } // namespace impeller + +#endif // FLUTTER_IMPELLER_SCENE_SCENE_H_ diff --git a/impeller/scene/scene_context.h b/impeller/scene/scene_context.h index f85663b426770..24d49249f7ac0 100644 --- a/impeller/scene/scene_context.h +++ b/impeller/scene/scene_context.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SCENE_SCENE_CONTEXT_H_ +#define FLUTTER_IMPELLER_SCENE_SCENE_CONTEXT_H_ #include @@ -151,3 +152,5 @@ class SceneContext { } // namespace scene } // namespace impeller + +#endif // FLUTTER_IMPELLER_SCENE_SCENE_CONTEXT_H_ diff --git a/impeller/scene/scene_encoder.h b/impeller/scene/scene_encoder.h index 2cf096ec1ae4f..a3690c52c702a 100644 --- a/impeller/scene/scene_encoder.h +++ b/impeller/scene/scene_encoder.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SCENE_SCENE_ENCODER_H_ +#define FLUTTER_IMPELLER_SCENE_SCENE_ENCODER_H_ #include #include @@ -49,3 +50,5 @@ class SceneEncoder { } // namespace scene } // namespace impeller + +#endif // FLUTTER_IMPELLER_SCENE_SCENE_ENCODER_H_ diff --git a/impeller/scene/skin.h b/impeller/scene/skin.h index 5693e6406ddcc..77e663c964f0f 100644 --- a/impeller/scene/skin.h +++ b/impeller/scene/skin.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SCENE_SKIN_H_ +#define FLUTTER_IMPELLER_SCENE_SKIN_H_ #include #include @@ -42,3 +43,5 @@ class Skin final { } // namespace scene } // namespace impeller + +#endif // FLUTTER_IMPELLER_SCENE_SKIN_H_ diff --git a/impeller/shader_archive/multi_arch_shader_archive.h b/impeller/shader_archive/multi_arch_shader_archive.h index abcc7a9e2f575..1a73380b7a6a1 100644 --- a/impeller/shader_archive/multi_arch_shader_archive.h +++ b/impeller/shader_archive/multi_arch_shader_archive.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SHADER_ARCHIVE_MULTI_ARCH_SHADER_ARCHIVE_H_ +#define FLUTTER_IMPELLER_SHADER_ARCHIVE_MULTI_ARCH_SHADER_ARCHIVE_H_ #include #include @@ -44,3 +45,5 @@ class MultiArchShaderArchive { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_SHADER_ARCHIVE_MULTI_ARCH_SHADER_ARCHIVE_H_ diff --git a/impeller/shader_archive/multi_arch_shader_archive_writer.h b/impeller/shader_archive/multi_arch_shader_archive_writer.h index 163f9c3c5ce34..f04df91f36f92 100644 --- a/impeller/shader_archive/multi_arch_shader_archive_writer.h +++ b/impeller/shader_archive/multi_arch_shader_archive_writer.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SHADER_ARCHIVE_MULTI_ARCH_SHADER_ARCHIVE_WRITER_H_ +#define FLUTTER_IMPELLER_SHADER_ARCHIVE_MULTI_ARCH_SHADER_ARCHIVE_WRITER_H_ #include @@ -35,3 +36,5 @@ class MultiArchShaderArchiveWriter { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_SHADER_ARCHIVE_MULTI_ARCH_SHADER_ARCHIVE_WRITER_H_ diff --git a/impeller/shader_archive/shader_archive.h b/impeller/shader_archive/shader_archive.h index 8ee325d9c5b6e..a13736d11e330 100644 --- a/impeller/shader_archive/shader_archive.h +++ b/impeller/shader_archive/shader_archive.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SHADER_ARCHIVE_SHADER_ARCHIVE_H_ +#define FLUTTER_IMPELLER_SHADER_ARCHIVE_SHADER_ARCHIVE_H_ #include #include @@ -75,3 +76,5 @@ class ShaderArchive { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_SHADER_ARCHIVE_SHADER_ARCHIVE_H_ diff --git a/impeller/shader_archive/shader_archive_types.h b/impeller/shader_archive/shader_archive_types.h index a8007f3b2ffd0..2e2b6aae631dd 100644 --- a/impeller/shader_archive/shader_archive_types.h +++ b/impeller/shader_archive/shader_archive_types.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SHADER_ARCHIVE_SHADER_ARCHIVE_TYPES_H_ +#define FLUTTER_IMPELLER_SHADER_ARCHIVE_SHADER_ARCHIVE_TYPES_H_ namespace impeller { @@ -19,3 +20,5 @@ enum class ArchiveRenderingBackend { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_SHADER_ARCHIVE_SHADER_ARCHIVE_TYPES_H_ diff --git a/impeller/shader_archive/shader_archive_writer.h b/impeller/shader_archive/shader_archive_writer.h index 7503e48f22ace..85f60432bbd10 100644 --- a/impeller/shader_archive/shader_archive_writer.h +++ b/impeller/shader_archive/shader_archive_writer.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_SHADER_ARCHIVE_SHADER_ARCHIVE_WRITER_H_ +#define FLUTTER_IMPELLER_SHADER_ARCHIVE_SHADER_ARCHIVE_WRITER_H_ #include #include @@ -43,3 +44,5 @@ class ShaderArchiveWriter { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_SHADER_ARCHIVE_SHADER_ARCHIVE_WRITER_H_ diff --git a/impeller/tessellator/c/tessellator.h b/impeller/tessellator/c/tessellator.h index f79872f931619..ef5bfc950f107 100644 --- a/impeller/tessellator/c/tessellator.h +++ b/impeller/tessellator/c/tessellator.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TESSELLATOR_C_TESSELLATOR_H_ +#define FLUTTER_IMPELLER_TESSELLATOR_C_TESSELLATOR_H_ #include @@ -50,3 +51,5 @@ IMPELLER_API void DestroyVertices(Vertices* vertices); } // namespace impeller } + +#endif // FLUTTER_IMPELLER_TESSELLATOR_C_TESSELLATOR_H_ diff --git a/impeller/tessellator/tessellator.cc b/impeller/tessellator/tessellator.cc index 4a89f42bd6d3f..35685c3f34479 100644 --- a/impeller/tessellator/tessellator.cc +++ b/impeller/tessellator/tessellator.cc @@ -468,6 +468,34 @@ EllipticalVertexGenerator Tessellator::FilledEllipse( }); } +EllipticalVertexGenerator Tessellator::FilledRoundRect( + const Matrix& view_transform, + const Rect& bounds, + const Size& radii) { + if (radii.width * 2 < bounds.GetSize().width && + radii.height * 2 < bounds.GetSize().height) { + auto max_radius = radii.MaxDimension(); + auto divisions = ComputeQuadrantDivisions( + view_transform.GetMaxBasisLength() * max_radius); + auto upper_left = bounds.GetLeftTop() + radii; + auto lower_right = bounds.GetRightBottom() - radii; + return EllipticalVertexGenerator(Tessellator::GenerateFilledRoundRect, + GetTrigsForDivisions(divisions), + PrimitiveType::kTriangleStrip, 4, + { + .reference_centers = + { + upper_left, + lower_right, + }, + .radii = radii, + .half_width = -1.0f, + }); + } else { + return FilledEllipse(view_transform, bounds); + } +} + void Tessellator::GenerateFilledCircle( const Trigs& trigs, const EllipticalVertexGenerator::Data& data, @@ -615,4 +643,35 @@ void Tessellator::GenerateFilledEllipse( } } +void Tessellator::GenerateFilledRoundRect( + const Trigs& trigs, + const EllipticalVertexGenerator::Data& data, + const TessellatedVertexProc& proc) { + Scalar left = data.reference_centers[0].x; + Scalar top = data.reference_centers[0].y; + Scalar right = data.reference_centers[1].x; + Scalar bottom = data.reference_centers[1].y; + auto radii = data.radii; + + FML_DCHECK(data.half_width < 0); + + // Quadrant 1 connecting with Quadrant 4: + for (auto& trig : trigs) { + auto offset = trig * radii; + proc({left - offset.x, bottom + offset.y}); + proc({left - offset.x, top - offset.y}); + } + + // The second half of the round rect should be iterated in reverse, but + // we can instead iterate forward and swap the x/y values of the + // offset as the angles should be symmetric and thus should generate + // symmetrically reversed trig vectors. + // Quadrant 2 connecting with Quadrant 2: + for (auto& trig : trigs) { + auto offset = Point(trig.sin * radii.width, trig.cos * radii.height); + proc({right + offset.x, bottom + offset.y}); + proc({right + offset.x, top - offset.y}); + } +} + } // namespace impeller diff --git a/impeller/tessellator/tessellator.h b/impeller/tessellator/tessellator.h index 686c8d3f25c53..0ce56207fa09e 100644 --- a/impeller/tessellator/tessellator.h +++ b/impeller/tessellator/tessellator.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TESSELLATOR_TESSELLATOR_H_ +#define FLUTTER_IMPELLER_TESSELLATOR_TESSELLATOR_H_ #include #include @@ -280,6 +281,19 @@ class Tessellator { EllipticalVertexGenerator FilledEllipse(const Matrix& view_transform, const Rect& bounds); + /// @brief Create a |VertexGenerator| that can produce vertices for + /// a filled round rect within the given bounds and corner radii + /// with enough polygon sub-divisions to provide reasonable + /// fidelity when viewed under the given view transform. + /// + /// Note that the view transform is only used to choose the + /// number of sample points to use per quarter circle and the + /// returned points are not transformed by it, instead they are + /// relative to the coordinate space of the bounds. + EllipticalVertexGenerator FilledRoundRect(const Matrix& view_transform, + const Rect& bounds, + const Size& radii); + private: /// Used for polyline generation. std::unique_ptr> point_buffer_; @@ -309,9 +323,16 @@ class Tessellator { const EllipticalVertexGenerator::Data& data, const TessellatedVertexProc& proc); + static void GenerateFilledRoundRect( + const Trigs& trigs, + const EllipticalVertexGenerator::Data& data, + const TessellatedVertexProc& proc); + Tessellator(const Tessellator&) = delete; Tessellator& operator=(const Tessellator&) = delete; }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_TESSELLATOR_TESSELLATOR_H_ diff --git a/impeller/toolkit/egl/config.h b/impeller/toolkit/egl/config.h index 153aa6aa20c09..45ae789e9ed2b 100644 --- a/impeller/toolkit/egl/config.h +++ b/impeller/toolkit/egl/config.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TOOLKIT_EGL_CONFIG_H_ +#define FLUTTER_IMPELLER_TOOLKIT_EGL_CONFIG_H_ #include "flutter/fml/macros.h" #include "impeller/toolkit/egl/egl.h" @@ -74,3 +75,5 @@ class Config { } // namespace egl } // namespace impeller + +#endif // FLUTTER_IMPELLER_TOOLKIT_EGL_CONFIG_H_ diff --git a/impeller/toolkit/egl/context.h b/impeller/toolkit/egl/context.h index df33b3cf04f76..418ec24f92517 100644 --- a/impeller/toolkit/egl/context.h +++ b/impeller/toolkit/egl/context.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TOOLKIT_EGL_CONTEXT_H_ +#define FLUTTER_IMPELLER_TOOLKIT_EGL_CONTEXT_H_ #include @@ -56,3 +57,5 @@ class Context { } // namespace egl } // namespace impeller + +#endif // FLUTTER_IMPELLER_TOOLKIT_EGL_CONTEXT_H_ diff --git a/impeller/toolkit/egl/display.h b/impeller/toolkit/egl/display.h index 51ff9400dd26d..3e9b6236c676d 100644 --- a/impeller/toolkit/egl/display.h +++ b/impeller/toolkit/egl/display.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TOOLKIT_EGL_DISPLAY_H_ +#define FLUTTER_IMPELLER_TOOLKIT_EGL_DISPLAY_H_ #include #include @@ -47,3 +48,5 @@ class Display { } // namespace egl } // namespace impeller + +#endif // FLUTTER_IMPELLER_TOOLKIT_EGL_DISPLAY_H_ diff --git a/impeller/toolkit/egl/egl.h b/impeller/toolkit/egl/egl.h index af1bcca52ffb3..fc22e1cdf002d 100644 --- a/impeller/toolkit/egl/egl.h +++ b/impeller/toolkit/egl/egl.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TOOLKIT_EGL_EGL_H_ +#define FLUTTER_IMPELLER_TOOLKIT_EGL_EGL_H_ #include #define EGL_EGLEXT_PROTOTYPES @@ -21,3 +22,5 @@ void LogEGLError(const char* file, int line); } // namespace egl } // namespace impeller + +#endif // FLUTTER_IMPELLER_TOOLKIT_EGL_EGL_H_ diff --git a/impeller/toolkit/egl/image.h b/impeller/toolkit/egl/image.h index 2fafe0f994b82..51e3330065c40 100644 --- a/impeller/toolkit/egl/image.h +++ b/impeller/toolkit/egl/image.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TOOLKIT_EGL_IMAGE_H_ +#define FLUTTER_IMPELLER_TOOLKIT_EGL_IMAGE_H_ #include "flutter/fml/unique_object.h" #include "flutter/impeller/toolkit/egl/egl.h" @@ -72,3 +73,5 @@ using UniqueEGLImageKHR = fml::UniqueObject; } // namespace impeller + +#endif // FLUTTER_IMPELLER_TOOLKIT_EGL_IMAGE_H_ diff --git a/impeller/toolkit/egl/surface.h b/impeller/toolkit/egl/surface.h index 605f6fb5ac048..a8ca441660733 100644 --- a/impeller/toolkit/egl/surface.h +++ b/impeller/toolkit/egl/surface.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TOOLKIT_EGL_SURFACE_H_ +#define FLUTTER_IMPELLER_TOOLKIT_EGL_SURFACE_H_ #include "flutter/fml/macros.h" #include "impeller/toolkit/egl/egl.h" @@ -33,3 +34,5 @@ class Surface { } // namespace egl } // namespace impeller + +#endif // FLUTTER_IMPELLER_TOOLKIT_EGL_SURFACE_H_ diff --git a/impeller/toolkit/gles/gles.h b/impeller/toolkit/gles/gles.h index 599e3c9433c97..9cb1609fd5c27 100644 --- a/impeller/toolkit/gles/gles.h +++ b/impeller/toolkit/gles/gles.h @@ -2,8 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TOOLKIT_GLES_GLES_H_ +#define FLUTTER_IMPELLER_TOOLKIT_GLES_GLES_H_ #include "GLES3/gl3.h" #define GL_GLEXT_PROTOTYPES #include "GLES2/gl2ext.h" + +#endif // FLUTTER_IMPELLER_TOOLKIT_GLES_GLES_H_ diff --git a/impeller/toolkit/gles/texture.h b/impeller/toolkit/gles/texture.h index b90007b414237..cebef02e61a25 100644 --- a/impeller/toolkit/gles/texture.h +++ b/impeller/toolkit/gles/texture.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TOOLKIT_GLES_TEXTURE_H_ +#define FLUTTER_IMPELLER_TOOLKIT_GLES_TEXTURE_H_ #include "flutter/fml/unique_object.h" #include "flutter/impeller/toolkit/gles/gles.h" @@ -37,3 +38,5 @@ struct GLTextureTraits { using UniqueGLTexture = fml::UniqueObject; } // namespace impeller + +#endif // FLUTTER_IMPELLER_TOOLKIT_GLES_TEXTURE_H_ diff --git a/impeller/typographer/backends/skia/glyph_atlas_context_skia.h b/impeller/typographer/backends/skia/glyph_atlas_context_skia.h index ee4894f8c4509..7f59eca6183c2 100644 --- a/impeller/typographer/backends/skia/glyph_atlas_context_skia.h +++ b/impeller/typographer/backends/skia/glyph_atlas_context_skia.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_SKIA_GLYPH_ATLAS_CONTEXT_SKIA_H_ +#define FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_SKIA_GLYPH_ATLAS_CONTEXT_SKIA_H_ #include "impeller/base/backend_cast.h" #include "impeller/typographer/glyph_atlas.h" @@ -37,3 +38,5 @@ class GlyphAtlasContextSkia }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_SKIA_GLYPH_ATLAS_CONTEXT_SKIA_H_ diff --git a/impeller/typographer/backends/skia/text_frame_skia.h b/impeller/typographer/backends/skia/text_frame_skia.h index e7721a0c6e9c7..fdb9d7693ecbf 100644 --- a/impeller/typographer/backends/skia/text_frame_skia.h +++ b/impeller/typographer/backends/skia/text_frame_skia.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_SKIA_TEXT_FRAME_SKIA_H_ +#define FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_SKIA_TEXT_FRAME_SKIA_H_ #include "impeller/typographer/text_frame.h" #include "third_party/skia/include/core/SkTextBlob.h" @@ -13,3 +14,5 @@ std::shared_ptr MakeTextFrameFromTextBlobSkia( const sk_sp& blob); } // namespace impeller + +#endif // FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_SKIA_TEXT_FRAME_SKIA_H_ diff --git a/impeller/typographer/backends/skia/typeface_skia.h b/impeller/typographer/backends/skia/typeface_skia.h index 20544b4e13f93..dc14c48f6a8c9 100644 --- a/impeller/typographer/backends/skia/typeface_skia.h +++ b/impeller/typographer/backends/skia/typeface_skia.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_SKIA_TYPEFACE_SKIA_H_ +#define FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_SKIA_TYPEFACE_SKIA_H_ #include "flutter/fml/macros.h" #include "impeller/base/backend_cast.h" @@ -39,3 +40,5 @@ class TypefaceSkia final : public Typeface, }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_SKIA_TYPEFACE_SKIA_H_ diff --git a/impeller/typographer/backends/skia/typographer_context_skia.h b/impeller/typographer/backends/skia/typographer_context_skia.h index 8db80824625dc..f3c8dd4560de8 100644 --- a/impeller/typographer/backends/skia/typographer_context_skia.h +++ b/impeller/typographer/backends/skia/typographer_context_skia.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_SKIA_TYPOGRAPHER_CONTEXT_SKIA_H_ +#define FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_SKIA_TYPOGRAPHER_CONTEXT_SKIA_H_ #include "flutter/fml/macros.h" #include "impeller/typographer/typographer_context.h" @@ -34,3 +35,5 @@ class TypographerContextSkia : public TypographerContext { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_SKIA_TYPOGRAPHER_CONTEXT_SKIA_H_ diff --git a/impeller/typographer/backends/stb/glyph_atlas_context_stb.h b/impeller/typographer/backends/stb/glyph_atlas_context_stb.h index c2c307e758e14..58962570d9297 100644 --- a/impeller/typographer/backends/stb/glyph_atlas_context_stb.h +++ b/impeller/typographer/backends/stb/glyph_atlas_context_stb.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_STB_GLYPH_ATLAS_CONTEXT_STB_H_ +#define FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_STB_GLYPH_ATLAS_CONTEXT_STB_H_ #include "impeller/base/backend_cast.h" #include "impeller/typographer/glyph_atlas.h" @@ -59,3 +60,5 @@ class GlyphAtlasContextSTB }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_STB_GLYPH_ATLAS_CONTEXT_STB_H_ diff --git a/impeller/typographer/backends/stb/text_frame_stb.h b/impeller/typographer/backends/stb/text_frame_stb.h index 39f8cccc7688a..f37426f2d8c58 100644 --- a/impeller/typographer/backends/stb/text_frame_stb.h +++ b/impeller/typographer/backends/stb/text_frame_stb.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_STB_TEXT_FRAME_STB_H_ +#define FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_STB_TEXT_FRAME_STB_H_ #include "flutter/fml/macros.h" #include "impeller/typographer/backends/stb/typeface_stb.h" @@ -16,3 +17,5 @@ std::shared_ptr MakeTextFrameSTB( const std::string& text); } // namespace impeller + +#endif // FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_STB_TEXT_FRAME_STB_H_ diff --git a/impeller/typographer/backends/stb/typeface_stb.h b/impeller/typographer/backends/stb/typeface_stb.h index 3600ade3deb1c..c0f2c04083fca 100644 --- a/impeller/typographer/backends/stb/typeface_stb.h +++ b/impeller/typographer/backends/stb/typeface_stb.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_STB_TYPEFACE_STB_H_ +#define FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_STB_TYPEFACE_STB_H_ #include "flutter/fml/macros.h" #include "flutter/fml/mapping.h" @@ -46,3 +47,5 @@ class TypefaceSTB final : public Typeface, }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_STB_TYPEFACE_STB_H_ diff --git a/impeller/typographer/backends/stb/typographer_context_stb.h b/impeller/typographer/backends/stb/typographer_context_stb.h index 14975ae4fb043..02e81328719ea 100644 --- a/impeller/typographer/backends/stb/typographer_context_stb.h +++ b/impeller/typographer/backends/stb/typographer_context_stb.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_STB_TYPOGRAPHER_CONTEXT_STB_H_ +#define FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_STB_TYPOGRAPHER_CONTEXT_STB_H_ #include "impeller/typographer/typographer_context.h" @@ -36,3 +37,5 @@ class TypographerContextSTB : public TypographerContext { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_STB_TYPOGRAPHER_CONTEXT_STB_H_ diff --git a/impeller/typographer/font.h b/impeller/typographer/font.h index bbfc569860b72..4f21748d5e769 100644 --- a/impeller/typographer/font.h +++ b/impeller/typographer/font.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TYPOGRAPHER_FONT_H_ +#define FLUTTER_IMPELLER_TYPOGRAPHER_FONT_H_ #include #include @@ -77,3 +78,5 @@ struct std::hash { return fml::HashCombine(m.point_size, m.skewX, m.scaleX); } }; + +#endif // FLUTTER_IMPELLER_TYPOGRAPHER_FONT_H_ diff --git a/impeller/typographer/font_glyph_pair.h b/impeller/typographer/font_glyph_pair.h index 00b59411d3308..dd2d47e82b4ee 100644 --- a/impeller/typographer/font_glyph_pair.h +++ b/impeller/typographer/font_glyph_pair.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TYPOGRAPHER_FONT_GLYPH_PAIR_H_ +#define FLUTTER_IMPELLER_TYPOGRAPHER_FONT_GLYPH_PAIR_H_ #include #include @@ -54,3 +55,5 @@ struct std::equal_to { return lhs.font.IsEqual(rhs.font) && lhs.scale == rhs.scale; } }; + +#endif // FLUTTER_IMPELLER_TYPOGRAPHER_FONT_GLYPH_PAIR_H_ diff --git a/impeller/typographer/glyph.h b/impeller/typographer/glyph.h index c9aad01cba317..7e2d688d2b43b 100644 --- a/impeller/typographer/glyph.h +++ b/impeller/typographer/glyph.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TYPOGRAPHER_GLYPH_H_ +#define FLUTTER_IMPELLER_TYPOGRAPHER_GLYPH_H_ #include #include @@ -69,3 +70,5 @@ struct std::less { return lhs.index < rhs.index; } }; + +#endif // FLUTTER_IMPELLER_TYPOGRAPHER_GLYPH_H_ diff --git a/impeller/typographer/glyph_atlas.h b/impeller/typographer/glyph_atlas.h index 94e4e8380a74e..ea4ea295e4845 100644 --- a/impeller/typographer/glyph_atlas.h +++ b/impeller/typographer/glyph_atlas.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TYPOGRAPHER_GLYPH_ATLAS_H_ +#define FLUTTER_IMPELLER_TYPOGRAPHER_GLYPH_ATLAS_H_ #include #include @@ -204,3 +205,5 @@ class FontGlyphAtlas { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_TYPOGRAPHER_GLYPH_ATLAS_H_ diff --git a/impeller/typographer/lazy_glyph_atlas.h b/impeller/typographer/lazy_glyph_atlas.h index 3c14b2359bc8b..a263ea188f0ec 100644 --- a/impeller/typographer/lazy_glyph_atlas.h +++ b/impeller/typographer/lazy_glyph_atlas.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TYPOGRAPHER_LAZY_GLYPH_ATLAS_H_ +#define FLUTTER_IMPELLER_TYPOGRAPHER_LAZY_GLYPH_ATLAS_H_ #include @@ -45,3 +46,5 @@ class LazyGlyphAtlas { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_TYPOGRAPHER_LAZY_GLYPH_ATLAS_H_ diff --git a/impeller/typographer/rectangle_packer.h b/impeller/typographer/rectangle_packer.h index 836849b42e239..9213cae678454 100644 --- a/impeller/typographer/rectangle_packer.h +++ b/impeller/typographer/rectangle_packer.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TYPOGRAPHER_RECTANGLE_PACKER_H_ +#define FLUTTER_IMPELLER_TYPOGRAPHER_RECTANGLE_PACKER_H_ #include "flutter/fml/logging.h" @@ -69,3 +70,5 @@ class RectanglePacker { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_TYPOGRAPHER_RECTANGLE_PACKER_H_ diff --git a/impeller/typographer/text_frame.h b/impeller/typographer/text_frame.h index d0d2d03e8068c..1089039cb2a14 100644 --- a/impeller/typographer/text_frame.h +++ b/impeller/typographer/text_frame.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TYPOGRAPHER_TEXT_FRAME_H_ +#define FLUTTER_IMPELLER_TYPOGRAPHER_TEXT_FRAME_H_ #include "flutter/fml/macros.h" #include "impeller/typographer/glyph_atlas.h" @@ -75,3 +76,5 @@ class TextFrame { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_TYPOGRAPHER_TEXT_FRAME_H_ diff --git a/impeller/typographer/text_run.h b/impeller/typographer/text_run.h index 340db94d9f40d..6bec4d19187a2 100644 --- a/impeller/typographer/text_run.h +++ b/impeller/typographer/text_run.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TYPOGRAPHER_TEXT_RUN_H_ +#define FLUTTER_IMPELLER_TYPOGRAPHER_TEXT_RUN_H_ #include @@ -77,3 +78,5 @@ class TextRun { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_TYPOGRAPHER_TEXT_RUN_H_ diff --git a/impeller/typographer/typeface.h b/impeller/typographer/typeface.h index 45722cbe7de93..bf5123a46ec40 100644 --- a/impeller/typographer/typeface.h +++ b/impeller/typographer/typeface.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TYPOGRAPHER_TYPEFACE_H_ +#define FLUTTER_IMPELLER_TYPOGRAPHER_TYPEFACE_H_ #include "flutter/fml/macros.h" #include "impeller/base/comparable.h" @@ -31,3 +32,5 @@ class Typeface : public Comparable { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_TYPOGRAPHER_TYPEFACE_H_ diff --git a/impeller/typographer/typographer_context.h b/impeller/typographer/typographer_context.h index 696d09309177e..6e50027151189 100644 --- a/impeller/typographer/typographer_context.h +++ b/impeller/typographer/typographer_context.h @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_IMPELLER_TYPOGRAPHER_TYPOGRAPHER_CONTEXT_H_ +#define FLUTTER_IMPELLER_TYPOGRAPHER_TYPOGRAPHER_CONTEXT_H_ #include @@ -53,3 +54,5 @@ class TypographerContext { }; } // namespace impeller + +#endif // FLUTTER_IMPELLER_TYPOGRAPHER_TYPOGRAPHER_CONTEXT_H_ diff --git a/lib/ui/text.dart b/lib/ui/text.dart index 374011ea45c66..ff4665162577f 100644 --- a/lib/ui/text.dart +++ b/lib/ui/text.dart @@ -1201,6 +1201,9 @@ class FontVariation { /// * [Paragraph.getClosestGlyphInfoForOffset], which finds the [GlyphInfo] of /// the glyph(s) onscreen that's closest to the given [Offset]. final class GlyphInfo { + /// Creates a [GlyphInfo] with the specified values. + GlyphInfo(this.graphemeClusterLayoutBounds, this.graphemeClusterCodeUnitRange, this.writingDirection); + GlyphInfo._(double left, double top, double right, double bottom, int graphemeStart, int graphemeEnd, bool isLTR) : graphemeClusterLayoutBounds = Rect.fromLTRB(left, top, right, bottom), graphemeClusterCodeUnitRange = TextRange(start: graphemeStart, end: graphemeEnd), @@ -1209,7 +1212,7 @@ final class GlyphInfo { /// The layout bounding rect of the associated character, in the paragraph's /// coordinates. /// - /// This is **not** the tight bounding box that encloses the character's outline. + /// This is **not** a tight bounding box that encloses the character's outline. /// The vertical extent reported is derived from the font metrics (instead of /// glyph metrics), and the horizontal extent is the horizontal advance of the /// character. @@ -3017,18 +3020,24 @@ abstract class Paragraph { List getBoxesForPlaceholders(); /// Returns the text position closest to the given offset. + /// + /// This method always returns a [TextPosition] for any given [offset], even + /// when the [offset] is not close to any text, or when the paragraph is empty. + /// This is useful for determining the text to select when the user drags the + /// text selection handle. + /// + /// See also: + /// + /// * [getClosestGlyphInfoForOffset], which returns more information about + /// the closest character to an [Offset]. TextPosition getPositionForOffset(Offset offset); /// Returns the [GlyphInfo] of the glyph closest to the given `offset` in the - /// paragraph coordinate system, or null if the glyph is not in the visible - /// range. + /// paragraph coordinate system, or null if if the text is empty, or is + /// entirely clipped or ellipsized away. /// /// This method first finds the line closest to `offset.dy`, and then returns /// the [GlyphInfo] of the closest glyph(s) within that line. - /// - /// This method can be used to implement per-glyph hit-testing. The returned - /// [GlyphInfo] can help determine whether the given `offset` directly hits a - /// glyph in the paragraph. GlyphInfo? getClosestGlyphInfoForOffset(Offset offset); /// Returns the [GlyphInfo] located at the given UTF-16 `codeUnitOffset` in diff --git a/lib/web_ui/lib/src/engine/canvaskit/embedded_views.dart b/lib/web_ui/lib/src/engine/canvaskit/embedded_views.dart index f7a8dcfaa5e65..cecfa354219c1 100644 --- a/lib/web_ui/lib/src/engine/canvaskit/embedded_views.dart +++ b/lib/web_ui/lib/src/engine/canvaskit/embedded_views.dart @@ -657,8 +657,8 @@ class HtmlViewEmbedder { element.remove(); } - /// Clears the state of this view embedder. Used in tests. - void debugClear() { + /// Disposes the state of this view embedder. + void dispose() { final Set allViews = PlatformViewManager.instance.debugClear(); disposeViews(allViews); _context = EmbedderFrameContext(); diff --git a/lib/web_ui/lib/src/engine/canvaskit/rasterizer.dart b/lib/web_ui/lib/src/engine/canvaskit/rasterizer.dart index 104d96109fa23..d9280f28b6d7e 100644 --- a/lib/web_ui/lib/src/engine/canvaskit/rasterizer.dart +++ b/lib/web_ui/lib/src/engine/canvaskit/rasterizer.dart @@ -43,8 +43,8 @@ class Rasterizer { final CkPictureRecorder pictureRecorder = CkPictureRecorder(); pictureRecorder.beginRecording(ui.Offset.zero & _currentFrameSize); pictureRecorder.recordingCanvas!.clear(const ui.Color(0x00000000)); - final Frame compositorFrame = context.acquireFrame( - pictureRecorder.recordingCanvas!, viewEmbedder); + final Frame compositorFrame = + context.acquireFrame(pictureRecorder.recordingCanvas!, viewEmbedder); compositorFrame.raster(layerTree, ignoreRasterCache: true); @@ -54,4 +54,10 @@ class Rasterizer { viewEmbedder.submitFrame(); } + + /// Disposes of this rasterizer. + void dispose() { + viewEmbedder.dispose(); + renderCanvasFactory.dispose(); + } } diff --git a/lib/web_ui/lib/src/engine/canvaskit/render_canvas_factory.dart b/lib/web_ui/lib/src/engine/canvaskit/render_canvas_factory.dart index 387b63156524b..e814c9e6fe7e9 100644 --- a/lib/web_ui/lib/src/engine/canvaskit/render_canvas_factory.dart +++ b/lib/web_ui/lib/src/engine/canvaskit/render_canvas_factory.dart @@ -9,7 +9,7 @@ import '../../engine.dart'; class RenderCanvasFactory { RenderCanvasFactory() { assert(() { - registerHotRestartListener(debugClear); + registerHotRestartListener(dispose); return true; }()); } @@ -102,8 +102,8 @@ class RenderCanvasFactory { return false; } - /// Dispose all canvases created by this factory. Used in tests. - void debugClear() { + /// Dispose all canvases created by this factory. + void dispose() { for (final RenderCanvas canvas in _cache) { canvas.dispose(); } diff --git a/lib/web_ui/lib/src/engine/canvaskit/renderer.dart b/lib/web_ui/lib/src/engine/canvaskit/renderer.dart index 1caf88ffaa80e..567fac6849883 100644 --- a/lib/web_ui/lib/src/engine/canvaskit/renderer.dart +++ b/lib/web_ui/lib/src/engine/canvaskit/renderer.dart @@ -55,6 +55,11 @@ class CanvasKitRenderer implements Renderer { /// is supported. final Surface pictureToImageSurface = Surface(); + // Listens for view creation events from the view manager. + StreamSubscription? _onViewCreatedListener; + // Listens for view disposal events from the view manager. + StreamSubscription? _onViewDisposedListener; + @override Future initialize() async { _initialized ??= () async { @@ -64,6 +69,20 @@ class CanvasKitRenderer implements Renderer { canvasKit = await downloadCanvasKit(); windowFlutterCanvasKit = canvasKit; } + // Views may have been registered before this renderer was initialized. + // Create rasterizers for them and then start listening for new view + // creation/disposal events. + final FlutterViewManager viewManager = + EnginePlatformDispatcher.instance.viewManager; + if (_onViewCreatedListener == null) { + for (final EngineFlutterView view in viewManager.views) { + _onViewCreated(view.viewId); + } + } + _onViewCreatedListener ??= + viewManager.onViewCreated.listen(_onViewCreated); + _onViewDisposedListener ??= + viewManager.onViewDisposed.listen(_onViewDisposed); _instance = this; }(); return _initialized; @@ -394,37 +413,44 @@ class CanvasKitRenderer implements Renderer { frameTimingsOnBuildFinish(); frameTimingsOnRasterStart(); - // TODO(harryterkelsen): Use `FlutterViewManager.onViewsChanged` to manage - // the lifecycle of Rasterizers, - // https://github.com/flutter/flutter/issues/137073. - final Rasterizer rasterizer = - _getRasterizerForView(view as EngineFlutterView); + assert(_rasterizers.containsKey(view.viewId), + "Unable to render to a view which hasn't been registered"); + final Rasterizer rasterizer = _rasterizers[view.viewId]!; rasterizer.draw((scene as LayerScene).layerTree); frameTimingsOnRasterFinish(); } - final Map _rasterizers = - {}; + // Map from view id to the associated Rasterizer for that view. + final Map _rasterizers = {}; - Rasterizer _getRasterizerForView(EngineFlutterView view) { - return _rasterizers.putIfAbsent(view, () { - return Rasterizer(view); - }); + void _onViewCreated(int viewId) { + final EngineFlutterView view = + EnginePlatformDispatcher.instance.viewManager[viewId]!; + _rasterizers[view.viewId] = Rasterizer(view); + } + + void _onViewDisposed(int viewId) { + // The view has already been disposed. + if (!_rasterizers.containsKey(viewId)) { + return; + } + final Rasterizer rasterizer = _rasterizers.remove(viewId)!; + rasterizer.dispose(); } - /// Returns the [Rasterizer] that has been created for the given [view]. - /// Used in tests. - Rasterizer debugGetRasterizerForView(EngineFlutterView view) { - return _getRasterizerForView(view); + Rasterizer? debugGetRasterizerForView(EngineFlutterView view) { + return _rasterizers[view.viewId]; } - /// Resets the state of the renderer. Used in tests. - void debugClear() { + /// Disposes this renderer. + void dispose() { + _onViewCreatedListener?.cancel(); + _onViewDisposedListener?.cancel(); for (final Rasterizer rasterizer in _rasterizers.values) { - rasterizer.renderCanvasFactory.debugClear(); - rasterizer.viewEmbedder.debugClear(); + rasterizer.dispose(); } + _rasterizers.clear(); } @override diff --git a/lib/web_ui/lib/src/engine/embedder.dart b/lib/web_ui/lib/src/engine/embedder.dart index 04455eff9611d..05c69580832e3 100644 --- a/lib/web_ui/lib/src/engine/embedder.dart +++ b/lib/web_ui/lib/src/engine/embedder.dart @@ -2,15 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:ui/ui.dart' as ui; - import '../engine.dart' show buildMode, renderer; import 'browser_detection.dart'; import 'configuration.dart'; import 'dom.dart'; -import 'platform_dispatcher.dart'; -import 'text_editing/text_editing.dart'; -import 'view_embedder/style_manager.dart'; import 'window.dart'; /// Controls the placement and lifecycle of a Flutter view on the web page. @@ -41,8 +36,6 @@ class FlutterViewEmbedder { /// global resources such svg filters and clip paths when using webkit. DomElement? _resourcesHost; - DomElement get _semanticsHostElement => window.dom.semanticsHost; - DomElement get _flutterViewElement => window.dom.rootElement; DomShadowRoot get _glassPaneShadow => window.dom.renderingHost; @@ -64,34 +57,6 @@ class FlutterViewEmbedder { ); renderer.reset(this); - - window.onResize.listen(_metricsDidChange); - } - - /// Called immediately after browser window metrics change. - /// - /// When there is a text editing going on in mobile devices, do not change - /// the physicalSize, change the [window.viewInsets]. See: - /// https://api.flutter.dev/flutter/dart-ui/FlutterView/viewInsets.html - /// https://api.flutter.dev/flutter/dart-ui/FlutterView/physicalSize.html - /// - /// Note: always check for rotations for a mobile device. Update the physical - /// size if the change is caused by a rotation. - void _metricsDidChange(ui.Size? newSize) { - StyleManager.scaleSemanticsHost( - _semanticsHostElement, - window.devicePixelRatio, - ); - // TODO(dit): Do not computePhysicalSize twice, https://github.com/flutter/flutter/issues/117036 - if (isMobile && !window.isRotation() && textEditing.isEditing) { - window.computeOnScreenKeyboardInsets(true); - EnginePlatformDispatcher.instance.invokeOnMetricsChanged(); - } else { - window.computePhysicalSize(); - // When physical size changes this value has to be recalculated. - window.computeOnScreenKeyboardInsets(false); - EnginePlatformDispatcher.instance.invokeOnMetricsChanged(); - } } /// Add an element as a global resource to be referenced by CSS. diff --git a/lib/web_ui/lib/src/engine/view_embedder/flutter_view_manager.dart b/lib/web_ui/lib/src/engine/view_embedder/flutter_view_manager.dart index 0024c059da4ed..fc6cced9eefe0 100644 --- a/lib/web_ui/lib/src/engine/view_embedder/flutter_view_manager.dart +++ b/lib/web_ui/lib/src/engine/view_embedder/flutter_view_manager.dart @@ -15,12 +15,18 @@ class FlutterViewManager { // A map of (optional) JsFlutterViewOptions, indexed by their viewId. final Map _jsViewOptions = {}; - // The controller of the [onViewsChanged] stream. - final StreamController _onViewsChangedController = - StreamController.broadcast(); + // The controller of the [onViewCreated] stream. + final StreamController _onViewCreatedController = + StreamController.broadcast(sync: true); + // The controller of the [onViewDisposed] stream. + final StreamController _onViewDisposedController = + StreamController.broadcast(sync: true); - /// A stream of `void` events that will fire when a view is registered/unregistered. - Stream get onViewsChanged => _onViewsChangedController.stream; + /// A stream of viewIds that will fire when a view is created. + Stream get onViewCreated => _onViewCreatedController.stream; + + /// A stream of viewIds that will fire when a view is disposed. + Stream get onViewDisposed => _onViewDisposedController.stream; /// Exposes all the [EngineFlutterView]s registered so far. Iterable get views => _viewData.values; @@ -33,7 +39,8 @@ class FlutterViewManager { EngineFlutterView createAndRegisterView( JsFlutterViewOptions jsViewOptions, ) { - final EngineFlutterView view = EngineFlutterView(_dispatcher, jsViewOptions.hostElement); + final EngineFlutterView view = + EngineFlutterView(_dispatcher, jsViewOptions.hostElement); registerView(view, jsViewOptions: jsViewOptions); return view; } @@ -53,7 +60,7 @@ class FlutterViewManager { if (jsViewOptions != null) { _jsViewOptions[viewId] = jsViewOptions; } - _onViewsChangedController.add(null); + _onViewCreatedController.add(viewId); return view; } @@ -74,7 +81,7 @@ class FlutterViewManager { JsFlutterViewOptions? unregisterView(int viewId) { _viewData.remove(viewId); // .dispose(); final JsFlutterViewOptions? jsViewOptions = _jsViewOptions.remove(viewId); - _onViewsChangedController.add(null); + _onViewDisposedController.add(viewId); return jsViewOptions; } @@ -91,7 +98,8 @@ class FlutterViewManager { // inside the loop. _viewData.keys.toList().forEach(disposeAndUnregisterView); // Let listeners receive the unregistration events from the loop above, then - // close the stream. - _onViewsChangedController.close(); + // close the streams. + _onViewCreatedController.close(); + _onViewDisposedController.close(); } } diff --git a/lib/web_ui/lib/src/engine/window.dart b/lib/web_ui/lib/src/engine/window.dart index f91dc68395063..a57cd1919edeb 100644 --- a/lib/web_ui/lib/src/engine/window.dart +++ b/lib/web_ui/lib/src/engine/window.dart @@ -10,6 +10,7 @@ import 'package:ui/ui.dart' as ui; import 'package:ui/ui_web/src/ui_web.dart' as ui_web; import '../engine.dart' show DimensionsProvider, registerHotRestartListener, renderer; +import 'browser_detection.dart'; import 'display.dart'; import 'dom.dart'; import 'mouse/context_menu.dart'; @@ -20,9 +21,11 @@ import 'platform_views/message_handler.dart'; import 'pointer_binding.dart'; import 'semantics.dart'; import 'services.dart'; +import 'text_editing/text_editing.dart'; import 'util.dart'; import 'view_embedder/dom_manager.dart'; import 'view_embedder/embedding_strategy/embedding_strategy.dart'; +import 'view_embedder/style_manager.dart'; typedef _HandleMessageCallBack = Future Function(); @@ -61,6 +64,7 @@ base class EngineFlutterView implements ui.FlutterView { // hot restart. embeddingStrategy.attachViewRoot(dom.rootElement); pointerBinding = PointerBinding(this); + _resizeSubscription = onResize.listen(_didResize); registerHotRestartListener(dispose); } @@ -78,6 +82,8 @@ base class EngineFlutterView implements ui.FlutterView { /// Abstracts all the DOM manipulations required to embed a Flutter view in a user-supplied `hostElement`. final EmbeddingStrategy embeddingStrategy; + late final StreamSubscription _resizeSubscription; + final ViewConfiguration _viewConfiguration = const ViewConfiguration(); /// Whether this [EngineFlutterView] has been disposed or not. @@ -91,6 +97,7 @@ base class EngineFlutterView implements ui.FlutterView { return; } isDisposed = true; + _resizeSubscription.cancel(); dimensionsProvider.close(); pointerBinding.dispose(); dom.rootElement.remove(); @@ -136,11 +143,7 @@ base class EngineFlutterView implements ui.FlutterView { @override ui.Size get physicalSize { - if (_physicalSize == null) { - computePhysicalSize(); - } - assert(_physicalSize != null); - return _physicalSize!; + return _physicalSize ??= _computePhysicalSize(); } /// Lazily populated and cleared at the end of the frame. @@ -148,29 +151,24 @@ base class EngineFlutterView implements ui.FlutterView { ui.Size? debugPhysicalSizeOverride; - /// Computes the physical size of the screen from [domWindow]. + /// Computes the physical size of the view. /// /// This function is expensive. It triggers browser layout if there are /// pending DOM writes. - void computePhysicalSize() { - bool override = false; + ui.Size _computePhysicalSize() { + ui.Size? physicalSizeOverride; assert(() { - if (debugPhysicalSizeOverride != null) { - _physicalSize = debugPhysicalSizeOverride; - override = true; - } + physicalSizeOverride = debugPhysicalSizeOverride; return true; }()); - if (!override) { - _physicalSize = dimensionsProvider.computePhysicalSize(); - } + return physicalSizeOverride ?? dimensionsProvider.computePhysicalSize(); } /// Forces the view to recompute its physical size. Useful for tests. void debugForceResize() { - computePhysicalSize(); + _physicalSize = _computePhysicalSize(); } @override @@ -202,6 +200,69 @@ base class EngineFlutterView implements ui.FlutterView { final DimensionsProvider dimensionsProvider; Stream get onResize => dimensionsProvider.onResize; + + /// Called immediately after the view has been resized. + /// + /// When there is a text editing going on in mobile devices, do not change + /// the physicalSize, change the [window.viewInsets]. See: + /// https://api.flutter.dev/flutter/dart-ui/FlutterView/viewInsets.html + /// https://api.flutter.dev/flutter/dart-ui/FlutterView/physicalSize.html + /// + /// Note: always check for rotations for a mobile device. Update the physical + /// size if the change is caused by a rotation. + void _didResize(ui.Size? newSize) { + StyleManager.scaleSemanticsHost(dom.semanticsHost, devicePixelRatio); + final ui.Size newPhysicalSize = _computePhysicalSize(); + final bool isEditingOnMobile = + isMobile && !_isRotation(newPhysicalSize) && textEditing.isEditing; + if (isEditingOnMobile) { + _computeOnScreenKeyboardInsets(true); + } else { + _physicalSize = newPhysicalSize; + // When physical size changes this value has to be recalculated. + _computeOnScreenKeyboardInsets(false); + } + platformDispatcher.invokeOnMetricsChanged(); + } + + /// Uses the previous physical size and current innerHeight/innerWidth + /// values to decide if a device is rotating. + /// + /// During a rotation the height and width values will (almost) swap place. + /// Values can slightly differ due to space occupied by the browser header. + /// For example the following values are collected for Pixel 3 rotation: + /// + /// height: 658 width: 393 + /// new height: 313 new width: 738 + /// + /// The following values are from a changed caused by virtual keyboard. + /// + /// height: 658 width: 393 + /// height: 368 width: 393 + bool _isRotation(ui.Size newPhysicalSize) { + // This method compares the new dimensions with the previous ones. + // Return false if the previous dimensions are not set. + if (_physicalSize != null) { + // First confirm both height and width are effected. + if (_physicalSize!.height != newPhysicalSize.height && _physicalSize!.width != newPhysicalSize.width) { + // If prior to rotation height is bigger than width it should be the + // opposite after the rotation and vice versa. + if ((_physicalSize!.height > _physicalSize!.width && newPhysicalSize.height < newPhysicalSize.width) || + (_physicalSize!.width > _physicalSize!.height && newPhysicalSize.width < newPhysicalSize.height)) { + // Rotation detected + return true; + } + } + } + return false; + } + + void _computeOnScreenKeyboardInsets(bool isEditingOnMobile) { + _viewInsets = dimensionsProvider.computeKeyboardInsets( + _physicalSize!.height, + isEditingOnMobile, + ); + } } final class _EngineFlutterViewImpl extends EngineFlutterView { @@ -543,46 +604,6 @@ final class EngineFlutterWindow extends EngineFlutterView implements ui.Singleto display.debugOverrideDevicePixelRatio(value); } - void computeOnScreenKeyboardInsets(bool isEditingOnMobile) { - _viewInsets = dimensionsProvider.computeKeyboardInsets( - _physicalSize!.height, - isEditingOnMobile, - ); - } - - /// Uses the previous physical size and current innerHeight/innerWidth - /// values to decide if a device is rotating. - /// - /// During a rotation the height and width values will (almost) swap place. - /// Values can slightly differ due to space occupied by the browser header. - /// For example the following values are collected for Pixel 3 rotation: - /// - /// height: 658 width: 393 - /// new height: 313 new width: 738 - /// - /// The following values are from a changed caused by virtual keyboard. - /// - /// height: 658 width: 393 - /// height: 368 width: 393 - bool isRotation() { - // This method compares the new dimensions with the previous ones. - // Return false if the previous dimensions are not set. - if (_physicalSize != null) { - final ui.Size current = dimensionsProvider.computePhysicalSize(); - // First confirm both height and width are effected. - if (_physicalSize!.height != current.height && _physicalSize!.width != current.width) { - // If prior to rotation height is bigger than width it should be the - // opposite after the rotation and vice versa. - if ((_physicalSize!.height > _physicalSize!.width && current.height < current.width) || - (_physicalSize!.width > _physicalSize!.height && current.width < current.height)) { - // Rotation detected - return true; - } - } - } - return false; - } - // TODO(mdebbar): Deprecate this and remove it. // https://github.com/flutter/flutter/issues/127395 ui.Size? get webOnlyDebugPhysicalSizeOverride { diff --git a/lib/web_ui/test/canvaskit/common.dart b/lib/web_ui/test/canvaskit/common.dart index d11dc2e04c871..72f5e64e652cb 100644 --- a/lib/web_ui/test/canvaskit/common.dart +++ b/lib/web_ui/test/canvaskit/common.dart @@ -22,10 +22,6 @@ void setUpCanvasKitTest() { setUpTestViewDimensions: false, ); - tearDown(() { - CanvasKitRenderer.instance.debugClear(); - }); - setUp(() => renderer.fontCollection.fontFallbackManager!.downloadQueue .fallbackFontUrlPrefixOverride = 'assets/fallback_fonts/'); tearDown(() => renderer.fontCollection.fontFallbackManager!.downloadQueue diff --git a/lib/web_ui/test/canvaskit/embedded_views_test.dart b/lib/web_ui/test/canvaskit/embedded_views_test.dart index 7884b85aeb8a8..1f225d9498eaa 100644 --- a/lib/web_ui/test/canvaskit/embedded_views_test.dart +++ b/lib/web_ui/test/canvaskit/embedded_views_test.dart @@ -61,6 +61,8 @@ void testMain() { reason: 'The slot reenables pointer events.'); expect(contentsHost.getAttribute('slot'), slot.getAttribute('name'), reason: 'The contents and slot are correctly related.'); + + await disposePlatformView(0); }); test('clips platform views with RRects', () async { @@ -101,6 +103,8 @@ void testMain() { sceneHost.querySelectorAll('flt-clip').single.style.height, '100%', ); + + await disposePlatformView(0); }); test('correctly transforms platform views', () async { @@ -131,6 +135,8 @@ void testMain() { // 503 (5 * 100 + 3). 'matrix3d(5, 0, 0, 0, 0, 5, 0, 0, 0, 0, 5, 0, 515, 515, 0, 1)', ); + + await disposePlatformView(0); }); test('correctly offsets platform views', () async { @@ -157,6 +163,8 @@ void testMain() { expect(slotRect.top, 4); expect(slotRect.right, 8); expect(slotRect.bottom, 10); + + await disposePlatformView(0); }); // Returns the list of CSS transforms applied to the ancestor chain of @@ -189,8 +197,7 @@ void testMain() { CanvasKitRenderer.instance.renderScene(sb.build(), implicitView); // Transformations happen on the slot element. - DomElement slotHost = - sceneHost.querySelector('flt-platform-view-slot')!; + DomElement slotHost = sceneHost.querySelector('flt-platform-view-slot')!; expect( getTransformChain(slotHost), @@ -220,6 +227,8 @@ void testMain() { 'matrix(1, 0, 0, 1, 3, 3)', ], ); + + await disposePlatformView(0); }); test('converts device pixels to logical pixels (no clips)', () async { @@ -245,6 +254,8 @@ void testMain() { getTransformChain(slotHost), ['matrix(0.25, 0, 0, 0.25, 1.5, 1.5)'], ); + + await disposePlatformView(0); }); test('converts device pixels to logical pixels (with clips)', () async { @@ -276,6 +287,8 @@ void testMain() { 'matrix(0.25, 0, 0, 0.25, 0.75, 0.75)', ], ); + + await disposePlatformView(0); }); test('renders overlays on top of platform views', () async { @@ -428,8 +441,11 @@ void testMain() { await createPlatformView(0, 'test-platform-view'); renderTestScene(viewCount: 0); _expectSceneMatches(<_EmbeddedViewMarker>[_overlay]); - // TODO(yjbanov): skipped due to https://github.com/flutter/flutter/issues/73867 - }, skip: isSafari); + + for (int i = 0; i < 16; i++) { + await disposePlatformView(i); + } + }); test('correctly reuses overlays', () async { final CkPicture testPicture = @@ -561,8 +577,11 @@ void testMain() { _overlay, ]); - // TODO(yjbanov): skipped due to https://github.com/flutter/flutter/issues/73867 - }, skip: isSafari); + for (int i = 0; i < 20; i++) { + await disposePlatformView(i); + } + + }); test('embeds and disposes of a platform view', () async { ui_web.platformViewRegistry.registerViewFactory( @@ -641,6 +660,8 @@ void testMain() { implicitView.debugPhysicalSizeOverride = null; implicitView.debugForceResize(); + + await disposePlatformView(0); // ImageDecoder is not supported in Safari or Firefox. }, skip: isSafari || isFirefox); @@ -695,6 +716,9 @@ void testMain() { platformViewsHost.querySelectorAll('flt-platform-view'), hasLength(2), ); + + await disposePlatformView(0); + await disposePlatformView(1); }); test( @@ -729,6 +753,8 @@ void testMain() { await Future.delayed(Duration.zero); renderTestScene(); expect(skPathDefs.childNodes, hasLength(1)); + + await disposePlatformView(0); }); test('does not crash when a prerolled platform view is not composited', @@ -749,6 +775,8 @@ void testMain() { _expectSceneMatches(<_EmbeddedViewMarker>[ _overlay, ]); + + await disposePlatformView(0); }); test('does not create overlays for invisible platform views', () async { @@ -951,6 +979,9 @@ void testMain() { _platformView, _overlay, ]); + for (int i = 0; i < 7; i++) { + await disposePlatformView(i); + } }); }); } diff --git a/lib/web_ui/test/canvaskit/multi_view_test.dart b/lib/web_ui/test/canvaskit/multi_view_test.dart index 2aa1815b67ea6..a5a67f473f4aa 100644 --- a/lib/web_ui/test/canvaskit/multi_view_test.dart +++ b/lib/web_ui/test/canvaskit/multi_view_test.dart @@ -7,6 +7,7 @@ import 'package:test/test.dart'; import 'package:ui/src/engine.dart'; import 'package:ui/ui.dart' as ui; +import '../common/matchers.dart'; import 'common.dart'; void main() { @@ -17,22 +18,55 @@ void testMain() { group('CanvasKit', () { setUpCanvasKitTest(); - test('can render into arbitrary views', () async { + late LayerScene scene; + + setUp(() { + // Create a scene to use in tests. final CkPicture picture = paintPicture(const ui.Rect.fromLTRB(0, 0, 60, 60), (CkCanvas canvas) { canvas.drawRect(const ui.Rect.fromLTRB(0, 0, 60, 60), CkPaint()..style = ui.PaintingStyle.fill); }); - final LayerSceneBuilder sb = LayerSceneBuilder(); - sb.addPicture(ui.Offset.zero, picture); - final LayerScene scene = sb.build(); + scene = sb.build(); + }); + + test('can render into arbitrary views', () async { CanvasKitRenderer.instance.renderScene(scene, implicitView); final EngineFlutterView anotherView = EngineFlutterView( EnginePlatformDispatcher.instance, createDomElement('another-view')); + EnginePlatformDispatcher.instance.viewManager.registerView(anotherView); + CanvasKitRenderer.instance.renderScene(scene, anotherView); }); + + test('will error if trying to render into an unregistered view', () async { + final EngineFlutterView unregisteredView = EngineFlutterView( + EnginePlatformDispatcher.instance, + createDomElement('unregistered-view')); + expect( + () => CanvasKitRenderer.instance.renderScene(scene, unregisteredView), + throwsAssertionError, + ); + }); + + test('will dispose the Rasterizer for a disposed view', () async { + final EngineFlutterView view = EngineFlutterView( + EnginePlatformDispatcher.instance, createDomElement('multi-view')); + EnginePlatformDispatcher.instance.viewManager.registerView(view); + expect( + CanvasKitRenderer.instance.debugGetRasterizerForView(view), + isNotNull, + ); + + EnginePlatformDispatcher.instance.viewManager + .disposeAndUnregisterView(view.viewId); + expect( + CanvasKitRenderer.instance.debugGetRasterizerForView(view), + isNull, + ); + }); }); } diff --git a/lib/web_ui/test/canvaskit/render_canvas_factory_test.dart b/lib/web_ui/test/canvaskit/render_canvas_factory_test.dart index 2e85655a19825..a627158ffc72d 100644 --- a/lib/web_ui/test/canvaskit/render_canvas_factory_test.dart +++ b/lib/web_ui/test/canvaskit/render_canvas_factory_test.dart @@ -71,7 +71,7 @@ void testMain() { EnginePlatformDispatcher.instance.implicitView!; final RenderCanvasFactory originalFactory = CanvasKitRenderer.instance - .debugGetRasterizerForView(implicitView) + .debugGetRasterizerForView(implicitView)! .renderCanvasFactory; // Cause the surface and its canvas to be attached to the page diff --git a/lib/web_ui/test/engine/view_embedder/flutter_view_manager_test.dart b/lib/web_ui/test/engine/view_embedder/flutter_view_manager_test.dart index f7f154c69a176..04fb618e9dc6c 100644 --- a/lib/web_ui/test/engine/view_embedder/flutter_view_manager_test.dart +++ b/lib/web_ui/test/engine/view_embedder/flutter_view_manager_test.dart @@ -10,6 +10,7 @@ import 'package:test/test.dart'; import 'package:ui/src/engine.dart'; import '../../common/matchers.dart'; +import '../../html/image_test.dart'; void main() { internalBootstrapBrowserTest(() => doTests); @@ -69,8 +70,13 @@ Future doTests() async { // Prepares a "timed-out" version of the onViewsChanged Stream so tests // can't hang "forever" waiting for this to complete. This stream will close // after 100ms of inactivity, regardless of what the test or the code do. - final Stream onViewsChanged = viewManager.onViewsChanged - .timeout(const Duration(milliseconds: 100), onTimeout: (EventSink sink) { + final Stream onViewCreated = viewManager.onViewCreated.timeout( + const Duration(milliseconds: 100), onTimeout: (EventSink sink) { + sink.close(); + }); + + final Stream onViewDisposed = viewManager.onViewDisposed.timeout( + const Duration(milliseconds: 100), onTimeout: (EventSink sink) { sink.close(); }); @@ -78,15 +84,21 @@ Future doTests() async { final EngineFlutterView view = EngineFlutterView(platformDispatcher, createDomElement('div')); final int viewId = view.viewId; - final Future> viewChangeEvents = onViewsChanged.toList(); + final Future> viewCreatedEvents = onViewCreated.toList(); + final Future> viewDisposedEvents = onViewDisposed.toList(); viewManager.registerView(view); viewManager.unregisterView(viewId); - expect(viewChangeEvents, completes); + expect(viewCreatedEvents, completes); + expect(viewDisposedEvents, completes); - final List events = await viewChangeEvents; + final List createdViewsList = await viewCreatedEvents; + final List disposedViewsList = await viewCreatedEvents; - expect(events, hasLength(2), reason: 'Should fire once per viewManager register/unregister call.'); + expect(createdViewsList, listEqual([viewId]), + reason: 'Should fire creation event for view'); + expect(disposedViewsList, listEqual([viewId]), + reason: 'Should fire dispose event for view'); }); }); }); diff --git a/lib/web_ui/test/engine/window_test.dart b/lib/web_ui/test/engine/window_test.dart index 6138ea2379a0a..ecf087d523fb3 100644 --- a/lib/web_ui/test/engine/window_test.dart +++ b/lib/web_ui/test/engine/window_test.dart @@ -536,4 +536,68 @@ Future testMain() async { throwsAssertionError, ); }); + + group('resizing', () { + late DomHTMLDivElement host; + late EngineFlutterView view; + late int metricsChangedCount; + + setUp(() async { + EngineFlutterDisplay.instance.debugOverrideDevicePixelRatio(2.5); + host = createDomHTMLDivElement(); + view = EngineFlutterView(EnginePlatformDispatcher.instance, host); + + host.style + ..width = '10px' + ..height = '10px'; + domDocument.body!.append(host); + // Let the DOM settle before starting the test, so we don't get the first + // 10,10 Size in the test. Otherwise, the ResizeObserver may trigger + // unexpectedly after the test has started, and break our "first" result. + await Future.delayed(const Duration(milliseconds: 250)); + + metricsChangedCount = 0; + view.platformDispatcher.onMetricsChanged = () { + metricsChangedCount++; + }; + }); + + tearDown(() { + view.dispose(); + host.remove(); + EngineFlutterDisplay.instance.debugOverrideDevicePixelRatio(null); + view.platformDispatcher.onMetricsChanged = null; + }); + + test('listens to resize', () async { + // Initial size is 10x10, with a 2.5 dpr, is equal to 25x25 physical pixels. + expect(view.physicalSize, const ui.Size(25.0, 25.0)); + expect(metricsChangedCount, 0); + + // Resize the host to 20x20. + host.style + ..width = '20px' + ..height = '20px'; + await view.onResize.first; + expect(view.physicalSize, const ui.Size(50.0, 50.0)); + expect(metricsChangedCount, 1); + }); + + test('maintains debugPhysicalSizeOverride', () async { + // Initial size is 10x10, with a 2.5 dpr, is equal to 25x25 physical pixels. + expect(view.physicalSize, const ui.Size(25.0, 25.0)); + + view.debugPhysicalSizeOverride = const ui.Size(100.0, 100.0); + view.debugForceResize(); + expect(view.physicalSize, const ui.Size(100.0, 100.0)); + + // Resize the host to 20x20. + host.style + ..width = '20px' + ..height = '20px'; + await view.onResize.first; + // The view should maintain the debugPhysicalSizeOverride. + expect(view.physicalSize, const ui.Size(100.0, 100.0)); + }); + }); } diff --git a/shell/common/BUILD.gn b/shell/common/BUILD.gn index 6e3cff31b7b02..79cfafe0173b2 100644 --- a/shell/common/BUILD.gn +++ b/shell/common/BUILD.gn @@ -344,14 +344,14 @@ if (enable_unittests) { # TODO(63837): This test is hard-coded to use a TestGLSurface so it cannot # run on fuchsia or when GL is not enabled. sources += [ "shell_io_manager_unittests.cc" ] - deps += [ "//third_party/swiftshader" ] + deps += [ "//flutter/third_party/swiftshader" ] } if (shell_enable_gl) { deps += [ + "//flutter/third_party/swiftshader", "//third_party/angle:libEGL_static", "//third_party/angle:libGLESv2_static", - "//third_party/swiftshader", ] } } diff --git a/shell/platform/darwin/macos/framework/Source/FlutterEmbedderKeyResponderTest.mm b/shell/platform/darwin/macos/framework/Source/FlutterEmbedderKeyResponderTest.mm index 60724af146baa..2443c80db37c9 100644 --- a/shell/platform/darwin/macos/framework/Source/FlutterEmbedderKeyResponderTest.mm +++ b/shell/platform/darwin/macos/framework/Source/FlutterEmbedderKeyResponderTest.mm @@ -136,6 +136,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->timestamp, 123000000.0f); EXPECT_EQ(event->physical, kPhysicalKeyA); @@ -158,6 +159,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeRepeat); EXPECT_EQ(event->physical, kPhysicalKeyA); EXPECT_EQ(event->logical, kLogicalKeyA); @@ -179,6 +181,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeUp); EXPECT_EQ(event->timestamp, 124000000.0f); EXPECT_EQ(event->physical, kPhysicalKeyA); @@ -213,6 +216,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->physical, kPhysicalAltRight); EXPECT_EQ(event->logical, kLogicalAltRight); @@ -227,6 +231,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->physical, kPhysicalKeyW); EXPECT_EQ(event->logical, kLogicalKeyW); @@ -241,6 +246,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeUp); EXPECT_EQ(event->physical, kPhysicalAltRight); EXPECT_EQ(event->logical, kLogicalAltRight); @@ -255,6 +261,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeUp); EXPECT_EQ(event->physical, kPhysicalKeyW); EXPECT_EQ(event->logical, kLogicalKeyW); @@ -282,6 +289,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->physical, kPhysicalKeyA); EXPECT_EQ(event->logical, 0x1400000000ull); @@ -296,6 +304,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeUp); EXPECT_EQ(event->physical, kPhysicalKeyA); EXPECT_EQ(event->logical, 0x1400000000ull); @@ -326,6 +335,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->physical, kPhysicalKeyA); EXPECT_EQ(event->logical, kLogicalKeyA); @@ -346,6 +356,7 @@ - (void)dealloc { EXPECT_EQ([events count], 2u); event = [events firstObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeUp); EXPECT_EQ(event->physical, kPhysicalKeyA); EXPECT_EQ(event->logical, kLogicalKeyA); @@ -353,6 +364,7 @@ - (void)dealloc { EXPECT_EQ(event->synthesized, true); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->physical, kPhysicalKeyA); EXPECT_EQ(event->logical, 0xE0ull /* à */); @@ -386,6 +398,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); EXPECT_EQ(last_handled, TRUE); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->physical, 0ull); EXPECT_EQ(event->logical, 0ull); EXPECT_FALSE([[events lastObject] hasCallback]); @@ -415,6 +428,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->physical, kPhysicalKeyA); EXPECT_EQ(event->logical, kLogicalKeyA); @@ -450,6 +464,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->timestamp, 123000000.0f); EXPECT_EQ(event->physical, kPhysicalShiftRight); @@ -466,6 +481,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->physical, kPhysicalKeyA); EXPECT_EQ(event->logical, kLogicalKeyA); @@ -481,6 +497,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeRepeat); EXPECT_EQ(event->physical, kPhysicalKeyA); EXPECT_EQ(event->logical, kLogicalKeyA); @@ -497,6 +514,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeUp); EXPECT_EQ(event->physical, kPhysicalShiftRight); EXPECT_EQ(event->logical, kLogicalShiftRight); @@ -512,6 +530,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeRepeat); EXPECT_EQ(event->physical, kPhysicalKeyA); EXPECT_EQ(event->logical, kLogicalKeyA); @@ -526,6 +545,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeUp); EXPECT_EQ(event->physical, kPhysicalKeyA); EXPECT_EQ(event->logical, kLogicalKeyA); @@ -563,6 +583,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->physical, kPhysicalNumpad1); EXPECT_EQ(event->logical, kLogicalNumpad1); @@ -580,6 +601,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->physical, kPhysicalF1); EXPECT_EQ(event->logical, kLogicalF1); @@ -596,6 +618,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->physical, kPhysicalKeyA); EXPECT_EQ(event->logical, kLogicalKeyA); @@ -613,6 +636,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->physical, kPhysicalShiftLeft); EXPECT_EQ(event->logical, kLogicalShiftLeft); @@ -629,6 +653,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeUp); EXPECT_EQ(event->physical, kPhysicalNumpad1); EXPECT_EQ(event->logical, kLogicalNumpad1); @@ -646,6 +671,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeUp); EXPECT_EQ(event->physical, kPhysicalF1); EXPECT_EQ(event->logical, kLogicalF1); @@ -662,6 +688,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeUp); EXPECT_EQ(event->physical, kPhysicalKeyA); EXPECT_EQ(event->logical, kLogicalKeyA); @@ -679,6 +706,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeUp); EXPECT_EQ(event->physical, kPhysicalShiftLeft); EXPECT_EQ(event->logical, kLogicalShiftLeft); @@ -708,6 +736,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->physical, kPhysicalShiftLeft); EXPECT_EQ(event->logical, kLogicalShiftLeft); @@ -724,6 +753,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->physical, kPhysicalShiftRight); EXPECT_EQ(event->logical, kLogicalShiftRight); @@ -740,6 +770,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeUp); EXPECT_EQ(event->physical, kPhysicalShiftLeft); EXPECT_EQ(event->logical, kLogicalShiftLeft); @@ -756,6 +787,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeUp); EXPECT_EQ(event->physical, kPhysicalShiftRight); EXPECT_EQ(event->logical, kLogicalShiftRight); @@ -797,6 +829,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->physical, kPhysicalShiftLeft); EXPECT_EQ(event->logical, kLogicalShiftLeft); @@ -816,8 +849,10 @@ - (void)dealloc { callback:keyEventCallback]; EXPECT_EQ([events count], 1u); - EXPECT_EQ([events lastObject].data->physical, 0u); - EXPECT_EQ([events lastObject].data->logical, 0u); + event = [events lastObject].data; + ASSERT_NE(event, nullptr); + EXPECT_EQ(event->physical, 0u); + EXPECT_EQ(event->logical, 0u); EXPECT_FALSE([[events lastObject] hasCallback]); EXPECT_EQ(last_handled, TRUE); [events removeAllObjects]; @@ -829,6 +864,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeUp); EXPECT_EQ(event->physical, kPhysicalShiftLeft); EXPECT_EQ(event->logical, kLogicalShiftLeft); @@ -852,8 +888,10 @@ - (void)dealloc { callback:keyEventCallback]; EXPECT_EQ([events count], 1u); - EXPECT_EQ([events lastObject].data->physical, 0u); - EXPECT_EQ([events lastObject].data->logical, 0u); + event = [events lastObject].data; + ASSERT_NE(event, nullptr); + EXPECT_EQ(event->physical, 0u); + EXPECT_EQ(event->logical, 0u); EXPECT_FALSE([[events lastObject] hasCallback]); EXPECT_EQ(last_handled, TRUE); [events removeAllObjects]; @@ -869,6 +907,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->physical, kPhysicalShiftLeft); EXPECT_EQ(event->logical, kLogicalShiftLeft); @@ -889,6 +928,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeUp); EXPECT_EQ(event->physical, kPhysicalShiftLeft); EXPECT_EQ(event->logical, kLogicalShiftLeft); @@ -912,6 +952,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->physical, kPhysicalShiftLeft); EXPECT_EQ(event->logical, kLogicalShiftLeft); @@ -932,6 +973,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->physical, kPhysicalShiftRight); EXPECT_EQ(event->logical, kLogicalShiftRight); @@ -952,6 +994,7 @@ - (void)dealloc { EXPECT_EQ([events count], 2u); event = [events firstObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeUp); EXPECT_EQ(event->physical, kPhysicalShiftLeft); EXPECT_EQ(event->logical, kLogicalShiftLeft); @@ -961,6 +1004,7 @@ - (void)dealloc { EXPECT_FALSE([[events firstObject] hasCallback]); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeUp); EXPECT_EQ(event->physical, kPhysicalShiftRight); EXPECT_EQ(event->logical, kLogicalShiftRight); @@ -1000,6 +1044,7 @@ - (void)dealloc { EXPECT_EQ([events count], 2u); event = [events firstObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->physical, kPhysicalShiftLeft); EXPECT_EQ(event->logical, kLogicalShiftLeft); @@ -1008,6 +1053,7 @@ - (void)dealloc { EXPECT_FALSE([[events firstObject] hasCallback]); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->physical, kPhysicalKeyA); EXPECT_EQ(event->logical, kLogicalKeyA); @@ -1027,6 +1073,7 @@ - (void)dealloc { EXPECT_EQ([events count], 2u); event = [events firstObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeUp); EXPECT_EQ(event->physical, kPhysicalShiftLeft); EXPECT_EQ(event->logical, kLogicalShiftLeft); @@ -1035,6 +1082,7 @@ - (void)dealloc { EXPECT_FALSE([[events firstObject] hasCallback]); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeUp); EXPECT_EQ(event->physical, kPhysicalKeyA); EXPECT_EQ(event->logical, kLogicalKeyA); @@ -1075,6 +1123,7 @@ - (void)dealloc { EXPECT_EQ([events count], 2u); event = [events firstObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->physical, kPhysicalCapsLock); EXPECT_EQ(event->logical, kLogicalCapsLock); @@ -1083,6 +1132,7 @@ - (void)dealloc { EXPECT_TRUE([[events firstObject] hasCallback]); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeUp); EXPECT_EQ(event->physical, kPhysicalCapsLock); EXPECT_EQ(event->logical, kLogicalCapsLock); @@ -1105,6 +1155,7 @@ - (void)dealloc { EXPECT_EQ([events count], 2u); event = [events firstObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->physical, kPhysicalCapsLock); EXPECT_EQ(event->logical, kLogicalCapsLock); @@ -1113,6 +1164,7 @@ - (void)dealloc { EXPECT_TRUE([[events firstObject] hasCallback]); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeUp); EXPECT_EQ(event->physical, kPhysicalCapsLock); EXPECT_EQ(event->logical, kLogicalCapsLock); @@ -1153,6 +1205,7 @@ - (void)dealloc { EXPECT_EQ([events count], 1u); EXPECT_EQ(last_handled, TRUE); event = [events lastObject].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->physical, 0ull); EXPECT_EQ(event->logical, 0ull); EXPECT_FALSE([[events lastObject] hasCallback]); @@ -1185,6 +1238,7 @@ - (void)dealloc { EXPECT_EQ([events count], 3u); event = events[0].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->physical, kPhysicalCapsLock); EXPECT_EQ(event->logical, kLogicalCapsLock); @@ -1193,6 +1247,7 @@ - (void)dealloc { EXPECT_FALSE([events[0] hasCallback]); event = events[1].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeUp); EXPECT_EQ(event->physical, kPhysicalCapsLock); EXPECT_EQ(event->logical, kLogicalCapsLock); @@ -1201,6 +1256,7 @@ - (void)dealloc { EXPECT_FALSE([events[1] hasCallback]); event = events[2].data; + ASSERT_NE(event, nullptr); EXPECT_EQ(event->type, kFlutterKeyEventTypeDown); EXPECT_EQ(event->physical, kPhysicalKeyA); EXPECT_EQ(event->logical, kLogicalKeyA); diff --git a/shell/platform/embedder/embedder_external_view.cc b/shell/platform/embedder/embedder_external_view.cc index 9360810463026..23ecd22415424 100644 --- a/shell/platform/embedder/embedder_external_view.cc +++ b/shell/platform/embedder/embedder_external_view.cc @@ -74,6 +74,7 @@ bool EmbedderExternalView::HasEngineRenderedContents() { DlOpSpy dl_op_spy; slice_->dispatch(dl_op_spy); has_engine_rendered_contents_ = dl_op_spy.did_draw() && !slice_->is_empty(); + // NOLINTNEXTLINE(bugprone-unchecked-optional-access) return has_engine_rendered_contents_.value(); } diff --git a/shell/platform/windows/BUILD.gn b/shell/platform/windows/BUILD.gn index 433736a42ff66..ecc9080965993 100644 --- a/shell/platform/windows/BUILD.gn +++ b/shell/platform/windows/BUILD.gn @@ -199,6 +199,7 @@ executable("flutter_windows_unittests") { "testing/flutter_window_test.h", "testing/flutter_windows_engine_builder.cc", "testing/flutter_windows_engine_builder.h", + "testing/mock_angle_surface_manager.h", "testing/mock_direct_manipulation.h", "testing/mock_gl_proc_table.h", "testing/mock_text_input_manager.cc", diff --git a/shell/platform/windows/flutter_windows_engine_unittests.cc b/shell/platform/windows/flutter_windows_engine_unittests.cc index 63c791b109932..3cbe679eb16e4 100644 --- a/shell/platform/windows/flutter_windows_engine_unittests.cc +++ b/shell/platform/windows/flutter_windows_engine_unittests.cc @@ -11,6 +11,7 @@ #include "flutter/shell/platform/windows/public/flutter_windows.h" #include "flutter/shell/platform/windows/testing/engine_modifier.h" #include "flutter/shell/platform/windows/testing/flutter_windows_engine_builder.h" +#include "flutter/shell/platform/windows/testing/mock_angle_surface_manager.h" #include "flutter/shell/platform/windows/testing/mock_window_binding_handler.h" #include "flutter/shell/platform/windows/testing/mock_windows_proc_table.h" #include "flutter/shell/platform/windows/testing/test_keyboard.h" @@ -131,7 +132,7 @@ TEST_F(FlutterWindowsEngineTest, RunDoesExpectedInitialization) { })); // Set the AngleSurfaceManager to !nullptr to test ANGLE rendering. - modifier.SetSurfaceManager(reinterpret_cast(1)); + modifier.SetSurfaceManager(std::make_unique()); engine->Run(); diff --git a/shell/platform/windows/flutter_windows_view_unittests.cc b/shell/platform/windows/flutter_windows_view_unittests.cc index ee5c280c6b7ba..de1379bf55290 100644 --- a/shell/platform/windows/flutter_windows_view_unittests.cc +++ b/shell/platform/windows/flutter_windows_view_unittests.cc @@ -19,6 +19,7 @@ #include "flutter/shell/platform/windows/flutter_windows_engine.h" #include "flutter/shell/platform/windows/flutter_windows_texture_registrar.h" #include "flutter/shell/platform/windows/testing/engine_modifier.h" +#include "flutter/shell/platform/windows/testing/mock_angle_surface_manager.h" #include "flutter/shell/platform/windows/testing/mock_window_binding_handler.h" #include "flutter/shell/platform/windows/testing/test_keyboard.h" @@ -118,28 +119,6 @@ class MockFlutterWindowsEngine : public FlutterWindowsEngine { FML_DISALLOW_COPY_AND_ASSIGN(MockFlutterWindowsEngine); }; -class MockAngleSurfaceManager : public AngleSurfaceManager { - public: - MockAngleSurfaceManager() : AngleSurfaceManager(false) {} - - MOCK_METHOD(bool, - CreateSurface, - (WindowsRenderTarget*, EGLint, EGLint), - (override)); - MOCK_METHOD(void, - ResizeSurface, - (WindowsRenderTarget*, EGLint, EGLint, bool), - (override)); - MOCK_METHOD(void, DestroySurface, (), (override)); - - MOCK_METHOD(bool, MakeCurrent, (), (override)); - MOCK_METHOD(bool, ClearCurrent, (), (override)); - MOCK_METHOD(void, SetVSyncEnabled, (bool), (override)); - - private: - FML_DISALLOW_COPY_AND_ASSIGN(MockAngleSurfaceManager); -}; - } // namespace // Ensure that submenu buttons have their expanded/collapsed status set @@ -264,7 +243,7 @@ TEST(FlutterWindowsViewTest, Shutdown) { EXPECT_CALL(*engine.get(), Stop).Times(1); EXPECT_CALL(*surface_manager.get(), DestroySurface).Times(1); - modifier.SetSurfaceManager(surface_manager.release()); + modifier.SetSurfaceManager(std::move(surface_manager)); view.SetEngine(engine.get()); } @@ -847,7 +826,7 @@ TEST(FlutterWindowsViewTest, WindowResizeTests) { EXPECT_CALL(*surface_manager.get(), DestroySurface).Times(1); FlutterWindowsView view(std::move(window_binding_handler)); - modifier.SetSurfaceManager(surface_manager.release()); + modifier.SetSurfaceManager(std::move(surface_manager)); view.SetEngine(engine.get()); fml::AutoResetWaitableEvent metrics_sent_latch; @@ -1250,7 +1229,7 @@ TEST(FlutterWindowsViewTest, DisablesVSyncAtStartup) { EXPECT_CALL(*engine.get(), Stop).Times(1); EXPECT_CALL(*surface_manager.get(), DestroySurface).Times(1); - modifier.SetSurfaceManager(surface_manager.release()); + modifier.SetSurfaceManager(std::move(surface_manager)); view.SetEngine(engine.get()); view.CreateRenderSurface(); @@ -1283,7 +1262,7 @@ TEST(FlutterWindowsViewTest, EnablesVSyncAtStartup) { EXPECT_CALL(*engine.get(), Stop).Times(1); EXPECT_CALL(*surface_manager.get(), DestroySurface).Times(1); - modifier.SetSurfaceManager(surface_manager.release()); + modifier.SetSurfaceManager(std::move(surface_manager)); view.SetEngine(engine.get()); view.CreateRenderSurface(); @@ -1320,7 +1299,7 @@ TEST(FlutterWindowsViewTest, DisablesVSyncAfterStartup) { EXPECT_CALL(*engine.get(), Stop).Times(1); EXPECT_CALL(*surface_manager.get(), DestroySurface).Times(1); - modifier.SetSurfaceManager(surface_manager.release()); + modifier.SetSurfaceManager(std::move(surface_manager)); view.SetEngine(engine.get()); view.CreateRenderSurface(); @@ -1358,7 +1337,7 @@ TEST(FlutterWindowsViewTest, EnablesVSyncAfterStartup) { EXPECT_CALL(*engine.get(), Stop).Times(1); EXPECT_CALL(*surface_manager.get(), DestroySurface).Times(1); - modifier.SetSurfaceManager(surface_manager.release()); + modifier.SetSurfaceManager(std::move(surface_manager)); view.SetEngine(engine.get()); view.CreateRenderSurface(); @@ -1399,7 +1378,7 @@ TEST(FlutterWindowsViewTest, UpdatesVSyncOnDwmUpdates) { EXPECT_CALL(*engine.get(), Stop).Times(1); EXPECT_CALL(*surface_manager.get(), DestroySurface).Times(1); - modifier.SetSurfaceManager(surface_manager.release()); + modifier.SetSurfaceManager(std::move(surface_manager)); view.SetEngine(engine.get()); view.GetEngine()->OnDwmCompositionChanged(); diff --git a/shell/platform/windows/testing/engine_modifier.h b/shell/platform/windows/testing/engine_modifier.h index ee355c0b5b973..a11ce1047da4f 100644 --- a/shell/platform/windows/testing/engine_modifier.h +++ b/shell/platform/windows/testing/engine_modifier.h @@ -29,14 +29,12 @@ class EngineModifier { // engine unless overwritten again. FlutterEngineProcTable& embedder_api() { return engine_->embedder_api_; } - // Explicitly sets the SurfaceManager being used by the FlutterWindowsEngine - // instance. This allows us to test fallback paths when a SurfaceManager fails - // to initialize for whatever reason. + // Override the surface manager used by the engine. // // Modifications are to the engine, and will last for the lifetime of the // engine unless overwritten again. - void SetSurfaceManager(AngleSurfaceManager* surface_manager) { - engine_->surface_manager_.reset(surface_manager); + void SetSurfaceManager(std::unique_ptr surface_manager) { + engine_->surface_manager_ = std::move(surface_manager); } /// Reset the start_time field that is used to align vsync events. diff --git a/shell/platform/windows/testing/mock_angle_surface_manager.h b/shell/platform/windows/testing/mock_angle_surface_manager.h new file mode 100644 index 0000000000000..412dcc64e30d2 --- /dev/null +++ b/shell/platform/windows/testing/mock_angle_surface_manager.h @@ -0,0 +1,41 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_MOCK_ANGLE_SURFACE_MANAGER_H_ +#define FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_MOCK_ANGLE_SURFACE_MANAGER_H_ + +#include "flutter/fml/macros.h" +#include "flutter/shell/platform/windows/angle_surface_manager.h" +#include "gmock/gmock.h" + +namespace flutter { +namespace testing { + +/// Mock for the |AngleSurfaceManager| base class. +class MockAngleSurfaceManager : public AngleSurfaceManager { + public: + MockAngleSurfaceManager() : AngleSurfaceManager(false) {} + + MOCK_METHOD(bool, + CreateSurface, + (WindowsRenderTarget*, EGLint, EGLint), + (override)); + MOCK_METHOD(void, + ResizeSurface, + (WindowsRenderTarget*, EGLint, EGLint, bool), + (override)); + MOCK_METHOD(void, DestroySurface, (), (override)); + + MOCK_METHOD(bool, MakeCurrent, (), (override)); + MOCK_METHOD(bool, ClearCurrent, (), (override)); + MOCK_METHOD(void, SetVSyncEnabled, (bool), (override)); + + private: + FML_DISALLOW_COPY_AND_ASSIGN(MockAngleSurfaceManager); +}; + +} // namespace testing +} // namespace flutter + +#endif // FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_MOCK_ANGLE_SURFACE_MANAGER_H_ diff --git a/shell/testing/BUILD.gn b/shell/testing/BUILD.gn index dd51d0a077604..06d67ede84029 100644 --- a/shell/testing/BUILD.gn +++ b/shell/testing/BUILD.gn @@ -50,7 +50,7 @@ executable("testing") { deps += [ ":tester_gpu_configuration", "//flutter/impeller", - "//third_party/swiftshader", + "//flutter/third_party/swiftshader", ] } diff --git a/testing/BUILD.gn b/testing/BUILD.gn index 99aaa0fc699d8..9eac2945251f4 100644 --- a/testing/BUILD.gn +++ b/testing/BUILD.gn @@ -169,8 +169,8 @@ if (enable_unittests && shell_enable_vulkan) { ] if (!is_fuchsia) { - deps += [ "//third_party/swiftshader" ] - configs += [ "//third_party/swiftshader:swiftshader_config" ] + deps += [ "//flutter/third_party/swiftshader" ] + configs += [ "//flutter/third_party/swiftshader:swiftshader_config" ] } } } @@ -260,12 +260,12 @@ if (use_swiftshader) { configs -= [ "//build/config/clang:extra_warnings" ] configs += [ "//third_party/angle:gl_prototypes", - "//third_party/swiftshader:swiftshader_config", + "//flutter/third_party/swiftshader:swiftshader_config", ] deps += [ + "//flutter/third_party/swiftshader", "//third_party/angle:libEGL_static", "//third_party/angle:libGLESv2_static", - "//third_party/swiftshader", ] } } diff --git a/testing/dart/text_test.dart b/testing/dart/text_test.dart index 5bbf5a62bba14..dd54059c8e0be 100644 --- a/testing/dart/text_test.dart +++ b/testing/dart/text_test.dart @@ -193,6 +193,18 @@ void testTextRange() { }); } +void testGlyphInfo() { + test('constructor', () { + const Rect testRect = Rect.fromLTWH(1, 2, 3, 4); + const TextRange testRange = TextRange(start: 5, end: 6); + const TextDirection testDirection = TextDirection.ltr; + final GlyphInfo info = GlyphInfo(testRect, testRange, testDirection); + expect(info.graphemeClusterLayoutBounds, testRect); + expect(info.graphemeClusterCodeUnitRange, testRange); + expect(info.writingDirection, testDirection); + }); +} + void testLoadFontFromList() { test('loadFontFromList will send platform message after font is loaded', () async { late String message; @@ -336,6 +348,7 @@ void main() { testTextStyle(); testTextHeightBehavior(); testTextRange(); + testGlyphInfo(); testLoadFontFromList(); testFontFeatureClass(); testFontVariation(); diff --git a/testing/ubsan_suppressions.txt b/testing/ubsan_suppressions.txt index ec24e31856af8..6bbcd41c9cf20 100644 --- a/testing/ubsan_suppressions.txt +++ b/testing/ubsan_suppressions.txt @@ -6,5 +6,5 @@ alignment:third_party/dart null:third_party/dart # Ignore errors in SwiftShader -undefined:third_party/swiftshader +undefined:flutter/third_party/swiftshader diff --git a/tools/licenses/lib/paths.dart b/tools/licenses/lib/paths.dart index a336afbcd02f0..a4205dc1c0a2b 100644 --- a/tools/licenses/lib/paths.dart +++ b/tools/licenses/lib/paths.dart @@ -91,6 +91,7 @@ final Set skippedPaths = { r'flutter/third_party/skia/third_party/vello', // not linked in r'flutter/third_party/skia/tools', // contains nothing that ends up in the binary executable r'flutter/third_party/stb', + r'flutter/third_party/swiftshader', // only used on hosts for tests r'flutter/third_party/test_shaders', // for tests only r'flutter/third_party/tinygltf', r'flutter/third_party/txt/third_party/fonts', @@ -185,7 +186,6 @@ final Set skippedPaths = { r'third_party/protobuf', // build-time dependency only r'third_party/root_certificates/certdata.pem', r'third_party/root_certificates/certdata.txt', - r'third_party/swiftshader', // only used on hosts for tests r'third_party/vulkan-deps/glslang/LICENSE', // excluded to make sure we don't accidentally apply it as a default license r'third_party/vulkan-deps/glslang/src/LICENSE.txt', // redundant with licenses inside files r'third_party/vulkan-deps/glslang/src/glslang/OSDependent/Web', // we only use glslang in impellerc, not in web apps