Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 4fbd53e

Browse files
committed
Revert "manual fix of violations"
This reverts commit 9ef0fb5.
1 parent 9ef0fb5 commit 4fbd53e

35 files changed

+139
-147
lines changed

display_list/display_list_builder.cc

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ void DisplayListBuilder::drawPoints(SkCanvas::PointMode mode,
863863
}
864864
void DisplayListBuilder::drawSkVertices(const sk_sp<SkVertices> vertices,
865865
SkBlendMode mode) {
866-
Push<DrawSkVerticesOp>(0, 1, vertices, mode);
866+
Push<DrawSkVerticesOp>(0, 1, std::move(vertices), mode);
867867
// DrawVertices applies its colors to the paint so we have no way
868868
// of controlling opacity using the current paint attributes.
869869
// Although, examination of the |mode| might find some predictable
@@ -892,8 +892,8 @@ void DisplayListBuilder::drawImage(const sk_sp<DlImage> image,
892892
DlImageSampling sampling,
893893
bool render_with_attributes) {
894894
render_with_attributes
895-
? Push<DrawImageWithAttrOp>(0, 1, image, point, sampling)
896-
: Push<DrawImageOp>(0, 1, image, point, sampling);
895+
? Push<DrawImageWithAttrOp>(0, 1, std::move(image), point, sampling)
896+
: Push<DrawImageOp>(0, 1, std::move(image), point, sampling);
897897
CheckLayerOpacityCompatibility(render_with_attributes);
898898
}
899899
void DisplayListBuilder::drawImage(const sk_sp<DlImage>& image,
@@ -914,8 +914,8 @@ void DisplayListBuilder::drawImageRect(const sk_sp<DlImage> image,
914914
DlImageSampling sampling,
915915
bool render_with_attributes,
916916
SkCanvas::SrcRectConstraint constraint) {
917-
Push<DrawImageRectOp>(0, 1, image, src, dst, sampling, render_with_attributes,
918-
constraint);
917+
Push<DrawImageRectOp>(0, 1, std::move(image), src, dst, sampling,
918+
render_with_attributes, constraint);
919919
CheckLayerOpacityCompatibility(render_with_attributes);
920920
}
921921
void DisplayListBuilder::drawImageRect(const sk_sp<DlImage>& image,
@@ -938,8 +938,9 @@ void DisplayListBuilder::drawImageNine(const sk_sp<DlImage> image,
938938
DlFilterMode filter,
939939
bool render_with_attributes) {
940940
render_with_attributes
941-
? Push<DrawImageNineWithAttrOp>(0, 1, image, center, dst, filter)
942-
: Push<DrawImageNineOp>(0, 1, image, center, dst, filter);
941+
? Push<DrawImageNineWithAttrOp>(0, 1, std::move(image), center, dst,
942+
filter)
943+
: Push<DrawImageNineOp>(0, 1, std::move(image), center, dst, filter);
943944
CheckLayerOpacityCompatibility(render_with_attributes);
944945
}
945946
void DisplayListBuilder::drawImageNine(const sk_sp<DlImage>& image,
@@ -970,9 +971,9 @@ void DisplayListBuilder::drawImageLattice(const sk_sp<DlImage> image,
970971
(x_div_count + y_div_count) * sizeof(int) +
971972
cell_count * (sizeof(SkColor) + sizeof(SkCanvas::Lattice::RectType));
972973
SkIRect src = lattice.fBounds ? *lattice.fBounds : image->bounds();
973-
void* pod = this->Push<DrawImageLatticeOp>(bytes, 1, image, x_div_count,
974-
y_div_count, cell_count, src, dst,
975-
filter, render_with_attributes);
974+
void* pod = this->Push<DrawImageLatticeOp>(
975+
bytes, 1, std::move(image), x_div_count, y_div_count, cell_count, src,
976+
dst, filter, render_with_attributes);
976977
CopyV(pod, lattice.fXDivs, x_div_count, lattice.fYDivs, y_div_count,
977978
lattice.fColors, cell_count, lattice.fRectTypes, cell_count);
978979
CheckLayerOpacityCompatibility(render_with_attributes);
@@ -991,22 +992,22 @@ void DisplayListBuilder::drawAtlas(const sk_sp<DlImage> atlas,
991992
if (colors != nullptr) {
992993
bytes += count * sizeof(DlColor);
993994
if (cull_rect != nullptr) {
994-
data_ptr =
995-
Push<DrawAtlasCulledOp>(bytes, 1, atlas, count, mode, sampling, true,
996-
*cull_rect, render_with_attributes);
995+
data_ptr = Push<DrawAtlasCulledOp>(bytes, 1, std::move(atlas), count,
996+
mode, sampling, true, *cull_rect,
997+
render_with_attributes);
997998
} else {
998-
data_ptr = Push<DrawAtlasOp>(bytes, 1, atlas, count, mode, sampling, true,
999-
render_with_attributes);
999+
data_ptr = Push<DrawAtlasOp>(bytes, 1, std::move(atlas), count, mode,
1000+
sampling, true, render_with_attributes);
10001001
}
10011002
CopyV(data_ptr, xform, count, tex, count, colors, count);
10021003
} else {
10031004
if (cull_rect != nullptr) {
1004-
data_ptr =
1005-
Push<DrawAtlasCulledOp>(bytes, 1, atlas, count, mode, sampling, false,
1006-
*cull_rect, render_with_attributes);
1005+
data_ptr = Push<DrawAtlasCulledOp>(bytes, 1, std::move(atlas), count,
1006+
mode, sampling, false, *cull_rect,
1007+
render_with_attributes);
10071008
} else {
1008-
data_ptr = Push<DrawAtlasOp>(bytes, 1, atlas, count, mode, sampling,
1009-
false, render_with_attributes);
1009+
data_ptr = Push<DrawAtlasOp>(bytes, 1, std::move(atlas), count, mode,
1010+
sampling, false, render_with_attributes);
10101011
}
10111012
CopyV(data_ptr, xform, count, tex, count);
10121013
}
@@ -1068,7 +1069,7 @@ void DisplayListBuilder::drawDisplayList(
10681069
void DisplayListBuilder::drawTextBlob(const sk_sp<SkTextBlob> blob,
10691070
SkScalar x,
10701071
SkScalar y) {
1071-
Push<DrawTextBlobOp>(0, 1, blob, x, y);
1072+
Push<DrawTextBlobOp>(0, 1, std::move(blob), x, y);
10721073
CheckLayerOpacityCompatibility();
10731074
}
10741075
void DisplayListBuilder::drawShadow(const SkPath& path,

flow/compositor_context.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ std::unique_ptr<CompositorContext::ScopedFrame> CompositorContext::AcquireFrame(
8181
const SkMatrix& root_surface_transformation,
8282
bool instrumentation_enabled,
8383
bool surface_supports_readback,
84-
const fml::RefPtr<fml::RasterThreadMerger>& raster_thread_merger,
84+
fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger,
8585
DisplayListBuilder* display_list_builder) {
8686
return std::make_unique<ScopedFrame>(
8787
*this, gr_context, canvas, view_embedder, root_surface_transformation,

flow/compositor_context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class CompositorContext {
167167
const SkMatrix& root_surface_transformation,
168168
bool instrumentation_enabled,
169169
bool surface_supports_readback,
170-
const fml::RefPtr<fml::RasterThreadMerger>& raster_thread_merger,
170+
fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger,
171171
DisplayListBuilder* display_list_builder);
172172

173173
void OnGrContextCreated();

flow/diff_context.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ void DiffContext::AddReadbackRegion(const SkIRect& rect) {
202202
readback.position = rects_->size();
203203
// Push empty rect as a placeholder for position in current subtree
204204
rects_->push_back(SkRect::MakeEmpty());
205-
readbacks_.push_back(readback);
205+
readbacks_.push_back(std::move(readback));
206206
}
207207

208208
PaintRegion DiffContext::CurrentSubtreeRegion() const {

impeller/aiks/aiks_unittests.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ TEST_P(AiksTest, CanRenderImage) {
7777

7878
bool GenerateMipmap(const std::shared_ptr<Context>& context,
7979
std::shared_ptr<Texture> texture,
80-
const std::string& label) {
80+
std::string label) {
8181
auto buffer = context->CreateCommandBuffer();
8282
if (!buffer) {
8383
return false;

impeller/aiks/canvas.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ void Canvas::DrawPicture(Picture picture) {
258258
void Canvas::DrawImage(const std::shared_ptr<Image>& image,
259259
Point offset,
260260
const Paint& paint,
261-
const SamplerDescriptor& sampler) {
261+
SamplerDescriptor sampler) {
262262
if (!image) {
263263
return;
264264
}
@@ -274,7 +274,7 @@ void Canvas::DrawImageRect(const std::shared_ptr<Image>& image,
274274
Rect source,
275275
Rect dest,
276276
const Paint& paint,
277-
const SamplerDescriptor& sampler) {
277+
SamplerDescriptor sampler) {
278278
if (!image || source.size.IsEmpty() || dest.size.IsEmpty()) {
279279
return;
280280
}
@@ -394,7 +394,7 @@ void Canvas::DrawAtlas(const std::shared_ptr<Image>& atlas,
394394
std::vector<Rect> texture_coordinates,
395395
std::vector<Color> colors,
396396
BlendMode blend_mode,
397-
const SamplerDescriptor& sampler,
397+
SamplerDescriptor sampler,
398398
std::optional<Rect> cull_rect,
399399
const Paint& paint) {
400400
if (!atlas) {

impeller/aiks/canvas.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ class Canvas {
7979
void DrawImage(const std::shared_ptr<Image>& image,
8080
Point offset,
8181
const Paint& paint,
82-
const SamplerDescriptor& sampler = {});
82+
SamplerDescriptor sampler = {});
8383

8484
void DrawImageRect(const std::shared_ptr<Image>& image,
8585
Rect source,
8686
Rect dest,
8787
const Paint& paint,
88-
const SamplerDescriptor& sampler = {});
88+
SamplerDescriptor sampler = {});
8989

9090
void ClipPath(
9191
const Path& path,
@@ -106,7 +106,7 @@ class Canvas {
106106
std::vector<Rect> texture_coordinates,
107107
std::vector<Color> colors,
108108
BlendMode blend_mode,
109-
const SamplerDescriptor& sampler,
109+
SamplerDescriptor sampler,
110110
std::optional<Rect> cull_rect,
111111
const Paint& paint);
112112

impeller/blobcat/blob_library.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,8 @@ size_t BlobLibrary::GetShaderCount() const {
7171
return blobs_.size();
7272
}
7373

74-
std::shared_ptr<fml::Mapping> BlobLibrary::GetMapping(
75-
BlobShaderType type,
76-
const std::string& name) const {
74+
std::shared_ptr<fml::Mapping> BlobLibrary::GetMapping(BlobShaderType type,
75+
std::string name) const {
7776
BlobKey key;
7877
key.type = type;
7978
key.name = std::move(name);

impeller/blobcat/blob_library.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class BlobLibrary {
2828
size_t GetShaderCount() const;
2929

3030
std::shared_ptr<fml::Mapping> GetMapping(BlobShaderType type,
31-
const std::string& name) const;
31+
std::string name) const;
3232

3333
size_t IterateAllBlobs(
3434
const std::function<bool(BlobShaderType type,

impeller/blobcat/blob_writer.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ bool BlobWriter::AddBlobAtPath(const std::string& std_path) {
7272
}
7373

7474
bool BlobWriter::AddBlob(BlobShaderType type,
75-
const std::string& name,
76-
const std::shared_ptr<fml::Mapping>& mapping) {
75+
std::string name,
76+
std::shared_ptr<fml::Mapping> mapping) {
7777
if (name.empty() || !mapping || mapping->GetMapping() == nullptr) {
7878
return false;
7979
}

0 commit comments

Comments
 (0)