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

Unified Diff: third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h

Issue 2849463005: Refactor ImageBuffer to make OffscreenCanvas match HTMLCanvasElement (Closed)
Patch Set: x 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
Index: third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
diff --git a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
index 5f9cf10836a1ad2d07ef3ec9bf14b5f91e0d6f45..3401f5a8b7ebdac9505a69f4b427d69bb27d9791 100644
--- a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
+++ b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
@@ -13,6 +13,7 @@
#include "core/html/HTMLCanvasElement.h"
#include "core/html/canvas/CanvasImageSource.h"
#include "core/html/canvas/CanvasRenderingContextHost.h"
+#include "core/imagebitmap/ImageBitmapSource.h"
#include "core/offscreencanvas/ImageEncodeOptions.h"
#include "platform/geometry/IntSize.h"
#include "platform/graphics/OffscreenCanvasFrameDispatcher.h"
@@ -83,6 +84,10 @@ class CORE_EXPORT OffscreenCanvas final
disable_reading_from_canvas_ = true;
}
+ void DiscardImageBuffer() override;
+ ImageBuffer* GetImageBuffer() const { return image_buffer_.get(); }
+ ImageBuffer* GetOrCreateImageBuffer() override;
+
void SetFrameSinkId(uint32_t client_id, uint32_t sink_id) {
client_id_ = client_id;
sink_id_ = sink_id;
@@ -133,7 +138,7 @@ class CORE_EXPORT OffscreenCanvas final
PassRefPtr<Image> GetSourceImageForCanvas(SourceImageStatus*,
AccelerationHint,
SnapshotReason,
- const FloatSize&) const final;
+ const FloatSize&) final;
bool WouldTaintOrigin(SecurityOrigin*) const final { return !origin_clean_; }
FloatSize ElementSize(const FloatSize& default_object_size) const final {
return FloatSize(width(), height());
@@ -181,6 +186,9 @@ class CORE_EXPORT OffscreenCanvas final
RefPtr<StaticBitmapImage> current_frame_;
bool current_frame_is_web_gl_software_rendering_ = false;
+ std::unique_ptr<ImageBuffer> image_buffer_;
+ bool needs_matrix_clip_restore_ = false;
+
// cc::FrameSinkId is broken into two integer components as this can be used
// in transfer of OffscreenCanvas across threads
// If this object is not created via

Powered by Google App Engine
This is Rietveld 408576698