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 1 commit
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
Prev Previous commit
Next Next commit
revert bad fix
  • Loading branch information
gaaclarke committed Nov 9, 2022
commit 148491af53082f8e994ccc54876d251d4878d66b
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <map>
#include <memory>
#include <string>
#include <utility>

#include "flutter/common/graphics/persistent_cache.h"
#include "flutter/flow/rtree.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ class IOSContextGL;
class IOSSurface;

struct FlutterPlatformViewLayer {
FlutterPlatformViewLayer(fml::scoped_nsobject<UIView> overlay_view,
fml::scoped_nsobject<UIView> overlay_view_wrapper,
FlutterPlatformViewLayer(const fml::scoped_nsobject<UIView>& overlay_view,
const fml::scoped_nsobject<UIView>& overlay_view_wrapper,
std::unique_ptr<IOSSurface> ios_surface,
std::unique_ptr<Surface> surface);

Expand Down Expand Up @@ -142,8 +142,9 @@ class FlutterPlatformViewLayerPool {

// Gets a layer from the pool if available, or allocates a new one.
// Finally, it marks the layer as used. That is, it increments `available_layer_index_`.
std::shared_ptr<FlutterPlatformViewLayer> GetLayer(GrDirectContext* gr_context,
std::shared_ptr<IOSContext> ios_context);
std::shared_ptr<FlutterPlatformViewLayer> GetLayer(
GrDirectContext* gr_context,
const std::shared_ptr<IOSContext>& ios_context);

// Gets the layers in the pool that aren't currently used.
// This method doesn't mark the layers as unused.
Expand Down Expand Up @@ -207,10 +208,11 @@ class FlutterPlatformViewsController {
// returns nil.
UIView* GetPlatformViewByID(int view_id);

PostPrerollResult PostPrerollAction(fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger);
PostPrerollResult PostPrerollAction(
const fml::RefPtr<fml::RasterThreadMerger>& raster_thread_merger);

void EndFrame(bool should_resubmit_frame,
fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger);
const fml::RefPtr<fml::RasterThreadMerger>& raster_thread_merger);

std::vector<SkCanvas*> GetCurrentCanvases();

Expand All @@ -226,7 +228,7 @@ class FlutterPlatformViewsController {
void Reset();

bool SubmitFrame(GrDirectContext* gr_context,
std::shared_ptr<IOSContext> ios_context,
const std::shared_ptr<IOSContext>& ios_context,
std::unique_ptr<SurfaceFrame> frame);

void OnMethodCall(FlutterMethodCall* call, FlutterResult& result);
Expand All @@ -236,7 +238,7 @@ class FlutterPlatformViewsController {
long FindFirstResponderPlatformViewId();

// Pushes backdrop filter mutation to the mutator stack of each visited platform view.
void PushFilterToVisitedPlatformViews(std::shared_ptr<const DlImageFilter> filter,
void PushFilterToVisitedPlatformViews(const std::shared_ptr<const DlImageFilter>& filter,
const SkRect& filter_rect);

// Pushes the view id of a visted platform view to the list of visied platform views.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
namespace flutter {

FlutterPlatformViewLayer::FlutterPlatformViewLayer(
fml::scoped_nsobject<UIView> overlay_view,
fml::scoped_nsobject<UIView> overlay_view_wrapper,
const fml::scoped_nsobject<UIView>& overlay_view,
const fml::scoped_nsobject<UIView>& overlay_view_wrapper,
std::unique_ptr<IOSSurface> ios_surface,
std::unique_ptr<Surface> surface)
: overlay_view(std::move(overlay_view)),
overlay_view_wrapper(std::move(overlay_view_wrapper)),
: overlay_view(overlay_view),
overlay_view_wrapper(overlay_view_wrapper),
ios_surface(std::move(ios_surface)),
surface(std::move(surface)){};

Expand Down
4 changes: 2 additions & 2 deletions shell/platform/darwin/ios/ios_external_view_embedder.mm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
IOSExternalViewEmbedder::IOSExternalViewEmbedder(
const std::shared_ptr<FlutterPlatformViewsController>& platform_views_controller,
std::shared_ptr<IOSContext> context)
: platform_views_controller_(platform_views_controller), ios_context_(context) {
: platform_views_controller_(platform_views_controller), ios_context_(std::move(context)) {
FML_CHECK(ios_context_);
}

Expand Down Expand Up @@ -82,7 +82,7 @@
std::unique_ptr<SurfaceFrame> frame) {
TRACE_EVENT0("flutter", "IOSExternalViewEmbedder::SubmitFrame");
FML_CHECK(platform_views_controller_);
platform_views_controller_->SubmitFrame(std::move(context), ios_context_, std::move(frame));
platform_views_controller_->SubmitFrame(context, ios_context_, std::move(frame));
TRACE_EVENT0("flutter", "IOSExternalViewEmbedder::DidSubmitFrame");
}

Expand Down
2 changes: 1 addition & 1 deletion shell/platform/darwin/ios/ios_surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ bool IsIosEmbeddedViewsPreviewEnabled();
class IOSSurface {
public:
static std::unique_ptr<IOSSurface> Create(std::shared_ptr<IOSContext> context,
fml::scoped_nsobject<CALayer> layer);
const fml::scoped_nsobject<CALayer>& layer);

std::shared_ptr<IOSContext> GetContext() const;

Expand Down
2 changes: 1 addition & 1 deletion shell/platform/darwin/ios/ios_surface.mm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
namespace flutter {

std::unique_ptr<IOSSurface> IOSSurface::Create(std::shared_ptr<IOSContext> context,
fml::scoped_nsobject<CALayer> layer) {
const fml::scoped_nsobject<CALayer>& layer) {
FML_DCHECK(layer);
FML_DCHECK(context);

Expand Down