summaryrefslogtreecommitdiff
path: root/chromium/cc/paint/paint_image.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/cc/paint/paint_image.h')
-rw-r--r--chromium/cc/paint/paint_image.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/chromium/cc/paint/paint_image.h b/chromium/cc/paint/paint_image.h
index 95881204e0a..1d7503a2d04 100644
--- a/chromium/cc/paint/paint_image.h
+++ b/chromium/cc/paint/paint_image.h
@@ -8,12 +8,12 @@
#include <vector>
#include "base/gtest_prod_util.h"
-#include "base/logging.h"
#include "base/memory/scoped_refptr.h"
#include "base/optional.h"
#include "cc/paint/frame_metadata.h"
#include "cc/paint/image_animation_count.h"
#include "cc/paint/paint_export.h"
+#include "gpu/command_buffer/common/mailbox.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkYUVAIndex.h"
#include "third_party/skia/include/core/SkYUVASizeInfo.h"
@@ -229,8 +229,16 @@ class CC_PAINT_EXPORT PaintImage {
const SkYUVASizeInfo& yuva_size_info,
SkYUVAIndex* plane_indices) const;
+ // Returns the SkImage associated with this PaintImage. If PaintImage is
+ // texture backed, this API may do a readback from GPU to CPU memory.
+ // Avoid using this API unless actual pixels are needed.
+ // For other cases, prefer using PaintImage APIs directly or use
+ // GetSkImageInfo() for metadata about the SkImage.
+ const sk_sp<SkImage>& GetRasterSkImage() const;
+
Id stable_id() const { return id_; }
const sk_sp<SkImage>& GetSkImage() const;
+ gpu::Mailbox GetMailbox() const;
AnimationType animation_type() const { return animation_type_; }
CompletionState completion_state() const { return completion_state_; }
bool is_multipart() const { return is_multipart_; }
@@ -253,9 +261,7 @@ class CC_PAINT_EXPORT PaintImage {
return paint_worklet_input_ ? false : GetSkImage()->isLazyGenerated();
}
bool IsPaintWorklet() const { return !!paint_worklet_input_; }
- bool IsTextureBacked() const {
- return paint_worklet_input_ ? false : GetSkImage()->isTextureBacked();
- }
+ bool IsTextureBacked() const;
int width() const;
int height() const;
SkColorSpace* color_space() const {