Index: cc/paint/paint_op_buffer.cc |
diff --git a/cc/paint/paint_op_buffer.cc b/cc/paint/paint_op_buffer.cc |
index fa62a418e9fce2bb5fee71e9f6eb057567ac9171..0a1897852f3e51ca3d91b67460b2d6e84dace61a 100644 |
--- a/cc/paint/paint_op_buffer.cc |
+++ b/cc/paint/paint_op_buffer.cc |
@@ -416,6 +416,10 @@ size_t DrawDisplayItemListOp::AdditionalBytesUsed() const { |
return list->ApproximateMemoryUsage(); |
} |
+bool DrawDisplayItemListOp::HasDiscardableImages() const { |
+ return list->has_discardable_images(); |
+} |
+ |
DrawDisplayItemListOp::DrawDisplayItemListOp(const DrawDisplayItemListOp& op) = |
default; |
@@ -433,6 +437,12 @@ DrawImageOp::DrawImageOp(const PaintImage& image, |
top(top), |
flags(flags ? *flags : PaintFlags()) {} |
+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, |
@@ -446,6 +456,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, |
@@ -464,6 +478,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, |