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

Unified Diff: third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurface.h

Issue 2840093002: Allow RecordingImageBufferSurface to prevent fallback. (Closed)
Patch Set: imagebuffer-fallback: missedone 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/platform/graphics/RecordingImageBufferSurface.h
diff --git a/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurface.h b/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurface.h
index 8ed5756c8c4a8ee02656fef359b197005f56dd2a..19938f7950befaa19fa57800ef348098e88f74cf 100644
--- a/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurface.h
+++ b/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurface.h
@@ -23,14 +23,16 @@ class PLATFORM_EXPORT RecordingImageBufferSurface : public ImageBufferSurface {
USING_FAST_MALLOC(RecordingImageBufferSurface);
public:
- // If the fallbackFactory is null the buffer surface should only be used
- // for one frame and should not be used for any operations which need a
- // raster surface, (i.e. writePixels).
- // Only #getRecord should be used to access the resulting frame.
- RecordingImageBufferSurface(
- const IntSize&,
- OpacityMode = kNonOpaque,
- const CanvasColorParams& = CanvasColorParams());
+ enum AllowFallback : bool { kDisallowFallback, kAllowFallback };
+
+ // If |AllowFallback| is kDisallowFallback the buffer surface should only be
+ // used for one frame and should not be used for any operations which need a
+ // raster surface, (i.e. WritePixels()).
+ // Only GetRecord() should be used to access the resulting frame.
+ RecordingImageBufferSurface(const IntSize&,
+ AllowFallback,
+ OpacityMode = kNonOpaque,
+ const CanvasColorParams& = CanvasColorParams());
~RecordingImageBufferSurface() override;
// Implementation of ImageBufferSurface interfaces
@@ -106,6 +108,7 @@ class PLATFORM_EXPORT RecordingImageBufferSurface : public ImageBufferSurface {
bool FinalizeFrameInternal(FallbackReason*);
int ApproximateOpCount();
+ const AllowFallback allow_fallback_;
std::unique_ptr<PaintRecorder> current_frame_;
sk_sp<PaintRecord> previous_frame_;
std::unique_ptr<UnacceleratedImageBufferSurface> fallback_surface_;

Powered by Google App Engine
This is Rietveld 408576698