[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Impeller] dont accidentally copy shared ptr. #49731

Merged
merged 1 commit into from
Jan 11, 2024
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
3 changes: 2 additions & 1 deletion impeller/entity/contents/solid_color_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "impeller/entity/contents/clip_contents.h"
#include "impeller/entity/contents/content_context.h"
#include "impeller/entity/entity.h"
#include "impeller/entity/geometry/geometry.h"
#include "impeller/geometry/path.h"
#include "impeller/renderer/render_pass.h"

Expand Down Expand Up @@ -38,7 +39,7 @@ std::optional<Rect> SolidColorContents::GetCoverage(
return std::nullopt;
}

auto geometry = GetGeometry();
const std::shared_ptr<Geometry>& geometry = GetGeometry();
if (geometry == nullptr) {
return std::nullopt;
}
Expand Down
6 changes: 4 additions & 2 deletions impeller/entity/contents/vertices_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#include "impeller/entity/contents/content_context.h"
#include "impeller/entity/contents/filters/color_filter_contents.h"
#include "impeller/entity/geometry/geometry.h"
#include "impeller/entity/geometry/vertices_geometry.h"
#include "impeller/entity/position_color.vert.h"
#include "impeller/entity/vertices.frag.h"
#include "impeller/geometry/color.h"
Expand Down Expand Up @@ -122,7 +124,7 @@ bool VerticesUVContents::Render(const ContentContext& renderer,
Command cmd;
DEBUG_COMMAND_INFO(cmd, "VerticesUV");
auto& host_buffer = renderer.GetTransientsBuffer();
auto geometry = parent_.GetGeometry();
const std::shared_ptr<Geometry>& geometry = parent_.GetGeometry();

auto coverage = src_contents->GetCoverage(Entity{});
if (!coverage.has_value()) {
Expand Down Expand Up @@ -176,7 +178,7 @@ bool VerticesColorContents::Render(const ContentContext& renderer,
Command cmd;
DEBUG_COMMAND_INFO(cmd, "VerticesColors");
auto& host_buffer = renderer.GetTransientsBuffer();
auto geometry = parent_.GetGeometry();
const std::shared_ptr<VerticesGeometry>& geometry = parent_.GetGeometry();

auto geometry_result =
geometry->GetPositionColorBuffer(renderer, entity, pass);
Expand Down
4 changes: 0 additions & 4 deletions impeller/entity/geometry/round_rect_geometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <algorithm>

#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)
Expand Down