Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 0 additions & 4 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -1185,8 +1185,6 @@ ORIGIN: ../../../flutter/impeller/entity/contents/clip_contents.cc + ../../../fl
ORIGIN: ../../../flutter/impeller/entity/contents/clip_contents.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/contents/color_source_contents.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/contents/color_source_contents.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/contents/color_source_text_contents.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/contents/color_source_text_contents.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/contents/conical_gradient_contents.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/contents/conical_gradient_contents.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/entity/contents/content_context.cc + ../../../flutter/LICENSE
Expand Down Expand Up @@ -3932,8 +3930,6 @@ FILE: ../../../flutter/impeller/entity/contents/clip_contents.cc
FILE: ../../../flutter/impeller/entity/contents/clip_contents.h
FILE: ../../../flutter/impeller/entity/contents/color_source_contents.cc
FILE: ../../../flutter/impeller/entity/contents/color_source_contents.h
FILE: ../../../flutter/impeller/entity/contents/color_source_text_contents.cc
FILE: ../../../flutter/impeller/entity/contents/color_source_text_contents.h
FILE: ../../../flutter/impeller/entity/contents/conical_gradient_contents.cc
FILE: ../../../flutter/impeller/entity/contents/conical_gradient_contents.h
FILE: ../../../flutter/impeller/entity/contents/content_context.cc
Expand Down
3 changes: 3 additions & 0 deletions impeller/aiks/aiks_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3031,6 +3031,9 @@ TEST_P(AiksTest, CanDrawPointsWithTextureMap) {
ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
}

// This currently renders solid blue, as the support for text color sources was
// moved into DLDispatching. Path data requires the SkTextBlobs which are not
// used in impeller::TextFrames.
TEST_P(AiksTest, TextForegroundShaderWithTransform) {
auto mapping = OpenFixtureAsSkData("Roboto-Regular.ttf");
ASSERT_NE(mapping, nullptr);
Expand Down
32 changes: 0 additions & 32 deletions impeller/aiks/canvas.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "impeller/aiks/paint_pass_delegate.h"
#include "impeller/entity/contents/atlas_contents.h"
#include "impeller/entity/contents/clip_contents.h"
#include "impeller/entity/contents/color_source_text_contents.h"
#include "impeller/entity/contents/solid_rrect_blur_contents.h"
#include "impeller/entity/contents/text_contents.h"
#include "impeller/entity/contents/texture_contents.h"
Expand Down Expand Up @@ -543,37 +542,6 @@ void Canvas::DrawTextFrame(const TextFrame& text_frame,

auto text_contents = std::make_shared<TextContents>();
text_contents->SetTextFrame(TextFrame(text_frame));

if (paint.color_source.GetType() != ColorSource::Type::kColor) {
auto color_text_contents = std::make_shared<ColorSourceTextContents>();
entity.SetTransformation(GetCurrentTransformation());

Entity test;
auto maybe_cvg = text_contents->GetCoverage(test);
FML_CHECK(maybe_cvg.has_value());
// Covered by FML_CHECK.
// NOLINTNEXTLINE(bugprone-unchecked-optional-access)
auto cvg = maybe_cvg.value();
color_text_contents->SetTextPosition(cvg.origin + position);

text_contents->SetOffset(-cvg.origin);
color_text_contents->SetTextContents(std::move(text_contents));
color_text_contents->SetColorSourceContents(
paint.color_source.GetContents(paint));

// TODO(bdero): This mask blur application is a hack. It will always wind up
// doing a gaussian blur that affects the color source itself
// instead of just the mask. The color filter text support
// needs to be reworked in order to interact correctly with
// mask filters.
// https://github.com/flutter/flutter/issues/133297
entity.SetContents(paint.WithFilters(
paint.WithMaskBlur(std::move(color_text_contents), true)));

GetCurrentPass().AddEntity(entity);
return;
}

text_contents->SetColor(paint.color);

entity.SetTransformation(GetCurrentTransformation() *
Expand Down
5 changes: 3 additions & 2 deletions impeller/display_list/dl_dispatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,9 @@ void DlDispatcher::drawDisplayList(
void DlDispatcher::drawTextBlob(const sk_sp<SkTextBlob>& blob,
SkScalar x,
SkScalar y) {
if (paint_.style == Paint::Style::kStroke) {
const auto text_frame = MakeTextFrameFromTextBlobSkia(blob);
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();
Expand All @@ -1121,7 +1123,6 @@ void DlDispatcher::drawTextBlob(const sk_sp<SkTextBlob>& blob,
return;
}

const auto text_frame = MakeTextFrameFromTextBlobSkia(blob);
canvas_.DrawTextFrame(text_frame, //
impeller::Point{x, y}, //
paint_ //
Expand Down
2 changes: 0 additions & 2 deletions impeller/entity/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ impeller_component("entity") {
"contents/clip_contents.h",
"contents/color_source_contents.cc",
"contents/color_source_contents.h",
"contents/color_source_text_contents.cc",
"contents/color_source_text_contents.h",
"contents/conical_gradient_contents.cc",
"contents/conical_gradient_contents.h",
"contents/content_context.cc",
Expand Down
88 changes: 0 additions & 88 deletions impeller/entity/contents/color_source_text_contents.cc

This file was deleted.

53 changes: 0 additions & 53 deletions impeller/entity/contents/color_source_text_contents.h

This file was deleted.