Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
38f3dad
Roll Skia from e6eb56d9b074 to fde9fe141863 (1 revision) (#45260)
skia-flutter-autoroll Aug 30, 2023
69f04bd
[Impeller] transform text path offsets so color sources match expecte…
Aug 30, 2023
dad87d3
Roll Dart SDK from 0cea73a8d3c3 to 96d3a79547fc (1 revision) (#45262)
skia-flutter-autoroll Aug 30, 2023
f11ee48
Roll Fuchsia Mac SDK from QKekosWnIY_ObKstn... to Y2xfuZM0ec5GQfHV8..…
skia-flutter-autoroll Aug 30, 2023
3aee4c5
Roll Skia from fde9fe141863 to 03289b20b5d3 (1 revision) (#45268)
skia-flutter-autoroll Aug 30, 2023
249cd28
Roll Dart SDK from 96d3a79547fc to 4352efd8497d (1 revision) (#45267)
skia-flutter-autoroll Aug 30, 2023
f476a1e
Roll Skia from 03289b20b5d3 to 80f4d2f303d0 (1 revision) (#45270)
skia-flutter-autoroll Aug 30, 2023
5f36a83
Roll Skia from 80f4d2f303d0 to 7492e29ad235 (1 revision) (#45272)
skia-flutter-autoroll Aug 30, 2023
159fda6
Roll Skia from 7492e29ad235 to a2728a7ad2a3 (1 revision) (#45273)
skia-flutter-autoroll Aug 30, 2023
b5ae430
Roll Skia from a2728a7ad2a3 to 6f4fd97d2f7e (2 revisions) (#45278)
skia-flutter-autoroll Aug 30, 2023
684046b
Roll Skia from 6f4fd97d2f7e to a58ccf8ae398 (1 revision) (#45280)
skia-flutter-autoroll Aug 30, 2023
e3883ea
Roll Skia from a58ccf8ae398 to 3489b6d1d613 (2 revisions) (#45283)
skia-flutter-autoroll Aug 30, 2023
8762f0c
Roll Skia from 3489b6d1d613 to 7a246c9eb086 (4 revisions) (#45286)
skia-flutter-autoroll Aug 30, 2023
62cf36e
Revert "Roll Dart SDK from 0cea73a8d3c3 to 96d3a79547fc" (#45285)
gaaclarke Aug 30, 2023
7ffca75
Roll Skia from 7a246c9eb086 to 185fbe1a264d (3 revisions) (#45289)
skia-flutter-autoroll Aug 30, 2023
31d5662
Roll Fuchsia Mac SDK from Y2xfuZM0ec5GQfHV8... to gWpPuUyuR_hmz9Xmg..…
skia-flutter-autoroll Aug 30, 2023
b63eee2
[Impeller] Reorganize the glyph atlas to improve efficiency when look…
jason-simmons Aug 30, 2023
aeab1b0
Add an API in `ui_web` to create a `ui.Image` from an `ImageBitmap` (…
eyebrowsoffire Aug 30, 2023
6263387
Increase maximum length of function names from 30 to 60. (#45296)
matanlurey Aug 30, 2023
d37cef8
[web] Roll to most recent fallback font data (#45301)
eyebrowsoffire Aug 30, 2023
3878734
[fuchsia] Restructure Flatland vsync loop
uysalere Sep 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
class-rgx=[A-Z_][a-zA-Z0-9]+$

# Regular expression which should only match correct function names
function-rgx=[a-z_][a-z0-9_]{2,30}$
function-rgx=[a-z_][a-z0-9_]{2,60}$

# Regular expression which should only match correct method names
method-rgx=[a-z_][a-z0-9_]{2,30}$
method-rgx=[a-z_][a-z0-9_]{2,60}$

# Regular expression which should only match correct instance attribute names
attr-rgx=[a-z_][a-z0-9_]{2,30}$
Expand Down
6 changes: 3 additions & 3 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ vars = {
'llvm_git': 'https://llvm.googlesource.com',
# OCMock is for testing only so there is no google clone
'ocmock_git': 'https://github.com/erikdoe/ocmock.git',
'skia_revision': 'e6eb56d9b074100e9e5e660bdb85f51c0a4156ba',
'skia_revision': '185fbe1a264de4a02296e2de87b6d62faf2942a0',

# WARNING: DO NOT EDIT canvaskit_cipd_instance MANUALLY
# See `lib/web_ui/README.md` for how to roll CanvasKit to a new version.
Expand Down Expand Up @@ -886,7 +886,7 @@ deps = {
'packages': [
{
'package': 'fuchsia/sdk/core/mac-amd64',
'version': 'QKekosWnIY_ObKstnfItjOWSgi14RL_O43p2q4KSarUC'
'version': 'gWpPuUyuR_hmz9XmgcrDgQq664PRigdV2BgG77idOv4C'
}
],
'condition': 'host_os == "mac" and not download_fuchsia_sdk',
Expand Down Expand Up @@ -924,7 +924,7 @@ deps = {
'packages': [
{
'package': 'flutter/flutter_font_fallbacks',
'version': 'fb4add6305d783cdb1e722dbb24b135d13faced57905fb814d7964113be2f84a'
'version': 'ba9a3d16939f9576afa67273198d779270cd768ae2867209ff3d72bab9acd3f6'
}
],
'dep_type': 'cipd',
Expand Down
6 changes: 3 additions & 3 deletions ci/licenses_golden/licenses_skia
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Signature: 7ffdb065da3dfdf19d012821904be7f4
Signature: a482454a8599b3c244185a234bf6442c

====================================================================================================
LIBRARY: etc1
Expand Down Expand Up @@ -388,6 +388,7 @@ FILE: ../../../third_party/skia/package-lock.json
FILE: ../../../third_party/skia/relnotes/sksl_always_on.md
FILE: ../../../third_party/skia/relnotes/sksl_comma_array.md
FILE: ../../../third_party/skia/relnotes/sksl_ganesh_dawn_removed.md
FILE: ../../../third_party/skia/relnotes/sktime.md
FILE: ../../../third_party/skia/relnotes/vk_backend_surface.md
FILE: ../../../third_party/skia/src/core/SkOrderedReadBuffer.h
FILE: ../../../third_party/skia/src/gpu/gpu_workaround_list.txt
Expand Down Expand Up @@ -419,6 +420,7 @@ FILE: ../../../third_party/skia/src/sksl/sksl_public.sksl
FILE: ../../../third_party/skia/src/sksl/sksl_rt_shader.sksl
FILE: ../../../third_party/skia/src/sksl/sksl_shared.sksl
FILE: ../../../third_party/skia/src/sksl/sksl_vert.sksl
FILE: ../../../third_party/skia/third_party/go.mod
FILE: ../../../third_party/skia/third_party/libmicrohttpd/MHD_config.h
FILE: ../../../third_party/skia/toolchain/linux_trampolines/IWYU_mapping.imp
FILE: ../../../third_party/skia/toolchain/ndk.BUILD
Expand Down Expand Up @@ -3868,7 +3870,6 @@ ORIGIN: ../../../third_party/skia/src/core/SkColorSpace.cpp + ../../../third_par
ORIGIN: ../../../third_party/skia/src/core/SkColorSpacePriv.h + ../../../third_party/skia/LICENSE
ORIGIN: ../../../third_party/skia/src/core/SkCpu.cpp + ../../../third_party/skia/LICENSE
ORIGIN: ../../../third_party/skia/src/core/SkCpu.h + ../../../third_party/skia/LICENSE
ORIGIN: ../../../third_party/skia/src/core/SkFuzzLogging.h + ../../../third_party/skia/LICENSE
ORIGIN: ../../../third_party/skia/src/core/SkGlobalInitialization_core.cpp + ../../../third_party/skia/LICENSE
ORIGIN: ../../../third_party/skia/src/core/SkImageFilterCache.cpp + ../../../third_party/skia/LICENSE
ORIGIN: ../../../third_party/skia/src/core/SkImageFilterCache.h + ../../../third_party/skia/LICENSE
Expand Down Expand Up @@ -4176,7 +4177,6 @@ FILE: ../../../third_party/skia/src/core/SkColorSpace.cpp
FILE: ../../../third_party/skia/src/core/SkColorSpacePriv.h
FILE: ../../../third_party/skia/src/core/SkCpu.cpp
FILE: ../../../third_party/skia/src/core/SkCpu.h
FILE: ../../../third_party/skia/src/core/SkFuzzLogging.h
FILE: ../../../third_party/skia/src/core/SkGlobalInitialization_core.cpp
FILE: ../../../third_party/skia/src/core/SkImageFilterCache.cpp
FILE: ../../../third_party/skia/src/core/SkImageFilterCache.h
Expand Down
6 changes: 2 additions & 4 deletions impeller/display_list/dl_dispatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1118,12 +1118,10 @@ void DlDispatcher::drawTextBlob(const sk_sp<SkTextBlob>& blob,
const auto text_frame = maybe_text_frame.value();
if (paint_.style == Paint::Style::kStroke ||
paint_.color_source.GetType() != ColorSource::Type::kColor) {
auto path = skia_conversions::PathDataFromTextBlob(blob);
auto bounds = blob->bounds();
canvas_.Save();
canvas_.Translate({x + bounds.left(), y + bounds.top(), 0.0});
auto path = skia_conversions::PathDataFromTextBlob(blob);
path.Shift(Point(x + bounds.left(), y + bounds.top()));
canvas_.DrawPath(path, paint_);
canvas_.Restore();
return;
}

Expand Down
10 changes: 7 additions & 3 deletions impeller/entity/contents/text_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,17 @@ bool TextContents::Render(const ContentContext& renderer,
const Font& font = run.GetFont();
Scalar rounded_scale = TextFrame::RoundScaledFontSize(
scale_, font.GetMetrics().point_size);
const FontGlyphAtlas* font_atlas =
atlas->GetFontGlyphAtlas(font, rounded_scale);
if (!font_atlas) {
VALIDATION_LOG << "Could not find font in the atlas.";
continue;
}

for (const TextRun::GlyphPosition& glyph_position :
run.GetGlyphPositions()) {
FontGlyphPair font_glyph_pair{font, glyph_position.glyph,
rounded_scale};
std::optional<Rect> maybe_atlas_glyph_bounds =
atlas->FindFontGlyphBounds(font_glyph_pair);
font_atlas->FindGlyphBounds(glyph_position.glyph);
if (!maybe_atlas_glyph_bounds.has_value()) {
VALIDATION_LOG << "Could not find glyph position in the atlas.";
continue;
Expand Down
36 changes: 36 additions & 0 deletions impeller/geometry/geometry_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2373,6 +2373,42 @@ TEST(GeometryTest, HalfConversions) {
#endif // FML_OS_WIN
}

TEST(GeometryTest, PathShifting) {
PathBuilder builder{};
auto path =
builder.AddLine(Point(0, 0), Point(10, 10))
.AddQuadraticCurve(Point(10, 10), Point(15, 15), Point(20, 20))
.AddCubicCurve(Point(20, 20), Point(25, 25), Point(-5, -5),
Point(30, 30))
.Close()
.TakePath();
path.Shift(Point(1, 1));

ContourComponent contour;
LinearPathComponent linear;
QuadraticPathComponent quad;
CubicPathComponent cubic;

ASSERT_TRUE(path.GetContourComponentAtIndex(0, contour));
ASSERT_TRUE(path.GetLinearComponentAtIndex(1, linear));
ASSERT_TRUE(path.GetQuadraticComponentAtIndex(3, quad));
ASSERT_TRUE(path.GetCubicComponentAtIndex(5, cubic));

ASSERT_EQ(contour.destination, Point(1, 1));

ASSERT_EQ(linear.p1, Point(1, 1));
ASSERT_EQ(linear.p2, Point(11, 11));

ASSERT_EQ(quad.cp, Point(16, 16));
ASSERT_EQ(quad.p1, Point(11, 11));
ASSERT_EQ(quad.p2, Point(21, 21));

ASSERT_EQ(cubic.cp1, Point(26, 26));
ASSERT_EQ(cubic.cp2, Point(-4, -4));
ASSERT_EQ(cubic.p1, Point(21, 21));
ASSERT_EQ(cubic.p2, Point(31, 31));
}

} // namespace testing
} // namespace impeller

Expand Down
27 changes: 27 additions & 0 deletions impeller/geometry/path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,33 @@ void Path::SetConvexity(Convexity value) {
convexity_ = value;
}

void Path::Shift(Point shift) {
size_t currentIndex = 0;
for (const auto& component : components_) {
switch (component.type) {
case ComponentType::kLinear:
linears_[component.index].p1 += shift;
linears_[component.index].p2 += shift;
break;
case ComponentType::kQuadratic:
quads_[component.index].cp += shift;
quads_[component.index].p1 += shift;
quads_[component.index].p2 += shift;
break;
case ComponentType::kCubic:
cubics_[component.index].cp1 += shift;
cubics_[component.index].cp2 += shift;
cubics_[component.index].p1 += shift;
cubics_[component.index].p2 += shift;
break;
case ComponentType::kContour:
contours_[component.index].destination += shift;
break;
}
currentIndex++;
}
}

Path& Path::AddLinearComponent(Point p1, Point p2) {
linears_.emplace_back(p1, p2);
components_.emplace_back(ComponentType::kLinear, linears_.size() - 1);
Expand Down
3 changes: 3 additions & 0 deletions impeller/geometry/path.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ class Path {

void SetContourClosed(bool is_closed);

/// @brief Transform the path by the given offset in-place.
void Shift(Point shift);

template <class T>
using Applier = std::function<void(size_t index, const T& component)>;
void EnumerateComponents(
Expand Down
Loading