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

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: rebase Created 3 years, 7 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
« no previous file with comments | « cc/paint/paint_op_buffer.h ('k') | cc/paint/paint_op_buffer_unittest.cc » ('j') | 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 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,
« no previous file with comments | « cc/paint/paint_op_buffer.h ('k') | cc/paint/paint_op_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698