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 |