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
2 changes: 1 addition & 1 deletion lib/ui/painting/engine_layer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ EngineLayer::EngineLayer(std::shared_ptr<flutter::ContainerLayer> layer)

EngineLayer::~EngineLayer() = default;

size_t EngineLayer::GetAllocationSize() {
size_t EngineLayer::GetAllocationSize() const {
// Provide an approximation of the total memory impact of this object to the
// Dart GC. The ContainerLayer may hold references to a tree of other layers,
// which in turn may contain Skia objects.
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/painting/engine_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class EngineLayer : public RefCountedDartWrappable<EngineLayer> {
public:
~EngineLayer() override;

size_t GetAllocationSize() override;
size_t GetAllocationSize() const override;

static fml::RefPtr<EngineLayer> MakeRetained(
std::shared_ptr<flutter::ContainerLayer> layer) {
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/painting/image.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void CanvasImage::dispose() {
ClearDartWrapper();
}

size_t CanvasImage::GetAllocationSize() {
size_t CanvasImage::GetAllocationSize() const {
if (auto image = image_.get()) {
const auto& info = image->imageInfo();
const auto kMipmapOverhead = 4.0 / 3.0;
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/painting/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class CanvasImage final : public RefCountedDartWrappable<CanvasImage> {
image_ = std::move(image);
}

size_t GetAllocationSize() override;
size_t GetAllocationSize() const override;

static void RegisterNatives(tonic::DartLibraryNatives* natives);

Expand Down
2 changes: 1 addition & 1 deletion lib/ui/painting/picture.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void Picture::dispose() {
ClearDartWrapper();
}

size_t Picture::GetAllocationSize() {
size_t Picture::GetAllocationSize() const {
if (auto picture = picture_.get()) {
return picture->approximateBytesUsed();
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/painting/picture.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Picture : public RefCountedDartWrappable<Picture> {

void dispose();

size_t GetAllocationSize() override;
size_t GetAllocationSize() const override;

static void RegisterNatives(tonic::DartLibraryNatives* natives);

Expand Down
2 changes: 1 addition & 1 deletion lib/ui/painting/single_frame_codec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Dart_Handle SingleFrameCodec::getNextFrame(Dart_Handle callback_handle) {
return Dart_Null();
}

size_t SingleFrameCodec::GetAllocationSize() {
size_t SingleFrameCodec::GetAllocationSize() const {
const auto& data = descriptor_.data;
const auto data_byte_size = data ? data->size() : 0;
const auto frame_byte_size = (cached_frame_ && cached_frame_->image())
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/painting/single_frame_codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class SingleFrameCodec : public Codec {
Dart_Handle getNextFrame(Dart_Handle args) override;

// |DartWrappable|
size_t GetAllocationSize() override;
size_t GetAllocationSize() const override;

private:
enum class Status { kNew, kInProgress, kComplete };
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/text/paragraph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Paragraph::Paragraph(std::unique_ptr<txt::Paragraph> paragraph)

Paragraph::~Paragraph() = default;

size_t Paragraph::GetAllocationSize() {
size_t Paragraph::GetAllocationSize() const {
// We don't have an accurate accounting of the paragraph's memory consumption,
// so return a fixed size to indicate that its impact is more than the size
// of the Paragraph class.
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/text/paragraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Paragraph : public RefCountedDartWrappable<Paragraph> {
Dart_Handle getLineBoundary(unsigned offset);
tonic::Float64List computeLineMetrics();

size_t GetAllocationSize() override;
size_t GetAllocationSize() const override;

static void RegisterNatives(tonic::DartLibraryNatives* natives);

Expand Down
2 changes: 1 addition & 1 deletion third_party/tonic/dart_wrappable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void DartWrappable::FinalizeDartWrapper(void* isolate_callback_data,
wrappable->ReleaseDartWrappableReference(); // Balanced in CreateDartWrapper.
}

size_t DartWrappable::GetAllocationSize() {
size_t DartWrappable::GetAllocationSize() const {
return GetDartWrapperInfo().size_in_bytes;
}

Expand Down
2 changes: 1 addition & 1 deletion third_party/tonic/dart_wrappable.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class DartWrappable {
// Override this to customize the object size reported to the Dart garbage
// collector.
// Implement using IMPLEMENT_WRAPPERTYPEINFO macro
virtual size_t GetAllocationSize();
virtual size_t GetAllocationSize() const;

virtual void RetainDartWrappableReference() const = 0;

Expand Down