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

don't report GPU image size #35473

Merged
merged 5 commits into from
Aug 17, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/ui/painting/display_list_deferred_image_gpu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ SkISize DlDeferredImageGPU::dimensions() const {

// |DlImage|
size_t DlDeferredImageGPU::GetApproximateByteSize() const {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should just do this in image.cc (CanvasImage::GetAllocationSize instead of here.

There's a feature request somewhere to expose the size of an image through to dart:ui. This method should be left as-is to support that. Alternatively, we should just delete these methods from DlImage.

There's already a hacky work around in CanvasImage::GetAllocationSize to try to avoid tripping up the VM when you allocate a really large image. I'm becoming more convinced that we should just stop telling the VM about image sizes.

@rmacnak-google or @jason-simmons might have some better ideas.

return sizeof(this) + (image_wrapper_
? image_wrapper_->image_info().computeMinByteSize()
: 0);
// We don't actually want Dart's GC to use the size of this object to make GC
// decisions, as it is generally both created and disposed in the framework.
// This is similar to why we do not report the sizes of engine layers.
return sizeof(this);
}

std::optional<std::string> DlDeferredImageGPU::get_error() const {
Expand Down