| Index: cc/paint/paint_op_buffer.cc
|
| diff --git a/cc/paint/paint_op_buffer.cc b/cc/paint/paint_op_buffer.cc
|
| index 0fb012d76ad2b2061ea7dbb5a34cb938e288c16a..158dffb6fc9d9d88342b48324ff016c62f9f0998 100644
|
| --- a/cc/paint/paint_op_buffer.cc
|
| +++ b/cc/paint/paint_op_buffer.cc
|
| @@ -485,6 +485,10 @@ size_t DrawDisplayItemListOp::AdditionalBytesUsed() const {
|
| return list->ApproximateMemoryUsage();
|
| }
|
|
|
| +bool DrawDisplayItemListOp::HasDiscardableImages() const {
|
| + return list->has_discardable_images();
|
| +}
|
| +
|
| DrawDisplayItemListOp::DrawDisplayItemListOp(const DrawDisplayItemListOp& op) =
|
| default;
|
|
|
| @@ -502,6 +506,12 @@ DrawImageOp::DrawImageOp(const PaintImage& image,
|
| left(left),
|
| top(top) {}
|
|
|
| +bool DrawImageOp::HasDiscardableImages() const {
|
| + // TODO(khushalsagar): Callers should not be able to change the lazy generated
|
| + // state for a PaintImage.
|
| + return image.sk_image()->isLazyGenerated();
|
| +}
|
| +
|
| DrawImageOp::~DrawImageOp() = default;
|
|
|
| DrawImageRectOp::DrawImageRectOp(const PaintImage& image,
|
| @@ -515,6 +525,10 @@ DrawImageRectOp::DrawImageRectOp(const PaintImage& image,
|
| dst(dst),
|
| constraint(constraint) {}
|
|
|
| +bool DrawImageRectOp::HasDiscardableImages() const {
|
| + return image.sk_image()->isLazyGenerated();
|
| +}
|
| +
|
| DrawImageRectOp::~DrawImageRectOp() = default;
|
|
|
| DrawPosTextOp::DrawPosTextOp(size_t bytes,
|
| @@ -533,6 +547,10 @@ size_t DrawRecordOp::AdditionalBytesUsed() const {
|
| return record->approximateBytesUsed();
|
| }
|
|
|
| +bool DrawRecordOp::HasDiscardableImages() const {
|
| + return record->HasDiscardableImages();
|
| +}
|
| +
|
| DrawTextBlobOp::DrawTextBlobOp(sk_sp<SkTextBlob> blob,
|
| SkScalar x,
|
| SkScalar y,
|
|
|