summaryrefslogtreecommitdiff
path: root/chromium/cc/paint/paint_image.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/cc/paint/paint_image.h
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
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 {