Index: cc/paint/paint_op_buffer.cc |
diff --git a/cc/paint/paint_op_buffer.cc b/cc/paint/paint_op_buffer.cc |
index 8387dae108ab6a8a9977512dce602c85a38e475c..eb80ff024b9eba0d96433568a008030842980756 100644 |
--- a/cc/paint/paint_op_buffer.cc |
+++ b/cc/paint/paint_op_buffer.cc |
@@ -502,6 +502,10 @@ size_t DrawDisplayItemListOp::AdditionalBytesUsed() const { |
return list->ApproximateMemoryUsage(); |
} |
+bool DrawDisplayItemListOp::HasDiscardableImages() const { |
+ return list->has_discardable_images(); |
+} |
+ |
DrawDisplayItemListOp::DrawDisplayItemListOp(const DrawDisplayItemListOp& op) = |
default; |
@@ -519,6 +523,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, |
@@ -532,6 +542,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, |
@@ -550,6 +564,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, |