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

Unified Diff: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h

Issue 2365653005: Fix failing transferToImageBitmap layout tests and commit pixel test on Mac (Closed)
Patch Set: rebase Created 4 years, 3 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/gpu/DrawingBuffer.h
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h
index 913102f321d22951f602ebea1ff9dcd5b6da92d3..ec0db57022325435f43700ed19e125de3c3c6cac 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h
@@ -76,13 +76,18 @@ class PLATFORM_EXPORT DrawingBuffer : public NON_EXPORTED_BASE(cc::TextureLayerC
public:
enum PreserveDrawingBuffer {
Preserve,
- Discard
+ Discard,
};
enum WebGLVersion {
WebGL1,
WebGL2,
};
+ enum ChromiumImageUsage {
+ AllowChromiumImage,
+ DisallowChromiumImage,
+ };
+
static PassRefPtr<DrawingBuffer> create(
std::unique_ptr<WebGraphicsContext3DProvider>,
const IntSize&,
@@ -92,7 +97,8 @@ public:
bool wantStencilBuffer,
bool wantAntialiasing,
PreserveDrawingBuffer,
- WebGLVersion);
+ WebGLVersion,
+ ChromiumImageUsage);
static void forceNextDrawingBufferCreationToFail();
~DrawingBuffer() override;
@@ -261,7 +267,8 @@ protected: // For unittests
PreserveDrawingBuffer,
WebGLVersion,
bool wantsDepth,
- bool wantsStencil);
+ bool wantsStencil,
+ ChromiumImageUsage);
bool initialize(const IntSize&, bool useMultisampling);
@@ -503,6 +510,13 @@ private:
// Used to flip a bitmap vertically.
Vector<uint8_t> m_scanline;
+
+ // In the case of OffscreenCanvas, we do not want to enable the WebGLImageChromium flag,
+ // so we replace all the RuntimeEnabledFeatures::webGLImageChromiumEnabled() call with
+ // shouldUseChromiumImage() call, and set m_chromiumImageUsage to DisallowChromiumImage
+ // in the case of OffscreenCanvas.
+ ChromiumImageUsage m_chromiumImageUsage;
+ bool shouldUseChromiumImage();
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698