Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Unified Diff: cc/paint/paint_op_buffer.cc

Issue 2830243002: cc: Don't perform image analysis if the DisplayItemList has no images. (Closed)
Patch Set: for-draw-ops-only Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« cc/paint/paint_op_buffer.h ('K') | « cc/paint/paint_op_buffer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« cc/paint/paint_op_buffer.h ('K') | « cc/paint/paint_op_buffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698