[Impeller] Make //impeller/display_list TU naming consistent. (flutter/engine#41174)

No change in functionality. I've just renamed the TU's to replace `display_list_` to `dl_`. I am sure there are chances to make the naming better. For instance, the op receiver still being named a dispatcher.
This commit is contained in:
Chinmay Garde
2023-04-19 10:32:53 -07:00
committed by GitHub
parent 2bc352f431
commit 4117cb927e
19 changed files with 190 additions and 195 deletions

View File

@@ -127,7 +127,7 @@
../../../flutter/impeller/compiler/README.md
../../../flutter/impeller/compiler/compiler_unittests.cc
../../../flutter/impeller/compiler/switches_unittests.cc
../../../flutter/impeller/display_list/display_list_unittests.cc
../../../flutter/impeller/display_list/dl_unittests.cc
../../../flutter/impeller/docs
../../../flutter/impeller/entity/contents/filters/inputs/filter_input_unittests.cc
../../../flutter/impeller/entity/entity_unittests.cc

View File

@@ -1144,14 +1144,14 @@ ORIGIN: ../../../flutter/impeller/core/texture_descriptor.cc + ../../../flutter/
ORIGIN: ../../../flutter/impeller/core/texture_descriptor.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/core/vertex_buffer.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/core/vertex_buffer.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/display_list/display_list_dispatcher.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/display_list/display_list_dispatcher.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/display_list/display_list_image_impeller.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/display_list/display_list_image_impeller.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/display_list/display_list_playground.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/display_list/display_list_playground.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/display_list/display_list_vertices_geometry.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/display_list/display_list_vertices_geometry.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/display_list/dl_dispatcher.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/display_list/dl_dispatcher.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/display_list/dl_image_impeller.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/display_list/dl_image_impeller.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/display_list/dl_playground.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/display_list/dl_playground.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/display_list/dl_vertices_geometry.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/display_list/dl_vertices_geometry.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/display_list/nine_patch_converter.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/display_list/nine_patch_converter.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/display_list/skia_conversions.cc + ../../../flutter/LICENSE
@@ -3739,14 +3739,14 @@ FILE: ../../../flutter/impeller/core/texture_descriptor.cc
FILE: ../../../flutter/impeller/core/texture_descriptor.h
FILE: ../../../flutter/impeller/core/vertex_buffer.cc
FILE: ../../../flutter/impeller/core/vertex_buffer.h
FILE: ../../../flutter/impeller/display_list/display_list_dispatcher.cc
FILE: ../../../flutter/impeller/display_list/display_list_dispatcher.h
FILE: ../../../flutter/impeller/display_list/display_list_image_impeller.cc
FILE: ../../../flutter/impeller/display_list/display_list_image_impeller.h
FILE: ../../../flutter/impeller/display_list/display_list_playground.cc
FILE: ../../../flutter/impeller/display_list/display_list_playground.h
FILE: ../../../flutter/impeller/display_list/display_list_vertices_geometry.cc
FILE: ../../../flutter/impeller/display_list/display_list_vertices_geometry.h
FILE: ../../../flutter/impeller/display_list/dl_dispatcher.cc
FILE: ../../../flutter/impeller/display_list/dl_dispatcher.h
FILE: ../../../flutter/impeller/display_list/dl_image_impeller.cc
FILE: ../../../flutter/impeller/display_list/dl_image_impeller.h
FILE: ../../../flutter/impeller/display_list/dl_playground.cc
FILE: ../../../flutter/impeller/display_list/dl_playground.h
FILE: ../../../flutter/impeller/display_list/dl_vertices_geometry.cc
FILE: ../../../flutter/impeller/display_list/dl_vertices_geometry.h
FILE: ../../../flutter/impeller/display_list/nine_patch_converter.cc
FILE: ../../../flutter/impeller/display_list/nine_patch_converter.h
FILE: ../../../flutter/impeller/display_list/skia_conversions.cc

View File

@@ -20,12 +20,12 @@ impeller_component("skia_conversions") {
impeller_component("display_list") {
sources = [
"display_list_dispatcher.cc",
"display_list_dispatcher.h",
"display_list_image_impeller.cc",
"display_list_image_impeller.h",
"display_list_vertices_geometry.cc",
"display_list_vertices_geometry.h",
"dl_dispatcher.cc",
"dl_dispatcher.h",
"dl_image_impeller.cc",
"dl_image_impeller.h",
"dl_vertices_geometry.cc",
"dl_vertices_geometry.h",
"nine_patch_converter.cc",
"nine_patch_converter.h",
]
@@ -50,9 +50,9 @@ impeller_component("display_list_unittests") {
testonly = true
sources = [
"display_list_playground.cc",
"display_list_playground.h",
"display_list_unittests.cc",
"dl_playground.cc",
"dl_playground.h",
"dl_unittests.cc",
]
deps = [

View File

@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "impeller/display_list/display_list_dispatcher.h"
#include "impeller/display_list/dl_dispatcher.h"
#include <algorithm>
#include <cstring>
@@ -15,8 +15,8 @@
#include "flutter/fml/logging.h"
#include "flutter/fml/trace_event.h"
#include "impeller/core/formats.h"
#include "impeller/display_list/display_list_image_impeller.h"
#include "impeller/display_list/display_list_vertices_geometry.h"
#include "impeller/display_list/dl_image_impeller.h"
#include "impeller/display_list/dl_vertices_geometry.h"
#include "impeller/display_list/nine_patch_converter.h"
#include "impeller/display_list/skia_conversions.h"
#include "impeller/entity/contents/conical_gradient_contents.h"
@@ -41,9 +41,9 @@ namespace impeller {
#define UNIMPLEMENTED \
FML_DLOG(ERROR) << "Unimplemented detail in " << __FUNCTION__;
DisplayListDispatcher::DisplayListDispatcher() = default;
DlDispatcher::DlDispatcher() = default;
DisplayListDispatcher::~DisplayListDispatcher() = default;
DlDispatcher::~DlDispatcher() = default;
static BlendMode ToBlendMode(flutter::DlBlendMode mode) {
switch (mode) {
@@ -176,12 +176,12 @@ static Matrix ToMatrix(const SkMatrix& m) {
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::setAntiAlias(bool aa) {
void DlDispatcher::setAntiAlias(bool aa) {
// Nothing to do because AA is implicit.
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::setDither(bool dither) {}
void DlDispatcher::setDither(bool dither) {}
static Paint::Style ToStyle(flutter::DlDrawStyle style) {
switch (style) {
@@ -197,12 +197,12 @@ static Paint::Style ToStyle(flutter::DlDrawStyle style) {
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::setStyle(flutter::DlDrawStyle style) {
void DlDispatcher::setStyle(flutter::DlDrawStyle style) {
paint_.style = ToStyle(style);
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::setColor(flutter::DlColor color) {
void DlDispatcher::setColor(flutter::DlColor color) {
paint_.color = {
color.getRedF(),
color.getGreenF(),
@@ -212,17 +212,17 @@ void DisplayListDispatcher::setColor(flutter::DlColor color) {
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::setStrokeWidth(SkScalar width) {
void DlDispatcher::setStrokeWidth(SkScalar width) {
paint_.stroke_width = width;
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::setStrokeMiter(SkScalar limit) {
void DlDispatcher::setStrokeMiter(SkScalar limit) {
paint_.stroke_miter = limit;
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::setStrokeCap(flutter::DlStrokeCap cap) {
void DlDispatcher::setStrokeCap(flutter::DlStrokeCap cap) {
switch (cap) {
case flutter::DlStrokeCap::kButt:
paint_.stroke_cap = Cap::kButt;
@@ -237,7 +237,7 @@ void DisplayListDispatcher::setStrokeCap(flutter::DlStrokeCap cap) {
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::setStrokeJoin(flutter::DlStrokeJoin join) {
void DlDispatcher::setStrokeJoin(flutter::DlStrokeJoin join) {
switch (join) {
case flutter::DlStrokeJoin::kMiter:
paint_.stroke_join = Join::kMiter;
@@ -311,8 +311,7 @@ static std::optional<ColorSource::Type> ToColorSourceType(
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::setColorSource(
const flutter::DlColorSource* source) {
void DlDispatcher::setColorSource(const flutter::DlColorSource* source) {
if (!source) {
paint_.color_source = ColorSource::MakeColor();
return;
@@ -508,24 +507,23 @@ static std::optional<Paint::ColorFilterProc> ToColorFilterProc(
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::setColorFilter(
const flutter::DlColorFilter* filter) {
void DlDispatcher::setColorFilter(const flutter::DlColorFilter* filter) {
// Needs https://github.com/flutter/flutter/issues/95434
paint_.color_filter = ToColorFilterProc(filter);
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::setInvertColors(bool invert) {
void DlDispatcher::setInvertColors(bool invert) {
paint_.invert_colors = invert;
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::setBlendMode(flutter::DlBlendMode dl_mode) {
void DlDispatcher::setBlendMode(flutter::DlBlendMode dl_mode) {
paint_.blend_mode = ToBlendMode(dl_mode);
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::setPathEffect(const flutter::DlPathEffect* effect) {
void DlDispatcher::setPathEffect(const flutter::DlPathEffect* effect) {
// Needs https://github.com/flutter/flutter/issues/95434
UNIMPLEMENTED;
}
@@ -544,7 +542,7 @@ static FilterContents::BlurStyle ToBlurStyle(flutter::DlBlurStyle blur_style) {
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::setMaskFilter(const flutter::DlMaskFilter* filter) {
void DlDispatcher::setMaskFilter(const flutter::DlMaskFilter* filter) {
// Needs https://github.com/flutter/flutter/issues/95434
if (filter == nullptr) {
paint_.mask_blur_descriptor = std::nullopt;
@@ -698,57 +696,56 @@ static std::optional<Paint::ImageFilterProc> ToImageFilterProc(
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::setImageFilter(
const flutter::DlImageFilter* filter) {
void DlDispatcher::setImageFilter(const flutter::DlImageFilter* filter) {
paint_.image_filter = ToImageFilterProc(filter);
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::save() {
void DlDispatcher::save() {
canvas_.Save();
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::saveLayer(const SkRect* bounds,
const flutter::SaveLayerOptions options,
const flutter::DlImageFilter* backdrop) {
void DlDispatcher::saveLayer(const SkRect* bounds,
const flutter::SaveLayerOptions options,
const flutter::DlImageFilter* backdrop) {
auto paint = options.renders_with_attributes() ? paint_ : Paint{};
canvas_.SaveLayer(paint, skia_conversions::ToRect(bounds),
ToImageFilterProc(backdrop));
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::restore() {
void DlDispatcher::restore() {
canvas_.Restore();
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::translate(SkScalar tx, SkScalar ty) {
void DlDispatcher::translate(SkScalar tx, SkScalar ty) {
canvas_.Translate({tx, ty, 0.0});
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::scale(SkScalar sx, SkScalar sy) {
void DlDispatcher::scale(SkScalar sx, SkScalar sy) {
canvas_.Scale({sx, sy, 1.0});
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::rotate(SkScalar degrees) {
void DlDispatcher::rotate(SkScalar degrees) {
canvas_.Rotate(Degrees{degrees});
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::skew(SkScalar sx, SkScalar sy) {
void DlDispatcher::skew(SkScalar sx, SkScalar sy) {
canvas_.Skew(sx, sy);
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::transform2DAffine(SkScalar mxx,
SkScalar mxy,
SkScalar mxt,
SkScalar myx,
SkScalar myy,
SkScalar myt) {
void DlDispatcher::transform2DAffine(SkScalar mxx,
SkScalar mxy,
SkScalar mxt,
SkScalar myx,
SkScalar myy,
SkScalar myt) {
// clang-format off
transformFullPerspective(
mxx, mxy, 0, mxt,
@@ -760,22 +757,22 @@ void DisplayListDispatcher::transform2DAffine(SkScalar mxx,
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::transformFullPerspective(SkScalar mxx,
SkScalar mxy,
SkScalar mxz,
SkScalar mxt,
SkScalar myx,
SkScalar myy,
SkScalar myz,
SkScalar myt,
SkScalar mzx,
SkScalar mzy,
SkScalar mzz,
SkScalar mzt,
SkScalar mwx,
SkScalar mwy,
SkScalar mwz,
SkScalar mwt) {
void DlDispatcher::transformFullPerspective(SkScalar mxx,
SkScalar mxy,
SkScalar mxz,
SkScalar mxt,
SkScalar myx,
SkScalar myy,
SkScalar myz,
SkScalar myt,
SkScalar mzx,
SkScalar mzy,
SkScalar mzz,
SkScalar mzt,
SkScalar mwx,
SkScalar mwy,
SkScalar mwz,
SkScalar mwt) {
// The order of arguments is row-major but Impeller matrices are
// column-major.
// clang-format off
@@ -790,7 +787,7 @@ void DisplayListDispatcher::transformFullPerspective(SkScalar mxx,
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::transformReset() {
void DlDispatcher::transformReset() {
canvas_.ResetTransform();
canvas_.Transform(initial_matrix_);
}
@@ -806,16 +803,12 @@ static Entity::ClipOperation ToClipOperation(
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::clipRect(const SkRect& rect,
ClipOp clip_op,
bool is_aa) {
void DlDispatcher::clipRect(const SkRect& rect, ClipOp clip_op, bool is_aa) {
canvas_.ClipRect(skia_conversions::ToRect(rect), ToClipOperation(clip_op));
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::clipRRect(const SkRRect& rrect,
ClipOp clip_op,
bool is_aa) {
void DlDispatcher::clipRRect(const SkRRect& rrect, ClipOp clip_op, bool is_aa) {
if (rrect.isSimple()) {
canvas_.ClipRRect(skia_conversions::ToRect(rrect.rect()),
rrect.getSimpleRadii().fX, ToClipOperation(clip_op));
@@ -825,15 +818,13 @@ void DisplayListDispatcher::clipRRect(const SkRRect& rrect,
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::clipPath(const SkPath& path,
ClipOp clip_op,
bool is_aa) {
void DlDispatcher::clipPath(const SkPath& path, ClipOp clip_op, bool is_aa) {
canvas_.ClipPath(skia_conversions::ToPath(path), ToClipOperation(clip_op));
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::drawColor(flutter::DlColor color,
flutter::DlBlendMode dl_mode) {
void DlDispatcher::drawColor(flutter::DlColor color,
flutter::DlBlendMode dl_mode) {
Paint paint;
paint.color = skia_conversions::ToColor(color);
paint.blend_mode = ToBlendMode(dl_mode);
@@ -841,12 +832,12 @@ void DisplayListDispatcher::drawColor(flutter::DlColor color,
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::drawPaint() {
void DlDispatcher::drawPaint() {
canvas_.DrawPaint(paint_);
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::drawLine(const SkPoint& p0, const SkPoint& p1) {
void DlDispatcher::drawLine(const SkPoint& p0, const SkPoint& p1) {
auto path =
PathBuilder{}
.AddLine(skia_conversions::ToPoint(p0), skia_conversions::ToPoint(p1))
@@ -857,12 +848,12 @@ void DisplayListDispatcher::drawLine(const SkPoint& p0, const SkPoint& p1) {
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::drawRect(const SkRect& rect) {
void DlDispatcher::drawRect(const SkRect& rect) {
canvas_.DrawRect(skia_conversions::ToRect(rect), paint_);
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::drawOval(const SkRect& bounds) {
void DlDispatcher::drawOval(const SkRect& bounds) {
if (bounds.width() == bounds.height()) {
canvas_.DrawCircle(skia_conversions::ToPoint(bounds.center()),
bounds.width() * 0.5, paint_);
@@ -874,12 +865,12 @@ void DisplayListDispatcher::drawOval(const SkRect& bounds) {
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::drawCircle(const SkPoint& center, SkScalar radius) {
void DlDispatcher::drawCircle(const SkPoint& center, SkScalar radius) {
canvas_.DrawCircle(skia_conversions::ToPoint(center), radius, paint_);
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::drawRRect(const SkRRect& rrect) {
void DlDispatcher::drawRRect(const SkRRect& rrect) {
if (rrect.isSimple()) {
canvas_.DrawRRect(skia_conversions::ToRect(rrect.rect()),
rrect.getSimpleRadii().fX, paint_);
@@ -889,8 +880,7 @@ void DisplayListDispatcher::drawRRect(const SkRRect& rrect) {
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::drawDRRect(const SkRRect& outer,
const SkRRect& inner) {
void DlDispatcher::drawDRRect(const SkRRect& outer, const SkRRect& inner) {
PathBuilder builder;
builder.AddPath(skia_conversions::ToPath(outer));
builder.AddPath(skia_conversions::ToPath(inner));
@@ -898,15 +888,15 @@ void DisplayListDispatcher::drawDRRect(const SkRRect& outer,
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::drawPath(const SkPath& path) {
void DlDispatcher::drawPath(const SkPath& path) {
canvas_.DrawPath(skia_conversions::ToPath(path), paint_);
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::drawArc(const SkRect& oval_bounds,
SkScalar start_degrees,
SkScalar sweep_degrees,
bool use_center) {
void DlDispatcher::drawArc(const SkRect& oval_bounds,
SkScalar start_degrees,
SkScalar sweep_degrees,
bool use_center) {
PathBuilder builder;
builder.AddArc(skia_conversions::ToRect(oval_bounds), Degrees(start_degrees),
Degrees(sweep_degrees), use_center);
@@ -914,9 +904,9 @@ void DisplayListDispatcher::drawArc(const SkRect& oval_bounds,
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::drawPoints(PointMode mode,
uint32_t count,
const SkPoint points[]) {
void DlDispatcher::drawPoints(PointMode mode,
uint32_t count,
const SkPoint points[]) {
Paint paint = paint_;
paint.style = Paint::Style::kStroke;
switch (mode) {
@@ -953,17 +943,17 @@ void DisplayListDispatcher::drawPoints(PointMode mode,
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::drawVertices(const flutter::DlVertices* vertices,
flutter::DlBlendMode dl_mode) {
canvas_.DrawVertices(DLVerticesGeometry::MakeVertices(vertices),
void DlDispatcher::drawVertices(const flutter::DlVertices* vertices,
flutter::DlBlendMode dl_mode) {
canvas_.DrawVertices(DlVerticesGeometry::MakeVertices(vertices),
ToBlendMode(dl_mode), paint_);
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::drawImage(const sk_sp<flutter::DlImage> image,
const SkPoint point,
flutter::DlImageSampling sampling,
bool render_with_attributes) {
void DlDispatcher::drawImage(const sk_sp<flutter::DlImage> image,
const SkPoint point,
flutter::DlImageSampling sampling,
bool render_with_attributes) {
if (!image) {
return;
}
@@ -988,7 +978,7 @@ void DisplayListDispatcher::drawImage(const sk_sp<flutter::DlImage> image,
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::drawImageRect(
void DlDispatcher::drawImageRect(
const sk_sp<flutter::DlImage> image,
const SkRect& src,
const SkRect& dst,
@@ -1005,11 +995,11 @@ void DisplayListDispatcher::drawImageRect(
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::drawImageNine(const sk_sp<flutter::DlImage> image,
const SkIRect& center,
const SkRect& dst,
flutter::DlFilterMode filter,
bool render_with_attributes) {
void DlDispatcher::drawImageNine(const sk_sp<flutter::DlImage> image,
const SkIRect& center,
const SkRect& dst,
flutter::DlFilterMode filter,
bool render_with_attributes) {
NinePatchConverter converter = {};
converter.DrawNinePatch(
std::make_shared<Image>(image->impeller_texture()),
@@ -1019,15 +1009,15 @@ void DisplayListDispatcher::drawImageNine(const sk_sp<flutter::DlImage> image,
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::drawAtlas(const sk_sp<flutter::DlImage> atlas,
const SkRSXform xform[],
const SkRect tex[],
const flutter::DlColor colors[],
int count,
flutter::DlBlendMode mode,
flutter::DlImageSampling sampling,
const SkRect* cull_rect,
bool render_with_attributes) {
void DlDispatcher::drawAtlas(const sk_sp<flutter::DlImage> atlas,
const SkRSXform xform[],
const SkRect tex[],
const flutter::DlColor colors[],
int count,
flutter::DlBlendMode mode,
flutter::DlImageSampling sampling,
const SkRect* cull_rect,
bool render_with_attributes) {
canvas_.DrawAtlas(std::make_shared<Image>(atlas->impeller_texture()),
skia_conversions::ToRSXForms(xform, count),
skia_conversions::ToRects(tex, count),
@@ -1037,7 +1027,7 @@ void DisplayListDispatcher::drawAtlas(const sk_sp<flutter::DlImage> atlas,
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::drawDisplayList(
void DlDispatcher::drawDisplayList(
const sk_sp<flutter::DisplayList> display_list,
SkScalar opacity) {
// Save all values that must remain untouched after the operation.
@@ -1073,9 +1063,9 @@ void DisplayListDispatcher::drawDisplayList(
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::drawTextBlob(const sk_sp<SkTextBlob> blob,
SkScalar x,
SkScalar y) {
void DlDispatcher::drawTextBlob(const sk_sp<SkTextBlob> blob,
SkScalar x,
SkScalar y) {
Scalar scale = canvas_.GetCurrentTransformation().GetMaxBasisLength();
canvas_.DrawTextFrame(TextFrameFromTextBlob(blob, scale), //
impeller::Point{x, y}, //
@@ -1084,11 +1074,11 @@ void DisplayListDispatcher::drawTextBlob(const sk_sp<SkTextBlob> blob,
}
// |flutter::DlOpReceiver|
void DisplayListDispatcher::drawShadow(const SkPath& path,
const flutter::DlColor color,
const SkScalar elevation,
bool transparent_occluder,
SkScalar dpr) {
void DlDispatcher::drawShadow(const SkPath& path,
const flutter::DlColor color,
const SkScalar elevation,
bool transparent_occluder,
SkScalar dpr) {
Color spot_color = skia_conversions::ToColor(color);
spot_color.alpha *= 0.25;
@@ -1155,7 +1145,7 @@ void DisplayListDispatcher::drawShadow(const SkPath& path,
canvas_.Restore();
}
Picture DisplayListDispatcher::EndRecordingAsPicture() {
Picture DlDispatcher::EndRecordingAsPicture() {
TRACE_EVENT0("impeller", "DisplayListDispatcher::EndRecordingAsPicture");
return canvas_.EndRecordingAsPicture();
}

View File

@@ -11,11 +11,11 @@
namespace impeller {
class DisplayListDispatcher final : public flutter::DlOpReceiver {
class DlDispatcher final : public flutter::DlOpReceiver {
public:
DisplayListDispatcher();
DlDispatcher();
~DisplayListDispatcher();
~DlDispatcher();
Picture EndRecordingAsPicture();
@@ -220,7 +220,7 @@ class DisplayListDispatcher final : public flutter::DlOpReceiver {
Canvas canvas_;
Matrix initial_matrix_;
FML_DISALLOW_COPY_AND_ASSIGN(DisplayListDispatcher);
FML_DISALLOW_COPY_AND_ASSIGN(DlDispatcher);
};
} // namespace impeller

View File

@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "impeller/display_list/display_list_image_impeller.h"
#include "impeller/display_list/dl_image_impeller.h"
#include "impeller/aiks/aiks_context.h"
#include "impeller/entity/contents/filters/filter_contents.h"

View File

@@ -2,33 +2,29 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "impeller/display_list/display_list_playground.h"
#include "impeller/display_list/dl_playground.h"
#include "flutter/testing/testing.h"
#include "impeller/aiks/aiks_context.h"
#include "impeller/display_list/display_list_dispatcher.h"
#include "impeller/display_list/dl_dispatcher.h"
#include "third_party/imgui/imgui.h"
#include "third_party/skia/include/core/SkData.h"
namespace impeller {
DisplayListPlayground::DisplayListPlayground() = default;
DlPlayground::DlPlayground() = default;
DisplayListPlayground::~DisplayListPlayground() = default;
DlPlayground::~DlPlayground() = default;
bool DisplayListPlayground::OpenPlaygroundHere(
flutter::DisplayListBuilder& builder) {
bool DlPlayground::OpenPlaygroundHere(flutter::DisplayListBuilder& builder) {
return OpenPlaygroundHere(builder.Build());
}
bool DisplayListPlayground::OpenPlaygroundHere(
sk_sp<flutter::DisplayList> list) {
bool DlPlayground::OpenPlaygroundHere(sk_sp<flutter::DisplayList> list) {
return OpenPlaygroundHere([&list]() { return list; });
}
bool DisplayListPlayground::OpenPlaygroundHere(
DisplayListPlaygroundCallback callback) {
bool DlPlayground::OpenPlaygroundHere(DisplayListPlaygroundCallback callback) {
if (!switches_.enable_playground) {
return true;
}
@@ -47,7 +43,7 @@ bool DisplayListPlayground::OpenPlaygroundHere(
auto list = callback();
DisplayListDispatcher dispatcher;
DlDispatcher dispatcher;
list->Dispatch(dispatcher);
auto picture = dispatcher.EndRecordingAsPicture();
@@ -70,14 +66,14 @@ static sk_sp<SkData> OpenFixtureAsSkData(const char* fixture_name) {
return data;
}
SkFont DisplayListPlayground::CreateTestFontOfSize(SkScalar scalar) {
SkFont DlPlayground::CreateTestFontOfSize(SkScalar scalar) {
static constexpr const char* kTestFontFixture = "Roboto-Regular.ttf";
auto mapping = OpenFixtureAsSkData(kTestFontFixture);
FML_CHECK(mapping);
return SkFont{SkTypeface::MakeFromData(mapping), scalar};
}
SkFont DisplayListPlayground::CreateTestFont() {
SkFont DlPlayground::CreateTestFont() {
return CreateTestFontOfSize(50);
}

View File

@@ -12,14 +12,14 @@
namespace impeller {
class DisplayListPlayground : public PlaygroundTest {
class DlPlayground : public PlaygroundTest {
public:
using DisplayListPlaygroundCallback =
std::function<sk_sp<flutter::DisplayList>()>;
DisplayListPlayground();
DlPlayground();
~DisplayListPlayground();
~DlPlayground();
bool OpenPlaygroundHere(flutter::DisplayListBuilder& builder);
@@ -32,7 +32,7 @@ class DisplayListPlayground : public PlaygroundTest {
SkFont CreateTestFont();
private:
FML_DISALLOW_COPY_AND_ASSIGN(DisplayListPlayground);
FML_DISALLOW_COPY_AND_ASSIGN(DlPlayground);
};
} // namespace impeller

View File

@@ -17,8 +17,8 @@
#include "flutter/display_list/effects/dl_image_filter.h"
#include "flutter/display_list/effects/dl_mask_filter.h"
#include "flutter/testing/testing.h"
#include "impeller/display_list/display_list_image_impeller.h"
#include "impeller/display_list/display_list_playground.h"
#include "impeller/display_list/dl_image_impeller.h"
#include "impeller/display_list/dl_playground.h"
#include "impeller/geometry/constants.h"
#include "impeller/geometry/point.h"
#include "impeller/playground/widgets.h"
@@ -38,7 +38,7 @@ flutter::DlColor toColor(const float* components) {
Color(components[0], components[1], components[2], components[3])));
}
using DisplayListTest = DisplayListPlayground;
using DisplayListTest = DlPlayground;
INSTANTIATE_PLAYGROUND_SUITE(DisplayListTest);
TEST_P(DisplayListTest, CanDrawRect) {

View File

@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "impeller/display_list/display_list_vertices_geometry.h"
#include "impeller/display_list/dl_vertices_geometry.h"
#include "impeller/core/device_buffer.h"
#include "impeller/entity/contents/content_context.h"
@@ -59,19 +59,19 @@ static std::vector<uint16_t> fromFanIndices(
/////// Vertices Geometry ///////
// static
std::shared_ptr<VerticesGeometry> DLVerticesGeometry::MakeVertices(
std::shared_ptr<VerticesGeometry> DlVerticesGeometry::MakeVertices(
const flutter::DlVertices* vertices) {
return std::make_shared<DLVerticesGeometry>(vertices);
return std::make_shared<DlVerticesGeometry>(vertices);
}
DLVerticesGeometry::DLVerticesGeometry(const flutter::DlVertices* vertices)
DlVerticesGeometry::DlVerticesGeometry(const flutter::DlVertices* vertices)
: vertices_(vertices) {
NormalizeIndices();
}
DLVerticesGeometry::~DLVerticesGeometry() = default;
DlVerticesGeometry::~DlVerticesGeometry() = default;
void DLVerticesGeometry::NormalizeIndices() {
void DlVerticesGeometry::NormalizeIndices() {
// Convert triangle fan if present.
if (vertices_->mode() == flutter::DlVertexMode::kTriangleFan) {
normalized_indices_ = fromFanIndices(vertices_);
@@ -101,7 +101,7 @@ static PrimitiveType GetPrimitiveType(const flutter::DlVertices* vertices) {
}
}
std::optional<Rect> DLVerticesGeometry::GetTextureCoordinateCoverge() const {
std::optional<Rect> DlVerticesGeometry::GetTextureCoordinateCoverge() const {
if (!HasTextureCoordinates()) {
return std::nullopt;
}
@@ -125,15 +125,15 @@ std::optional<Rect> DLVerticesGeometry::GetTextureCoordinateCoverge() const {
return Rect::MakeLTRB(left, top, right, bottom);
}
bool DLVerticesGeometry::HasVertexColors() const {
bool DlVerticesGeometry::HasVertexColors() const {
return vertices_->colors() != nullptr;
}
bool DLVerticesGeometry::HasTextureCoordinates() const {
bool DlVerticesGeometry::HasTextureCoordinates() const {
return vertices_->texture_coordinates() != nullptr;
}
GeometryResult DLVerticesGeometry::GetPositionBuffer(
GeometryResult DlVerticesGeometry::GetPositionBuffer(
const ContentContext& renderer,
const Entity& entity,
RenderPass& pass) {
@@ -184,7 +184,7 @@ GeometryResult DLVerticesGeometry::GetPositionBuffer(
};
}
GeometryResult DLVerticesGeometry::GetPositionColorBuffer(
GeometryResult DlVerticesGeometry::GetPositionColorBuffer(
const ContentContext& renderer,
const Entity& entity,
RenderPass& pass) {
@@ -253,7 +253,7 @@ GeometryResult DLVerticesGeometry::GetPositionColorBuffer(
};
}
GeometryResult DLVerticesGeometry::GetPositionUVBuffer(
GeometryResult DlVerticesGeometry::GetPositionUVBuffer(
Rect texture_coverage,
Matrix effect_transform,
const ContentContext& renderer,
@@ -330,7 +330,7 @@ GeometryResult DLVerticesGeometry::GetPositionUVBuffer(
};
}
GeometryVertexType DLVerticesGeometry::GetVertexType() const {
GeometryVertexType DlVerticesGeometry::GetVertexType() const {
auto* dl_colors = vertices_->colors();
if (dl_colors != nullptr) {
return GeometryVertexType::kColor;
@@ -343,7 +343,7 @@ GeometryVertexType DLVerticesGeometry::GetVertexType() const {
return GeometryVertexType::kPosition;
}
std::optional<Rect> DLVerticesGeometry::GetCoverage(
std::optional<Rect> DlVerticesGeometry::GetCoverage(
const Matrix& transform) const {
return ToRect(vertices_->bounds()).TransformBounds(transform);
}

View File

@@ -17,11 +17,11 @@
namespace impeller {
/// @brief A geometry that is created from a vertices object.
class DLVerticesGeometry : public VerticesGeometry {
class DlVerticesGeometry : public VerticesGeometry {
public:
explicit DLVerticesGeometry(const flutter::DlVertices* vertices);
explicit DlVerticesGeometry(const flutter::DlVertices* vertices);
~DLVerticesGeometry();
~DlVerticesGeometry();
static std::shared_ptr<VerticesGeometry> MakeVertices(
const flutter::DlVertices* vertices);
@@ -64,7 +64,7 @@ class DLVerticesGeometry : public VerticesGeometry {
const flutter::DlVertices* vertices_;
std::vector<uint16_t> normalized_indices_;
FML_DISALLOW_COPY_AND_ASSIGN(DLVerticesGeometry);
FML_DISALLOW_COPY_AND_ASSIGN(DlVerticesGeometry);
};
} // namespace impeller

View File

@@ -21,14 +21,23 @@ namespace impeller {
namespace skia_conversions {
Rect ToRect(const SkRect& rect);
std::optional<Rect> ToRect(const SkRect* rect);
std::vector<Rect> ToRects(const SkRect tex[], int count);
Point ToPoint(const SkPoint& point);
Color ToColor(const SkColor& color);
std::vector<Matrix> ToRSXForms(const SkRSXform xform[], int count);
PathBuilder::RoundingRadii ToRoundingRadii(const SkRRect& rrect);
Path ToPath(const SkPath& path);
Path ToPath(const SkRRect& rrect);
std::optional<impeller::PixelFormat> ToPixelFormat(SkColorType type);
} // namespace skia_conversions

View File

@@ -11,7 +11,7 @@
#include "flutter/fml/trace_event.h"
#include "flutter/impeller/core/allocator.h"
#include "flutter/impeller/core/texture.h"
#include "flutter/impeller/display_list/display_list_image_impeller.h"
#include "flutter/impeller/display_list/dl_image_impeller.h"
#include "flutter/impeller/renderer/command_buffer.h"
#include "flutter/impeller/renderer/context.h"
#include "flutter/lib/ui/painting/image_decoder_skia.h"

View File

@@ -8,8 +8,8 @@
#include "flutter/flow/surface.h"
#include "flutter/fml/trace_event.h"
#include "flutter/impeller/display_list/display_list_dispatcher.h"
#include "flutter/impeller/display_list/display_list_image_impeller.h"
#include "flutter/impeller/display_list/dl_dispatcher.h"
#include "flutter/impeller/display_list/dl_image_impeller.h"
#include "flutter/impeller/geometry/size.h"
#include "flutter/shell/common/snapshot_controller.h"
@@ -34,7 +34,7 @@ sk_sp<DlImage> SnapshotControllerImpeller::DoMakeRasterSnapshot(
const sk_sp<DisplayList>& display_list,
SkISize size) {
TRACE_EVENT0("flutter", __FUNCTION__);
impeller::DisplayListDispatcher dispatcher;
impeller::DlDispatcher dispatcher;
display_list->Dispatch(dispatcher);
impeller::Picture picture = dispatcher.EndRecordingAsPicture();
auto context = GetDelegate().GetAiksContext();

View File

@@ -5,7 +5,7 @@
#include "flutter/shell/gpu/gpu_surface_gl_impeller.h"
#include "flutter/fml/make_copyable.h"
#include "flutter/impeller/display_list/display_list_dispatcher.h"
#include "flutter/impeller/display_list/dl_dispatcher.h"
#include "flutter/impeller/renderer/backend/gles/surface_gles.h"
#include "flutter/impeller/renderer/renderer.h"
@@ -103,7 +103,7 @@ std::unique_ptr<SurfaceFrame> GPUSurfaceGLImpeller::AcquireFrame(
return false;
}
impeller::DisplayListDispatcher impeller_dispatcher;
impeller::DlDispatcher impeller_dispatcher;
display_list->Dispatch(impeller_dispatcher);
auto picture = impeller_dispatcher.EndRecordingAsPicture();

View File

@@ -11,7 +11,7 @@
#include "flutter/fml/make_copyable.h"
#include "flutter/fml/mapping.h"
#include "flutter/fml/trace_event.h"
#include "flutter/impeller/display_list/display_list_dispatcher.h"
#include "flutter/impeller/display_list/dl_dispatcher.h"
#include "flutter/impeller/renderer/backend/metal/surface_mtl.h"
static_assert(!__has_feature(objc_arc), "ARC must be disabled.");
@@ -80,7 +80,7 @@ std::unique_ptr<SurfaceFrame> GPUSurfaceMetalImpeller::AcquireFrame(const SkISiz
return false;
}
impeller::DisplayListDispatcher impeller_dispatcher;
impeller::DlDispatcher impeller_dispatcher;
display_list->Dispatch(impeller_dispatcher);
auto picture = impeller_dispatcher.EndRecordingAsPicture();

View File

@@ -5,7 +5,7 @@
#include "flutter/shell/gpu/gpu_surface_vulkan_impeller.h"
#include "flutter/fml/make_copyable.h"
#include "flutter/impeller/display_list/display_list_dispatcher.h"
#include "flutter/impeller/display_list/dl_dispatcher.h"
#include "flutter/impeller/renderer/renderer.h"
#include "impeller/renderer/backend/vulkan/context_vk.h"
@@ -73,7 +73,7 @@ std::unique_ptr<SurfaceFrame> GPUSurfaceVulkanImpeller::AcquireFrame(
return false;
}
impeller::DisplayListDispatcher impeller_dispatcher;
impeller::DlDispatcher impeller_dispatcher;
display_list->Dispatch(impeller_dispatcher);
auto picture = impeller_dispatcher.EndRecordingAsPicture();

View File

@@ -5,7 +5,7 @@
#import "flutter/shell/platform/darwin/graphics/FlutterDarwinExternalTextureMetal.h"
#include "flutter/display_list/image/dl_image.h"
#include "impeller/base/validation.h"
#include "impeller/display_list/display_list_image_impeller.h"
#include "impeller/display_list/dl_image_impeller.h"
#include "impeller/renderer/backend/metal/texture_mtl.h"
#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkImage.h"